googlefonts / fontmake

Compile fonts from sources (UFO, Glyphs) to binary (OpenType, TrueType).
Apache License 2.0
746 stars 94 forks source link

OTF export looks...awful? #976

Open Panogen opened 1 year ago

Panogen commented 1 year ago

I have a UFO source which I am trying to export using fontmake. The ttf looks great, but the otf looks horrendous! At small sizes, not only is it greyscale (which I never specified—the ttf has proper subpixel rendering) but it is pixelated and looks way heavier than it should. I would just run with ttf, but I feel like otf, being more modern, should be the better of the two! I would prefer to use otf anyway because the filesize is smaller and I drew the font using cubic curves, meaning the quadratic conversion is at play with the ttf.

This screenshot shows: (left) TTF export with fontmake, (middle) OTF export with fontmake, and (right) OTF export from FontForge. sorazorafuzz

The FontForge OTF export used to look like the fontmake OTF export, but I fixed the issue by manually setting StdHW, StdVW, StemSnapH and StemSnapV (they were previously "guessed" by FF). Mysteriously, removing these values from fontinfo.plist in the generated UFO improves it significantly: image However, it is still in greyscale in the font viewer, which isn't right. I also feel that removing this information must be detrimental to the rendering in some way.

Another thing I noticed is that all of the OTFs become a dark mess when rendered at smaller and smaller ppem sizes, even with the stem-snap values removed: image but the TTF seems to retain a more sensible (and consistent) color at the same size (ignoring the bold text—the font currently only has regular weight): image This is even more apparent in apps like LibreOffice, with the difference being visible even at normal reading sizes.

Are these problems just inherent to otf? Is this how it's supposed to be? Am I doing something wrong, or is there something fontmake can do to make otf render as well as ttf?

aminabedi68 commented 1 year ago

AFAIK it happens all the time in rendering of otf fonts and is not related to fontmake; most of font engineers generate otf output format just to give access to cubic bezier outlines of the glyphs for those users who want to do typographic edits.

madig commented 1 year ago

Are you testing this only on Windows? OTF rendering there heavily depends on the application (specifically which part of Windows is used to draw text).