TTF Diet, by Karsten Lücke and Adam Twardoch, reduces Latin TTF fonts by ~10%
The tool applies a 'diet' to a .ttf font. The diet consists of two steps:- https://github.com/twardoch/ttfdiet- It 'blanks' all glyphs that, in the 'cmap' table, represent precomposed Unicode characters (such as U+00E1, LATIN SMALL LETTER A WITH ACUTE), i.e. it removes all contours and components for those glyphs from the 'glyf' table (note: the tool cannot process the 'CFF' table).
- It adds a 'GSUB' lookup that substitutes every glyph that represents a precomposed Unicode character with a sequence of glyphs that represent the Unicode canonical decomposition of that precomposed character, and adds the lookup to the 'ccmp' feature.
The typical size reduction of a multilingual font is 5–10%.
The processed fonts don't work with many OT processors, but they should
Comments
-
The processed fonts don't work with many OT processors, but they should
If they did wouldn’t we be able to just build fonts with mark positioning and not put all the precomposed characters in fonts to begin with?0 -
did you do some tests where these fonts do work? And did you find rendered where it didn't?0
-
I’m curious: How does it then handle any subsequent kerning lookups in the GPOS that applied to the now-replaced precomposed glyphs? Or does it, yet?
Is it able to replace a standard pair with a contextual lookup? For example, replacingpos T agrave -70;
pos T' -70 a gravecmb;
pos T a -110;
pos T' 40 a gravecmb;
0 -
Question: What happens to kerning exceptions like eg. Tä &c in dieted fonts?
Karsten's Answer: Kerning pairs that involve a glyph whose outline got deleted will be removed too. Caveat: Only PairPos Format 1 subtables (those that usually hold "exception kerning") are processed by the tool while PairPos Format 2 subtables ("class kerning") are not, yet.0 -
I've just added some clarification about the kerning (and a few other issues) to the README on https://github.com/twardoch/ttfdiet0
-
We'd appreciate if anyone tests the undieted vs. dieted fonts (even the fonts from the examples folder) in a variety of environments and posts the results here. I'll incorporate the results into the tool's README.
Environments may include:
* Adobe InDesign CC 2014, Paragraph Composer
* Adobe InDesign CC 2014, World-Ready Paragraph Composer
* Adobe Illustrator CC 2014, Paragraph Composer
* Adobe Illustrator CC 2014, World-Ready Paragraph Composer
* Adobe Photoshop CC 2014
* TextEdit, Pages, Keynote on Mac OS X 10.10
* Notepad, WordPad on Windows 8.1
* Google Chrome
* Mozilla Firefox
* Internet Explorer 11 on Windows 8.1
* Safari on Mac OS X 10.10
* Microsoft Word, PowerPoint 2013 on Windows 8.1
* Microsoft Word, PowerPoint 2011 on Mac OS X 10.10
* CorelDRAW! X6 on Windows 8.1
* Affinity Designer on Mac OS X 10.10
* OpenOffice, LibreOffice
* Mellel
* QuarkXPress
as well as these apps on older OSes, older versions of the above apps, and other apps that use OpenType Layout.0 -
OK, well, I've done some testing myself and published the results at the end of the README on https://github.com/twardoch/ttfdiet0
-
Adam, since you've set up the test, can you also run it for fonts that contain only the decomposed characters and do not have the blank mapped glyphs for the precomposed characters? I'd like to see how much current advantage is gained with your diet hack vs. building smarter fonts.0
-
that contain only the decomposed characters and do not have the blank mapped glyphs for the precomposed characters?
John — I don’t quite understand this. Without leaving the blank mapped glyphs as targets, how can you have the {ccmp}? Won’t the tests just yield .notdefs?
Or are you asking Adam to run tests to see which (if any) applications attempt to apply Unicode normalization to the input when precomposed glyphs are absent from the font?
1 -
Interesting. + In case someone did not know: Just TTX:ing the font (TTF > TTX > TTF) reduce the file size with 15% on a manually hinted webfont.2
-
I recommend that this tool be used as part of the renewed pressure on Adobe, Microsoft and others to better support OpenType.0
Categories
- All Categories
- 43 Introductions
- 3.7K Typeface Design
- 803 Font Technology
- 1K Technique and Theory
- 618 Type Business
- 444 Type Design Critiques
- 542 Type Design Software
- 30 Punchcutting
- 136 Lettering and Calligraphy
- 83 Technique and Theory
- 53 Lettering Critiques
- 483 Typography
- 301 History of Typography
- 114 Education
- 68 Resources
- 499 Announcements
- 80 Events
- 105 Job Postings
- 148 Type Releases
- 165 Miscellaneous News
- 270 About TypeDrawers
- 53 TypeDrawers Announcements
- 116 Suggestions and Bug Reports