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.

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,207 questions
0 comments No comments
{count} votes

Accepted answer
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 38,911 Reputation points Microsoft Vendor
    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