microcharts-dotnet / Microcharts

Create cross-platform (Xamarin, Windows, ...) simple charts.
MIT License
2.02k stars 361 forks source link

problems with font in iOS #120

Closed Vitany closed 4 years ago

Vitany commented 6 years ago

Hi. Perhaps this is due to the update of iOS 12, but the fonts on the graph look like this now. How can this be fixed in the xamarin forms? photo_2018-09-17_22-05-56

Cedde97 commented 6 years ago

Having the same issue too, only on iOS 12. On lower Versions and Android it looks fine.

Cedde97 commented 6 years ago

changing the Typeface worked for me

static string fontFamily = Device.RuntimePlatform == Device.iOS ? "Lobster-Regular" : null; private SKTypeface TypeFaceForIOS12 = SKTypeface.FromFamilyName(fontFamily);

jacksonveroneze commented 6 years ago

@Cedde97 Can you provide more details of your implementation?

TMagnum1974 commented 6 years ago

Is there a way to solve this without changing Microcharts itself at all - as far as I can see the only way to achieve the fix is to change the Microcharts source. Could be done of course but I would prefer an "official" fix, if possible.

adamstirtan commented 6 years ago

I really hope to see a fix for this one. It takes a beautiful library and really puts up the blocker from using it when the latest iOS doesn't look right.

Sayzer75 commented 6 years ago

Somebody have solve the font issue with iOS 12 ? Thank for your help

mattleibow commented 6 years ago

Here is the SkiaSharp issue: https://github.com/mono/SkiaSharp/issues/657 and this is the native skia issue: https://bugs.chromium.org/p/skia/issues/detail?id=8432

I believe Apple changed something and this affects ALL new OS versions including macOS and tvOS. To be safe, it is probably best to always specify the font that you want. There is no guarantee that all OSes will always all use the same font.

I think in some cases, even Arial and Times New Roman may not exist.

Sayzer75 commented 6 years ago

Thank for these informations. Do you have a delivery plan for this fix ? (a release number, a date...) Thank for advance for your response

mattleibow commented 6 years ago

We should be releasing in the next two weeks, it is currently undergoing testing.

TMagnum1974 commented 6 years ago

Highly appreciated - thanks a lot!

TMagnum1974 commented 5 years ago

@mattleibow : Are you still planning to release a new version? Thanks!

mattleibow commented 5 years ago

@TMagnum1974 I think you may be referring to release v1.68.0 which was released in December: https://www.nuget.org/packages/SkiaSharp/1.68.0

https://github.com/mono/SkiaSharp/releases/tag/v1.68.0

TMagnum1974 commented 5 years ago

@mattleibow Oh, indeed, thanks! I'll try and build Microcharts then so I can finally correct this font issue which is quite annoying but Microcharts is a great repository which also functions as a great example for Skia-enabled enhancements to Xamarin in general.

albrecht-jun-zhang commented 5 years ago

Thanks @mattleibow, font on iOS 12 is fixed with SkiaSharp/1.68.0. We are using Microcharts source code(commit 69ad69b0b6). Hopefully we would get a new Microcharts Nuget package soon.

mattleibow commented 5 years ago

Great! Good to hear the updates are working.

Nixon-Joseph commented 5 years ago

Hey all, working on a new nuget package now. Hope to get something up soon. My current plan is to basically pull the current latest feature branches into master after some simple testing. Will keep you updated if that changes.

antkers commented 5 years ago

Hey all, working on a new nuget package now. Hope to get something up soon. My current plan is to basically pull the current latest feature branches into master after some simple testing. Will keep you updated if that changes.

Hello Nixon-Joseph, how is it going with the new nuget package? Can we expect it soon? Thank you, Anton

Nixon-Joseph commented 5 years ago

Hey yes, there's a new pre release package out 0.8.4-pre for forms and 0.8.4.1-pre for base microcharts. If you're using forms, let me know, I may need to build a new one of those referencing the new base microcharts.

antkers commented 5 years ago

Hey yes, there's a new pre release package out 0.8.4-pre for forms and 0.8.4.1-pre for base microcharts. If you're using forms, let me know, I may need to build a new one of those referencing the new base microcharts.

Yes I'm currently using both, 0.8.4-pre for forms and 0.8.4.1-pre fro base microcharts. Would be great if you could build new nuget packages of those two projects, thank you!

Nixon-Joseph commented 5 years ago

Alright, just built and pushed 0.8.4.1-pre for the forms package, everything should match now.

antkers commented 5 years ago

Hello Nixon-Joseph, unfortunately the font of the labels of the charts is still wrong. It seems the project is still referencing SkiaSharp.Views.Forms 1.59.1.1 (instead of 1.68.0 where the font issue is fixed): image

I additionally added SkiaSharp.Views.Forms 1.68.0 to the project and the font was rendered correctly then. Kind regards, Anton

Nixon-Joseph commented 5 years ago

Ahh I see, there's compatibility issues for that version of Skiasharp and the .net portable version the microcharts library is building for. I'll have to drop the .net portable target to update SkiaSharp it looks like.

Nixon-Joseph commented 5 years ago

Updated all dependencies, pushing up 0.8.5-pre

mattleibow commented 5 years ago

FYI: @Nixon-Joseph We dropped support for PCL in SkiaSharp v1.60.0.

conor-codes commented 5 years ago

@Nixon-Joseph Hi Nixon, i'm currently on 0.8.5-pre and still getting the font issue on iOS 12. Has anyone confirmed 0.8.5-pre fixed their font issue?

Nixon-Joseph commented 5 years ago

Can you confirm if this is still an issue? Compiling a to-do list, and need to know what's still important. Thanks!

conor-codes commented 5 years ago

@Nixon-Joseph For me it's not an issue, I can't exactly say what fixed it but the font's are rendering correctly now.

treasure0010-zz commented 4 years ago

Hi @Nixon-Joseph

This is still an issue, I've updated to the latest version, but still getting it.

eman1986 commented 4 years ago

this should be all good now