From 187602b384577f20fddc05adae75f4a5b8b0d9f1 Mon Sep 17 00:00:00 2001 From: Dan Siegel Date: Wed, 27 Feb 2019 13:20:14 -0800 Subject: [PATCH] directly load specified Font Family or other valid PostScript Font Name fixes #5372 (#5373) --- Xamarin.Forms.Platform.iOS/Renderers/ImageRenderer.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Xamarin.Forms.Platform.iOS/Renderers/ImageRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/ImageRenderer.cs index 4737672..174e23c 100644 --- a/Xamarin.Forms.Platform.iOS/Renderers/ImageRenderer.cs +++ b/Xamarin.Forms.Platform.iOS/Renderers/ImageRenderer.cs @@ -202,9 +202,7 @@ namespace Xamarin.Forms.Platform.iOS { var iconcolor = fontsource.Color != Color.Default ? fontsource.Color : Color.White; var imagesize = new SizeF((float)fontsource.Size, (float)fontsource.Size); - var hasFontFamily = fontsource.FontFamily != null && UIFont.FamilyNames.Contains(fontsource.FontFamily); - var font = hasFontFamily ? - UIFont.FromName(fontsource.FontFamily, (float)fontsource.Size) : + var font = UIFont.FromName(fontsource.FontFamily ?? string.Empty, (float)fontsource.Size) ?? UIFont.SystemFontOfSize((float)fontsource.Size); UIGraphics.BeginImageContextWithOptions(imagesize, false, 0f); -- 2.7.4