Closed vcx closed 5 years ago
The font parts of this looks to be resolved in the latest code base. I tested the Xamarin Forms sample using SF Pro Display against master and the font looks good. I then tested against 3.0.0.296286-pre2 and the font no longer looked good. Once the next pre comes out can you test against that and then update this ticket to see if that resolves your issue?
As far as the background I couldn't quite get that to work where I saw a different background. Can you attach the native macOS project you are using just so I can make sure I'm comparing to the correct expectation?
Overall I'm thinking this is resolved on the master branch though :-)
I just tested on a Mac pointing to nightly 3.1.0.351576-nightly. No changes... color issue was solved, fonts still buggy.
Is there any chance to get this fixed on 2.5.x somehow? My customer can't upgrade to nightly, as it causes other bugs in their app.
Just in case, which commit did you use in your test that made fonts work correctly? I'd like to do other tests here.
Moving back over to ready for work and assigning MacOS backend expert :)
As for if this will make it to 2.5.x, nope.
@jassmith, @PureWeen: do you know exactly in which commit the font issue was solved? One of the devs in the team here tested on top of latest commit in master today, no luck.
Also, by just reading the description, I'm not sure our case is the same of #2159. Our is more related to font aliasing, not weight... and it's not random.
@rmarinho Please also identify what commit may have resolved the color issue so we can confirm that was done. Thanks!
Hey the solved the color issue was in commit https://github.com/xamarin/Xamarin.Forms/commit/b8de5564bf05f9086a0d7bc8c33bcce9b38803e4 you can find it on version 3.0.0 and above.
I have now a setup (non retina mac) i m debugging the issue, will update as soon as as i have a good answer.
Do you mind for now to test 3.5.0 stable and also turn off font smoothing on the Mac your are trying. It seems that works for me...
After more investigation i was able to found this on Apple's documentation
Using screen fonts (for font sizes 16 pt and smaller) optimizes text layout for a standard-resolution display. For screen font, text is laid out using integral glyph advancements. Because the higher pixel density on a high-resolution display allows for floating-point glyph advancements even at small font sizes, screen font is no longer required. Floating-point advancements result in more precise layout, as shown in Figure 1-4, and allows for kerning and ligatures for smaller font sizes. If your app is document-based and supports text editing and layout, you should familiarize yourself with the default text settings. See Adjust Font Settings to Ensure Document Compatibility.
This made me test returing a ScreenFont with different RenderingModes and test the results with several options on Retina and Non Retina with LCD font Smoothing on and off
With LCD font smoothing ON with NON retina Mac
NSFontRenderingMode.Default BAD
NSFontRenderingMode.Antialiased STILL BAD
NSFontRenderingMode.IntegerAdvancements BETTER
NSFontRenderingMode.AntialiasedIntegerAdvancements GOOD
With LCD font smoothing OFF with NON retina Mac
NSFontRenderingMode.Default GOOD
NSFontRenderingMode.Antialiased GOOD
NSFontRenderingMode.IntegerAdvancements BAD
NSFontRenderingMode.AntialiasedIntegerAdvancements GOOD
Description
Font aliasing and color aren't displayed correctly in MacOS without a retina display. They both work well in native code.
Steps to Reproduce
Expected Behavior
Basic Information
Screenshots
See attachments color-issue and font-issue.
Issue details
We are applying RGB colors in Xamarin.Forms, and it works perfectly on UWP, but rather strange on Mac. In fact, the colors on Mac seem lighter than expected. In the picture, last window is the Xamarin.Forms.
Is this an expected behavior? Should we start adjusting Hue, Sat and Luminosity altogether? Here are the sample codes for both Xamarin.Forms and native applications:
Xamarin.Forms
Native
On the font issue, we are using custom fonts for our application, and we noticed that whenever we use them with a small font size (say 11), they appear to be pixelated and, sometimes, we can barely read it. To demonstrate it, we downloaded one of our fonts (Segore WP Light) and one provided by Apple (SF Pro Display), putting them site-by-side on both Xamarin.Forms and native applications. The result was clear: on the native application, the fonts are rendered perfectly, whereas in Xamarin.Forms they get pixelated (Apple’s font is better rendered, but still presents some cracks and pixels).
However, if we increase the font size (say 14), the problem goes away. Moreover, if we use the Mac system native fonts the problem is not presented. So the question is: should we have an additional care for fonts alien to the Mac OS system? Could we solve this somehow in Xamarin.Forms?
Sample code snippet:
Xamarin.Forms
Native
I've grouped in a single issue because, after doing some investigation in code and past issues, I believe they're related, but let me know if you prefer to split in two.
X POCFonts.zip