When WPF using UWP, Could we set Microsoft.UI.Xaml.Media.FontFamily by C# code?
GuoLearn
251
Reputation points
this XAML can set fontFamily :
<FontFamily>fontFamilyName[,fallbackFontFamilyName]*</FontFamily>
- or -
<object FontFamily="fontFamilyName[,fallbackFontFamilyName]" ... />
-or-
<object FontFamily="[uri]fontFamilyName[,[uri]fallbackFontFamilyName]" ... />
-or-
<object FontFamily="embeddedUri#fontFamilyName[,[uri]fallbackFontFamilyName]*" ... />
Can we set the fontFamily by C# code ,like
FontFamily= new FontFamily(new Uri(@"C:\fontFamilyName").AbsoluteUri) ?
i try it but it do not work。
Could you tell me the right way to do it and The "embeddedUri#fontFamilyName" could you make me a example?
Sign in to answer