This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| from fontTools import ttLib | |
| from fontTools.ttLib.tables import sbixStrike | |
| from fontTools.ttLib.tables import sbixGlyph | |
| ttfont = ttLib.TTFont() | |
| # https://docs.microsoft.com/en-us/typography/opentype/spec/sbix | |
| sbix = newTable("sbix") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """Create a COLR/CPAL font from a set of SVGs. | |
| Sample usage: | |
| make_colr_font.py -o font.ttf $(find ~/oss/noto-emoji/svg -name '*.svg' | head -10) | |
| """ | |
| import argparse | |
| from collections import namedtuple | |
| import itertools | |
| import logging |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Common structure for GPOS, GSUB | |
| { | |
| "Version": int, | |
| "Scripts": [ | |
| { | |
| "Tag": str, | |
| "DefaultLangSys": { | |
| "ReqFeatureIndex": int, # is it always 0xFFFF? | |
| "FeatureIndices": List[int] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import string | |
| import sys | |
| from pprint import pprint | |
| try: | |
| Glyphs | |
| except NameError: | |
| IN_GLYPHS_APP = False | |
| else: | |
| IN_GLYPHS_APP = True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import argparse | |
| from datetime import datetime | |
| import os | |
| import subprocess | |
| import logging | |
| FILE_EXTENSIONS = {".jpg", ".png", ".pdf"} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- XXX_VF_Latn_WghtWdth-VF.ttx 2019-06-06 18:30:12.002485552 +0100 | |
| +++ XXX_VF_Latn_WghtWdth-VF_2.ttx 2019-06-07 16:15:35.576124762 +0100 | |
| @@ -667,12 +667,12 @@ | |
| <!-- Most of this table will be recalculated by the compiler --> | |
| <tableVersion value="1.0"/> | |
| <fontRevision value="1.0"/> | |
| - <checkSumAdjustment value="0x99bcc445"/> | |
| + <checkSumAdjustment value="0xb41a5347"/> | |
| <magicNumber value="0x5f0f3cf5"/> | |
| <flags value="00000000 00001011"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| import pprint | |
| from collections import OrderedDict, Counter | |
| import fontTools | |
| from fontTools import ttLib | |
| log = fontTools.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Script to read a CFF table in binary format as produced by afdko's tx tool | |
| and merge it into an existing OpenType/CFF font, replacing the current CFF | |
| table with the other. | |
| E.g. you can generate a OTF with fontmake with the --keep-overalaps or | |
| --no-subroutinize options, then use tx to remove overlaps or subroutinize the | |
| CFF table, and finally merge the result back into the original font: | |
| $ fontmake -u MyFont.ufo \ | |
| --no-subroutinize \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Sort glyphs in UFO by increasing Unicode codepoint to try shrinking the | |
| size of the cmap table. | |
| """ | |
| import sys | |
| from defcon import Font | |
| try: | |
| font = Font(sys.argv[1]) | |
| except IndexError: | |
| sys.exit("usage: optimize_glyph_order.py FONT.ufo") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # $ brew install --build-from-source --HEAD --with-qt /path/to/local/modified/formula/ttfautohint.rb | |
| class Ttfautohint < Formula | |
| desc "Auto-hinter for TrueType fonts" | |
| homepage "https://www.freetype.org/ttfautohint" | |
| url "https://downloads.sourceforge.net/project/freetype/ttfautohint/1.8.1/ttfautohint-1.8.1.tar.gz" | |
| sha256 "12df5120be194d2731e2a3c596892aa218681614c4f924e24279baf69bb7d4f9" | |
| bottle do | |
| cellar :any |