xamarin/Xamarin.Forms
[Bug] Custom font not displaying correctly when loading the page again
Open
#6,666 opened on Jun 26, 2019
e/3 :clock3:help wantedt/bug :bug:up-for-grabs
Repository metrics
- Stars
- (5,644 stars)
- PR merge metrics
- (No merged PRs in 30d)
Description
Description
I'm trying to use a custom glyph font. It works the first time that the View appears, but the second time a rectangle with a X inside will be rendered instead.
Steps to Reproduce
- I simply created a font online using the IconMoon web app.
- I added the font to the Android project normally, adding as AndroidAsset.
- I created a simple
IconLabelextendingLabel. - After that I added two resources in the App.xaml file:
<OnPlatform x:Key="Font.Glyph" x:TypeArguments="x:String">
<On Platform="Android" Value="Fonts/project_icons.ttf#ProjectIcons"/>
<On Platform="iOS" Value="ProjectIcons"/>
</OnPlatform>
<Style TargetType="{x:Type n:IconLabel}">
<Setter Property="FontFamily" Value="{StaticResource Font.Glyph}"/>
<Setter Property="FontSize" Value="40"/>
<Setter Property="TextColor" Value="{DynamicResource Color.Foreground}"/>
</Style>
- I have a ContentPage that displays multiple ContentViews. When changing the content view being displayed (back and forth), after the displaying the glyphs correctly one time, all subsequent displays will have the incorrect glyph.
Basic Information
- Version with issue:
- Last known good version: n/a
- IDE: Visual Studio for Windows. 16.1.4
- Platform Target Frameworks: Only tested in Android.
- iOS: n/a
- Android: 9 (pie)
- UWP: n/a
- Android Support Library Version: 28
- Nuget Packages:
Rg.Plugins.Popup1.1.5.188MyApp
Microsoft.EntityFrameworkCore2.2.4MyApp
Polly7.1.0MyApp
Microsoft.EntityFrameworkCore.Sq...2.2.4MyApp
Xamarin.FFImageLoading2.4.11.982MyApp
NodaTime2.4.5MyApp
Microsoft.EntityFrameworkCore.De...2.2.4MyApp
Xamarin.Forms.GoogleMaps3.2.0MyApp
Sharpnado.Forms.HorizontalListView1.1.0MyApp
Xamarin.FFImageLoading.Forms2.4.11.982MyApp
Plugin.Permissions5.0.0-betaMyApp
Xam.Plugin.Connectivity3.2.0MyApp
Xamarin.FFImageLoading.Transform...2.4.11.982MyApp
CarouselView.FormsPlugin5.2.0MyApp
DLToolkit.Forms.Controls.FlowLis...2.0.11MyApp
Forms.Controls.FlexButton0.9.1MyApp
fusillade2.0.5MyApp
Ideine.ModernHttpClient3.2.2MyApp
DLToolkit.Forms.Controls.TagEntr...1.0.5MyApp
Microsoft.EntityFrameworkCore.Tools2.2.4MyApp
MLToolkit.Forms.SwipeCardView2.0.0MyApp
Xam.Plugin.Media4.0.1.5MyApp
Xamarin.Essentials1.1.0MyApp
NETStandard.Library2.0.3MyApp
Xamarin.Forms.PancakeView1.0.21MyApp
Refit4.7.9MyApp
Xamarin.Forms4.0.0.482894MyApp
DLToolkit.Forms.Controls.ImageCr...1.0.7MyApp
CarouselView.FormsPlugin5.2.0MyApp.iOS
DLToolkit.Forms.Controls.FlowLis...2.0.11MyApp.iOS
DLToolkit.Forms.Controls.ImageCr...1.0.7MyApp.iOS
DLToolkit.Forms.Controls.TagEntr...1.0.5MyApp.iOS
Forms.Controls.FlexButton0.9.1MyApp.iOS
Plugin.Permissions5.0.0-betaMyApp.iOS
Rg.Plugins.Popup1.1.5.188MyApp.iOS
Sharpnado.Forms.HorizontalListView1.1.0MyApp.iOS
Xam.Plugin.Media4.0.1.5MyApp.iOS
Xamarin.FFImageLoading2.4.11.982MyApp.iOS
Xamarin.FFImageLoading.Forms2.4.11.982MyApp.iOS
Xamarin.FFImageLoading.Transform...2.4.11.982MyApp.iOS
Xamarin.Forms4.0.0.482894MyApp.iOS
Xamarin.Essentials1.1.0MyApp.iOS
Xamarin.Forms.GoogleMaps3.2.0MyApp.iOS
CarouselView.FormsPlugin5.2.0MyApp.Android
DLToolkit.Forms.Controls.FlowLis...2.0.11MyApp.Android
DLToolkit.Forms.Controls.ImageCr...1.0.7MyApp.Android
DLToolkit.Forms.Controls.TagEntr...1.0.5MyApp.Android
Forms.Controls.FlexButton0.9.1MyApp.Android
Plugin.Permissions5.0.0-betaMyApp.Android
Rg.Plugins.Popup1.1.5.188MyApp.Android
Sharpnado.Forms.HorizontalListView1.1.0MyApp.Android
Xam.Plugin.Media4.0.1.5MyApp.Android
Xamarin.FFImageLoading2.4.11.982MyApp.Android
Xamarin.FFImageLoading.Forms2.4.11.982MyApp.Android
Xamarin.FFImageLoading.Transform...2.4.11.982MyApp.Android
Xamarin.Forms4.0.0.482894MyApp.Android
Xamarin.Android.Support.Design28.0.0.1MyApp.Android
Xamarin.Android.Support.v7.AppCo...28.0.0.1MyApp.Android
Xamarin.Android.Support.v428.0.0.1MyApp.Android
Xamarin.Android.Support.v7.CardView28.0.0.1MyApp.Android
Xamarin.Android.Support.v7.Media...28.0.0.1MyApp.Android
Xamarin.Android.Support.Core.Utils28.0.0.1MyApp.Android
Xamarin.Android.Support.CustomTabs28.0.0.1MyApp.Android
Xamarin.Essentials1.1.0MyApp.Android
Xamarin.Forms.GoogleMaps3.2.0MyApp.Android
Xamarin.GooglePlayServices.Location60.1142.1MyApp.Android - Affected Devices: Nokia 6.1 Plus, works normally when debugging in emulator.
Screenshots
This is the result:

Reproduction Link
Not yet...