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="􏀕"
Foreground="Red" />
<!-- Primary (front) layer -->
<telerik:RadGlyph
Font="fads"
FontSize="40"
Glyph=""
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=""
Foreground="Blue" />
<!-- Secondary (back) layer -->
<telerik:RadGlyph
Font="fads"
FontSize="40"
Glyph="􏀕"
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)}");