mirror of
https://github.com/weiweihuanghuang/Work-Sans.git
synced 2024-11-26 09:20:15 +03:00
50 lines
2.8 KiB
Plaintext
Executable File
50 lines
2.8 KiB
Plaintext
Executable File
Introduction
|
||
------------
|
||
I use Glyphs App to work on Work Sans. As stated in README.md I am not offering UFOs since the UFOs generated from Glyphs 2 will not interpolate properly due to using Glyphs 2 only features. If there is demand, in the future I may upload a compatible UFO set for interpolation.
|
||
|
||
Generating Fonts
|
||
----------------
|
||
* * *
|
||
|
||
The fonts must be generated from Glyphs 2, not Glyphs 1 as it is using features available only in Glyphs 2 to correct interpolation bumps.
|
||
|
||
* * *
|
||
|
||
There are three sets of instances in the .glyphs file, two that are named with font weights, the third named using its stem weights. The first set (10 weights from Hairline to Black) are for generating OTFs and follow Microsoft's recommendations for setting vertical metrics[1]. The second set are for generating TTFs for webfonts and follows Google Font's webfont recommendations[2]. The third were for testing.
|
||
|
||
The OTFs generated with Glyphs App (Remove Overlap, Autohint) will be usable immediately in desktop applications.
|
||
|
||
The TTFs (Remove Overlap) will need to be processed and hinted with ttfautohint.
|
||
|
||
[1] http://www.glyphsapp.com/tutorials/vertical-metrics
|
||
[2] https://code.google.com/p/googlefontdirectory/wiki/HowToGenerateWebNativeFonts
|
||
|
||
Generating hinted TTFs
|
||
----------------------
|
||
You will need:
|
||
- ttfautohint
|
||
http://www.freetype.org/ttfautohint/
|
||
- Fonttools/TTX
|
||
https://github.com/behdad/fonttools/
|
||
- sfnt2woff
|
||
https://people.mozilla.org/~jkew/woff/
|
||
- woff2_compress
|
||
https://github.com/google/woff2
|
||
|
||
Bram Stein has created homebrew formulas for the above tools @ https://github.com/bramstein/homebrew-webfonttools
|
||
|
||
Once the TTFs have been generated, they need to processed with the generatefamily.sh script. To run this script, make sure the exported TTFs are in the same folder as the script. Open Terminal at the folder and enter:
|
||
|
||
sh generatefamily.sh
|
||
|
||
This script will:
|
||
|
||
1. Call fontTools in Python to set the ROUND_XY_TO_GRID [3] bit by changing the flags on components from "0x0" to "0x4".
|
||
2. Runs ttfautohint and creates autohinted TTFs (with control-files for some weights that define custom hinting to correct autohinting mistakes when rendered in ClearType GDI which is commonly encountered in Firefox on Windows 7).
|
||
|
||
[3] Setting the ROUND_XY_TO_GRID bit in composite glyphs causes components to be shifted by an integer pixel amount which preserves the hinted shape. This reduces file size so that ttfautohint does not need to rehint composite glyphs to create consistent rendering – especially important for glyphs such as super-/sub-script numerals and fractions which use components that are shifted.
|
||
|
||
Converting to woff and woff2
|
||
----------------------------
|
||
sfnt2woff and woff2_compress are used to generate woff and woff2 fonts. Follow the resepective programs' instructions to do so.
|