Why icon from material font is not visible?

Igor Kravchenko 281 Reputation points
2022-05-09T13:06:27.097+00:00

Hi!
I have added fonts MaterialIcons-Regular.ttf and MaterialIconsOutlined-Regular.otf to my project and trying to show icon.

<Image>
                <Image.Source>
                    <FontImageSource FontFamily="MaterialOutline"
                                     Glyph="{Static icons:MaterialOutline.Mail}"
                                     Color="Black"
                                     Size="60"/>
                </Image.Source>
            </Image>

builder
            .UseMauiApp<App>()
            .ConfigureFonts(fonts =>
            {
                fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
                fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
                fonts.AddFont("MaterialIconsOutlined-Regular.otf", "MaterialOutline");
                fonts.AddFont("MaterialIcons-Regular.ttf", "Material");
                fonts.AddFont("Roboto-Medium.ttf", "RobotoMedium");
                fonts.AddFont("Roboto-Regular.ttf", "RobotoRegular");
            })

But have blank space. Am I missing something?
Thanks.
Project link.

Developer technologies .NET .NET MAUI
0 comments No comments
{count} votes

Accepted answer
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 50,126 Reputation points Microsoft External Staff
    2022-05-10T03:10:00.483+00:00

    Hello,

    It's a known issue in GitHub https://github.com/dotnet/maui/issues/6559 .

    We will fix it in upcoming RC3.

    Thanks for your feedback.:)

    Best Regards,

    Alec Liu.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.