pharo-project / pharo

Pharo is a dynamic reflective pure object-oriented language supporting live programming inspired by Smalltalk.
http://pharo.org
Other
1.17k stars 350 forks source link

Bad subpixel antialiasing and/or hinting in Athens/Cairo #5929

Open stacksmith opened 4 years ago

stacksmith commented 4 years ago

Normal drawString glyphs look pretty good. Using the same font outputting via drawString on an AthensCanvas surface is pretty smudgy (especially around glyph tops). See the attached image - zoom in a lot.

The first of each pair is Athens, the second is regular canvas. Output is generated by drawString messages to regular canvas, then overlaying with an Athens surface cleared to transparent color then applying equivalent drawString to coordinates just above.
crap

I previously noted poor quality of type in Athens demos. Based on differing shape of glyphs, it appears to be related to hinting. In addition, wider color variation implies incorrect gamma correction or filtering.

Good type quality is really important for a polished look of applications. As it stands, I am unable to look at Athens text for more than a few seconds without my eyes hurting. Help appreciated.

Pharo 9 64-bits, Linux, TextStyle defaultFont

guillep commented 4 years ago

The first of each pair is Athens, the second is regular canvas. Output is generated by drawString messages to regular canvas, then overlaying with an Athens surface cleared to transparent color then applying equivalent drawString to coordinates just above.

Could you post the code doing this?

stacksmith commented 4 years ago

I will try to isolate a simple example (there is a lot of crud around my experiments that is hard to get rid of, and I am in a different image...). In the meantime just look at the athens demos that show text - it is pretty obvious once you know what to look for. It is easier to see as white on black. Thanks