googlefonts / fontmake

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

Autohinting CFF fonts #305

Open MrBrezina opened 7 years ago

MrBrezina commented 7 years ago

Can you clarify (somewhere in the docs) whether fontmake autohints OTF/CFF fonts? There is a --autohint option which uses ttfautohint, that is only TTFs are hinted. Is it possible to get the OTF/CFF autohinted too or one needs to have AFDKO installed to get their autohint tool?

anthrotype commented 7 years ago

Hey David! Yes, PostScript autohinting is currently not supported in fontmake. We are planning to have fontmake use the Python wrapper for the AFDKO autohinter that @khaledhosny is working on: https://github.com/khaledhosny/psautohint This will happen sometime soon.

MrBrezina commented 7 years ago

đź‘Ť thanks

anthrotype commented 7 years ago

let's keep it open to remind ourselves to implement that feature

miguelsousa commented 7 years ago

@MrBrezina there are a couple other things that fontmake does not do as well as makeotf yet:

The first item only matters when one builds OTFs, obviously, but the second applies to making TTFs as well as OTFs.

I've setup OTF Making Benchmark to track the progress.

MrBrezina commented 7 years ago

That’s good to know! Thanks @miguelsousa .

anthrotype commented 7 years ago

About the two things mentioned by @miguelsousa, quoting from our conversation with @behdad:

1) for GPOS, makeotf generates multiple PairPos format=2 subtables to reduce size of the table, whereas fontmake (via fontTools.feaLib) doesn't.

2) fontmake already supports CFF subroutinization (via compreffor); however, the FontTools T2CharStringPen (originally from Tal Leming's ufo2fdk) doesn't have a CFF operator specializer yet (see https://github.com/fonttools/fonttools/issues/403). In other words, it only uses rmoveto, rlineto, rrcurveto operators, whereas makeotf optimizes by also using hmoveto, hlineto, etc. So the size of a non-subroutinized CFF table made by makeotf is smaller than one produced by ufo2ft.

behdad commented 7 years ago

Of course, autohinting itself is also missing. @khaledhosny

madig commented 7 years ago

psautohint works for me (Python 3). Is it mature enough for using it in fontmake?

behdad commented 6 years ago

@anthrotype We should work on this.