RadGlyph with Font Awesome Duotone font

0 Answers 4 Views
General Discussions
Neil N
Top achievements
Rank 2
Iron
Iron
Veteran
Neil N asked on 28 Aug 2025, 04:28 PM

Can RadGlyph work with Font Awesome's Duotone font? For example, we want to render: https://fontawesome.com/icons/house?f=duotone&s=solid

I've tried various things, including:

                <Grid>
                    <!-- Secondary (back) layer -->
                    <telerik:RadGlyph
                        Font="fads"
                        FontSize="40"
                        Glyph="&#x10F015;"
                        Foreground="Red" />
                    <!-- Primary (front) layer -->
                    <telerik:RadGlyph
                        Font="fads"
                        FontSize="40"
                        Glyph="&#xF015;"
                        Foreground="Blue" />
                </Grid>

This just renders an all blue house.

Reversing the elements:

            <telerik:RadTabItem.Content>
                <Grid>
                    <!-- Primary (front) layer -->
                    <telerik:RadGlyph
                        Font="fads"
                        FontSize="40"
                        Glyph="&#xF015;"
                        Foreground="Blue" />
                    <!-- Secondary (back) layer -->
                    <telerik:RadGlyph
                        Font="fads"
                        FontSize="40"
                        Glyph="&#x10F015;"
                        Foreground="Red" />
                </Grid>

I'm using the same technique I use to register regular Font Awesome fonts and have verified the codepoints exist:

        var solidDuotoneFontFilePath = Path.Combine(directory, "Resources/Fonts", "Font Awesome 7 Duotone-Solid-900.otf");
        var solidDuotoneFontUri = new Uri(solidDuotoneFontFilePath, UriKind.Absolute);
        var solidDuotoneFontFamily = new FontFamily(solidDuotoneFontUri, "./#Font Awesome 7 Duotone Solid");
        RadGlyph.RegisterFont(solidDuotoneFontFamily, "fads");

        bool HasChar(FontFamily fam, int codePoint)
        {
            var tf = new Typeface(fam, FontStyles.Normal, FontWeights.Normal, FontStretches.Normal);
            if (!tf.TryGetGlyphTypeface(out var gtf)) return false;
            return gtf.CharacterToGlyphMap.ContainsKey(codePoint);
        }

        Debug.WriteLine($"Primary F015 present: {HasChar(solidDuotoneFontFamily, 0xF015)}");
        Debug.WriteLine($"Secondary 10F015 present: {HasChar(solidDuotoneFontFamily, 0x10F015)}");

No answers yet. Maybe you can help?

Tags
General Discussions
Asked by
Neil N
Top achievements
Rank 2
Iron
Iron
Veteran
Share this question
or