Open olivercortinas opened 4 years ago
Should it be possible to specify the fallback font family? Then I think this is an issue for OxyPlot.ImageSharp and not oxyplot-xamarin
Did you try using "Droid Sans"?
I try it and didn't work, i change the code:
static readonly string FallbackFontFamily = "Arial";
for this one:
static readonly string FallbackFontFamily = GetFontPlatform();
with:
private static string GetFontPlatform() { string font; switch (Device.RuntimePlatform) { case Device.iOS: font = "MarkerFelt-Thin"; break; case Device.macOS: font = "MarkerFelt-Thin"; break; case Device.Android: font = "Droid Sans"; break; default: font = "Comic Sans MS"; break; } return font; }
and got the same error when run
family = SystemFonts.Find(FallbackFontFamily);
the return is (null)
The library that is used si SixLabors.Fonts, so i try this: FontCollection.SystemFonts.Families
to know the families availables but FontCollection is recognized but FontCollection.SystemFonts not, I'm not sure from where is the error, i think that should be missed something that load the fonts?
Don't know.
Should it be possible to specify the fallback font family? Then I think this is an issue for OxyPlot.ImageSharp and not oxyplot-xamarin
Did you try using "Droid Sans"?
This issue is with SixLabors.Fonts.SystemFonts has an empty Families value, what could be the issue related to that? Just to be more clear, this is happening only when i test it on Android.
I am using the code provided here: https://github.com/oxyplot/oxyplot/tree/develop/Source/OxyPlot.ImageSharp to export chart model to PNG, i try several examples i have and allways get some errors, i will try to upload them all. I have this XAML for a pie chart:
Then in the .cs i have this code when button is pressed:
And create the pie chart content here:
When i run on Android i get an exception on the class PngRenderingContext:
Seems that it couldn't fin de font when the code is reached on method GetFamilyOrFallbackOrThrow:
In the class is defined:
Any clue why this is happening?