nikobarli
Topic Author
Posts: 183
Joined: 26 Apr 2017, 06:23

Cannot show character "⌀” (U+2300:DIAMETER SIGN)

10 Jul 2024, 13:55

Hi,

I cannot use Noesis to show the character "⌀” (U+2300:DIAMETER SIGN).
I am setting the font to Segoe UI Symbol. Is it a known issue or is there something wrong with my code ?

Thanks.
 
User avatar
Ricardo
Posts: 2
Joined: 02 Jul 2024, 17:19
Contact:

Re: Cannot show character "⌀” (U+2300:DIAMETER SIGN)

10 Jul 2024, 16:46

Hi, does it work for you in a minimal example?

I've done this xamltoy rn and it works out of the box. Either on Label and TextBlock, btw.
<StackPanel
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <TextBlock FontSize="100">⌀</TextBlock>
  <Label FontSize="100">⌀</Label>
</StackPanel>
 
User avatar
sfernandez
Site Admin
Posts: 3059
Joined: 22 Dec 2011, 19:20

Re: Cannot show character "⌀” (U+2300:DIAMETER SIGN)

10 Jul 2024, 17:23

How are you setting the character, in xaml or in code?
And the FontFamily?
 
nikobarli
Topic Author
Posts: 183
Joined: 26 Apr 2017, 06:23

Re: Cannot show character "⌀” (U+2300:DIAMETER SIGN)

11 Jul 2024, 08:28

Hi Sergio, Ricardo,

Thanks for the reply. I am trying to use "Segoe UI Symbol" to show the character. It happens both when I set the character in XAML and from code (through binding).

Debugging the issue, I found that it happen if my application register "Segoe UI" font before "Segoe UI Symbol".

In that case the CachedFontProvider::FamilyExists returns true for "Segoe UI Symbol" and it doesn't get registered properly.

In the below code:

familyName is "Segoe UI Symbol"
family.key is "Segoe UI"

that makes StrCaseStartsWith(familyName, family.key.Str())) evaluates to true.
I think it shouldn't be true for the relation of "Segoe UI" and "Segoe UI Symbol" because they are considered different font family.
bool CachedFontProvider::FamilyExists(const Uri& baseUri, const char* familyName)
{
    Uri folder;
    NormalizeFolder(baseUri, folder);

    Families& families = GetFolder(folder);
    Families::Iterator it = families.Find(familyName);

    if (it != families.End())
    {
        return true;
    }
    else
    {
        for (Families::Bucket& family : families)
        {
            if (StrCaseStartsWith(familyName, family.key.Str()))
            {
                return true;
            }
        }
    }

    return false;
}
 
nikobarli
Topic Author
Posts: 183
Joined: 26 Apr 2017, 06:23

Re: Cannot show character "⌀” (U+2300:DIAMETER SIGN)

Yesterday, 03:03

I am pretty sure it is a bug so I created an issue here with a patch to reproduce it: https://www.noesisengine.com/bugs/view.php?id=3492
Thanks.

Who is online

Users browsing this forum: Baidu [Spider] and 2 guests