Page 1 of 1

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

Posted: 10 Jul 2024, 13:55
by nikobarli
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.

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

Posted: 10 Jul 2024, 16:46
by Ricardo
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>

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

Posted: 10 Jul 2024, 17:23
by sfernandez
How are you setting the character, in xaml or in code?
And the FontFamily?

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

Posted: 11 Jul 2024, 08:28
by nikobarli
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;
}

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

Posted: 12 Jul 2024, 03:03
by nikobarli
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.

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

Posted: 15 Jul 2024, 04:17
by jsantos
Thanks Niko, this is definitely a bug.