dotnet/maui

FontImage not support woff2 format

CodingOctocat opened this issue · 4 comments

Description

I want to use Google Material Symbols/github

But the font icon shows up as a tofu box character
image

Steps to Reproduce

  1. Download Google Material Symbols/github
  2. Copy MaterialSymbolsRounded.woff2(renamed) to /Resources/Fonts
  3. ConfigureFonts fonts.AddFont("MaterialSymbolsRounded.woff2", "MaterialSymbols");
  4. Use it anywhere
<ShellContent>
    <ShellContent.Icon>
        <FontImageSource FontFamily="MaterialSymbols"
                         Glyph="&#xe8b6;"/>
    </ShellContent.Icon>
</ShellContent>

Link to public reproduction project repository

CodingOctocat/MauiIssue_23217

Version with bug

8.0.40 SR5

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android, I was not able test on other platforms

Affected platform versions

Android API 34

Did you find any workaround?

No response

Relevant log output

No response

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

Is it possible that this is related to #16604?

I think that direct support for WOFF fonts in native Android apps is not provided.

Is it possible that this is related to #16604?

What I meant: the original post mentions Material Symbols and links to a specific font file, which are variable fonts. Currently MAUI does not support variable fonts.

In order to use those fonts, currently they have to be converted to static fonts with given settings for e.g. weight and fill (explained in #16604). That issue was actually reported to triggered by the lack of built-in support for using Material Symbols.

@kubaflo Can you please check whether this is a duplicate of the earlier #16604?