Dose anyone have idea to resolve UWP project problem
Ref this document
For Android and iOS platform, we can use FontName
property, but for Windows Phone platform, it uses FriendlyFontName
property:
Quote:
This property is only necessary for the Windows Phone platform. This
can be found on the first line of the font or in the font preview. If
not given then the file name excluding the extension is used. However
this cannot be guaranteed to work.
But seems like XLabs didn't handle the FriendlyFontName
setting correctly. I just tried its official sample for UWP
For the ExtendedLabel scenario, the font setting is incorrect.
After some investigations, based on this issue, I found a workaround to fit Windows Phone and UWP scenario.
Setting FontName
and using OnePlatform
for WINRT scenario in xaml:
<controls:ExtendedLabel FontName="Kristen ITC"
FontSize="20"
FriendlyFontName="Kristen ITC"
HorizontalOptions="StartAndExpand"
Text="This uses 'FontName' = 'Kristen ITC' set in XAML and 'OnPlatform' properties, size 20">
<controls:ExtendedLabel.FontFamily>
<OnPlatform x:TypeArguments="x:String"
iOS=""
Android=""
WinPhone="Kristen ITC"/>
</controls:ExtendedLabel.FontFamily>
</controls:ExtendedLabel>
Please notice that the specific Font should be installed in your platform OS.
Screenshot:
Check my forked repository