Hack icon indicating copy to clipboard operation
Hack copied to clipboard

Building Hack on macOS 10.14.6 fails

Open macintacos opened this issue 4 years ago • 10 comments

I was attempting to patch Hack using alt-hack, however before I did so I wanted to make sure that a default git clone of this repo + a make ttf would work. Doesn't seem to be doing the trick. I checked out the dev branch and it seems to install fine from there, so not exactly sure what the issue is in the master branch that is causing it.

Here's the full output from a clean git clone/make ttf of the master branch:

./build-ttf.sh
Confirming that build dependencies are installed...

/usr/local/bin/fontmake
fontTools Python library identified
Starting build...

INFO:fontmake.font_project:Building TTF for Hack-Regular
INFO:ufo2ft:Pre-processing glyphs
INFO:ufo2ft.filters:Running DecomposeComponentsFilter on Hack-Regular
INFO:ufo2ft.filters:Running RemoveOverlapsFilter on Hack-Regular
INFO:ufo2ft.filters:Running CubicToQuadraticFilter on Hack-Regular
INFO:ufo2ft.filters.cubicToQuadratic:New spline lengths: 1: 4796, 2: 4109, 3: 519, 4: 85, 5: 15
INFO:ufo2ft:Building OpenType tables
INFO:fontmake.font_project:Saving master_ttf/Hack-Regular.ttf
INFO:fontmake.font_project:Building TTF for Hack-Bold
INFO:ufo2ft:Pre-processing glyphs
INFO:ufo2ft.filters:Running DecomposeComponentsFilter on Hack-Bold
INFO:ufo2ft.filters:Running RemoveOverlapsFilter on Hack-Bold
INFO:ufo2ft.filters:Running CubicToQuadraticFilter on Hack-Bold
INFO:ufo2ft.filters.cubicToQuadratic:New spline lengths: 1: 4605, 2: 4531, 3: 458, 4: 72, 5: 17, 6: 4, 7: 3
INFO:ufo2ft:Building OpenType tables
INFO:fontmake.font_project:Saving master_ttf/Hack-Bold.ttf
INFO:fontmake.font_project:Building TTF for Hack-Italic
INFO:ufo2ft:Pre-processing glyphs
INFO:ufo2ft.filters:Running DecomposeComponentsFilter on Hack-Italic
INFO:ufo2ft.filters:Running RemoveOverlapsFilter on Hack-Italic
INFO:ufo2ft.filters:Running CubicToQuadraticFilter on Hack-Italic
INFO:ufo2ft.filters.cubicToQuadratic:New spline lengths: 1: 5062, 2: 5211, 3: 531, 4: 94, 5: 13, 6: 1
INFO:ufo2ft:Building OpenType tables
INFO:fontmake.font_project:Saving master_ttf/Hack-Italic.ttf
INFO:fontmake.font_project:Building TTF for Hack-BoldItalic
INFO:ufo2ft:Pre-processing glyphs
INFO:ufo2ft.filters:Running DecomposeComponentsFilter on Hack-BoldItalic
INFO:ufo2ft.filters:Running RemoveOverlapsFilter on Hack-BoldItalic
INFO:ufo2ft.filters:Running CubicToQuadraticFilter on Hack-BoldItalic
INFO:ufo2ft.filters.cubicToQuadratic:New spline lengths: 1: 4902, 2: 5329, 3: 466, 4: 97, 5: 11, 6: 1
INFO:ufo2ft:Building OpenType tables
INFO:fontmake.font_project:Saving master_ttf/Hack-BoldItalic.ttf

Attempting DSIG table fixes with fontbakery...

master_ttf/Hack-Bold.ttf - successful DSIG table fix
master_ttf/Hack-BoldItalic.ttf - successful DSIG table fix
master_ttf/Hack-Italic.ttf - successful DSIG table fix
master_ttf/Hack-Regular.ttf - successful DSIG table fix

Attempting fstype fixes with fontbakery...

master_ttf/Hack-Bold.ttf - successful fstype fix
master_ttf/Hack-BoldItalic.ttf - successful fstype fix
master_ttf/Hack-Italic.ttf - successful fstype fix
master_ttf/Hack-Regular.ttf - successful fstype fix

Attempting ttfautohint hinting...

postbuild_processing/tt-hinting/Hack-Regular-TA.txt:3:1: invalid glyph name (0x204)
  uni0023 touch 0,1,2,3,18,19,20,21,22,23,24,25,26,27,28,31 x 0.25  @ 13
  ^
Unable to execute ttfautohint on the Hack-Regular variant set.  Build canceled.
make: *** [ttf] Error 1

Please let me know if you need anything else. I'm still running macOS 10.14.6.

macintacos avatar Oct 16 '19 02:10 macintacos

So the build of a "clean" dev branch works fine, but after I patch the font I'm getting a slightly different error, presumably due to the patching (the patching itself claimed to be successful, FWIW). For reference, all I was trying to do was change 0 to its backslashing alternative:

declare -a alternates=(
    "u0030-backslash"
)

make ttf of the dev branch looks like the following:

./build-pipenv.sh
/usr/local/bin/pipenv
Installing dependencies from Pipfile.lock (79fc86)…
Ignoring lxml: markers 'extra == "lxml"' don't match your environment
Looking in indexes: https://pypi.python.org/simple
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 13/13 — 00:00:02
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
1.7.5
=================================
  PYTHON BUILD ENVIRONMENT
=================================

Python interpreter version:
Python 3.7.4

fontmake==1.7.5
  - booleanOperations [required: >=0.8.0, installed: 0.8.0]
    - fonttools [required: >=3.1.2, installed: 3.30.0]
    - pyclipper [required: >=1.0.5, installed: 1.1.0.post1]
    - ufoLib [required: >=2.0.0, installed: 2.3.2]
      - fonttools [required: >=3.1.2,<4, installed: 3.30.0]
  - cu2qu [required: >=1.5.0, installed: 1.6.4]
    - fonttools [required: >=3.18.0, installed: 3.30.0]
    - ufoLib [required: >=2.1.1, installed: 2.3.2]
      - fonttools [required: >=3.1.2,<4, installed: 3.30.0]
  - defcon [required: >=0.5.3, installed: 0.5.3]
    - fonttools [required: >=3.1.2, installed: 3.30.0]
    - ufoLib [required: >=2.3.1, installed: 2.3.2]
      - fonttools [required: >=3.1.2,<4, installed: 3.30.0]
  - fonttools [required: >=3.30.0, installed: 3.30.0]
  - glyphsLib [required: >=3.1.2, installed: 3.1.2]
    - defcon [required: >=0.3.0, installed: 0.5.3]
      - fonttools [required: >=3.1.2, installed: 3.30.0]
      - ufoLib [required: >=2.3.1, installed: 2.3.2]
        - fonttools [required: >=3.1.2,<4, installed: 3.30.0]
    - fonttools [required: >=3.24.0, installed: 3.30.0]
  - MutatorMath [required: >=2.1.1, installed: 2.1.1]
    - defcon [required: >=0.3.5, installed: 0.5.3]
      - fonttools [required: >=3.1.2, installed: 3.30.0]
      - ufoLib [required: >=2.3.1, installed: 2.3.2]
        - fonttools [required: >=3.1.2,<4, installed: 3.30.0]
    - fontMath [required: >=0.4.4, installed: 0.4.7]
      - fonttools [required: >=3.3.0, installed: 3.30.0]
      - ufoLib [required: >=2.0.0, installed: 2.3.2]
        - fonttools [required: >=3.1.2,<4, installed: 3.30.0]
    - ufoLib [required: >=2.0.0, installed: 2.3.2]
      - fonttools [required: >=3.1.2,<4, installed: 3.30.0]
  - ufo2ft [required: >=2.4.0, installed: 2.4.0]
    - booleanOperations [required: >=0.8.0, installed: 0.8.0]
      - fonttools [required: >=3.1.2, installed: 3.30.0]
      - pyclipper [required: >=1.0.5, installed: 1.1.0.post1]
      - ufoLib [required: >=2.0.0, installed: 2.3.2]
        - fonttools [required: >=3.1.2,<4, installed: 3.30.0]
    - compreffor [required: >=0.4.5, installed: 0.4.6.post1]
      - fonttools [required: >=3.1, installed: 3.30.0]
    - cu2qu [required: >=1.5.0, installed: 1.6.4]
      - fonttools [required: >=3.18.0, installed: 3.30.0]
      - ufoLib [required: >=2.1.1, installed: 2.3.2]
        - fonttools [required: >=3.1.2,<4, installed: 3.30.0]
    - defcon [required: >=0.4.0, installed: 0.5.3]
      - fonttools [required: >=3.1.2, installed: 3.30.0]
      - ufoLib [required: >=2.3.1, installed: 2.3.2]
        - fonttools [required: >=3.1.2,<4, installed: 3.30.0]
    - fonttools [required: >=3.28.0, installed: 3.30.0]
    - ufoLib [required: >=2.1.0, installed: 2.3.2]
      - fonttools [required: >=3.1.2,<4, installed: 3.30.0]
  - ufoLib [required: >=2.3.1, installed: 2.3.2]
    - fonttools [required: >=3.1.2,<4, installed: 3.30.0]

=================================

=================================

./build-ttf.sh
Starting build...

INFO:fontmake.font_project:Building TTF for Hack-Regular
INFO:ufo2ft:Pre-processing glyphs
INFO:ufo2ft.filters:Running DecomposeComponentsFilter on Hack-Regular
INFO:ufo2ft.filters:Running RemoveOverlapsFilter on Hack-Regular
INFO:ufo2ft.filters:Running CubicToQuadraticFilter on Hack-Regular
INFO:ufo2ft.filters.cubicToQuadratic:New spline lengths: 1: 4696, 2: 4094, 3: 541, 4: 89, 5: 17
INFO:ufo2ft:Building OpenType tables
INFO:fontmake.font_project:Saving master_ttf/Hack-Regular.ttf
INFO:fontmake.font_project:Building TTF for Hack-Bold
INFO:ufo2ft:Pre-processing glyphs
INFO:ufo2ft.filters:Running DecomposeComponentsFilter on Hack-Bold
INFO:ufo2ft.filters:Running RemoveOverlapsFilter on Hack-Bold
INFO:ufo2ft.filters:Running CubicToQuadraticFilter on Hack-Bold
INFO:ufo2ft.filters.cubicToQuadratic:New spline lengths: 1: 4474, 2: 4544, 3: 476, 4: 94, 5: 19, 6: 4, 7: 3
INFO:ufo2ft:Building OpenType tables
INFO:fontmake.font_project:Saving master_ttf/Hack-Bold.ttf
INFO:fontmake.font_project:Building TTF for Hack-Italic
INFO:ufo2ft:Pre-processing glyphs
INFO:ufo2ft.filters:Running DecomposeComponentsFilter on Hack-Italic
INFO:ufo2ft.filters:Running RemoveOverlapsFilter on Hack-Italic
INFO:ufo2ft.filters:Running CubicToQuadraticFilter on Hack-Italic
INFO:ufo2ft.filters.cubicToQuadratic:New spline lengths: 1: 4973, 2: 5137, 3: 559, 4: 106, 5: 14, 6: 1
INFO:ufo2ft:Building OpenType tables
INFO:fontmake.font_project:Saving master_ttf/Hack-Italic.ttf
INFO:fontmake.font_project:Building TTF for Hack-BoldItalic
INFO:ufo2ft:Pre-processing glyphs
INFO:ufo2ft.filters:Running DecomposeComponentsFilter on Hack-BoldItalic
INFO:ufo2ft.filters:Running RemoveOverlapsFilter on Hack-BoldItalic
INFO:ufo2ft.filters:Running CubicToQuadraticFilter on Hack-BoldItalic
INFO:ufo2ft.filters.cubicToQuadratic:New spline lengths: 1: 4773, 2: 5276, 3: 496, 4: 113, 5: 14, 6: 1
INFO:ufo2ft:Building OpenType tables
INFO:fontmake.font_project:Saving master_ttf/Hack-BoldItalic.ttf

Attempting DSIG table fixes with fontbakery...

master_ttf/Hack-Bold.ttf - successful DSIG table fix
master_ttf/Hack-BoldItalic.ttf - successful DSIG table fix
master_ttf/Hack-Italic.ttf - successful DSIG table fix
master_ttf/Hack-Regular.ttf - successful DSIG table fix

Attempting fstype fixes with fontbakery...

master_ttf/Hack-Bold.ttf - successful fstype fix
master_ttf/Hack-BoldItalic.ttf - successful fstype fix
master_ttf/Hack-Italic.ttf - successful fstype fix
master_ttf/Hack-Regular.ttf - successful fstype fix

Attempting ttfautohint hinting...

postbuild_processing/tt-hinting/Hack-Regular-TA.txt:24:18: invalid range (values must be within [0;43]) (0x20B)
  zero touch 35,36,45,46,47,56  y -0.5   @8
                   ^
Unable to execute ttfautohint on the Hack-Regular variant set.  Build canceled.
make: *** [ttf] Error 1

Both builds seem to fail on the Attempting ttfautohint hinting... step.

macintacos avatar Oct 16 '19 02:10 macintacos

Woops, accidentally closed this.

macintacos avatar Oct 16 '19 02:10 macintacos

Please feel free to let me know if you need anything else for debugging! Would love to get this sorted so I can start using it.

macintacos avatar Oct 17 '19 20:10 macintacos

Sorry for the troubles! The fontmake compiler is renaming the glyphs by default in more recent releases than the source that was developed in the master branch. ttfautohint can't find the glyph names indicated in the Control Instructions Files.

Since you are on macOS, you will be fine with unhinted builds. Simply comment out the ttfautohint execution steps in the shell scripts and you should be able to build without issues. You don't need the hints on macOS. If you still run into problems, please let me know and I'll whip together a simple script as a workaround.

Edit: I think that the issue in your second step build from dev branch is that the outlines changed in the alternate zero so at least one of the points is no longer valid in the hinting files. You replaced zeroes in your build?

chrissimpkins avatar Oct 21 '19 18:10 chrissimpkins

And I do recognize that there is a root problem that needs to be addressed here. I am trying to find time to get back to this project to clean it up... Sorry!

chrissimpkins avatar Oct 21 '19 18:10 chrissimpkins

@chrissimpkins apologies for the delay here. I didn't actually get this to work (pretty sure I moved to using Meslo shortly after I created this issue), however I'm willing to test out any solutions you come up with.

Edit: I think that the issue in your second step build from dev branch is that the outlines changed in the alternate zero so at least one of the points is no longer valid in the hinting files. You replaced zeroes in your build?

Yep, I noted in this comment that I was trying to implement the slashed-0. Not sure if that helps point you in the right direction (the whole reason why I was doing this to begin with was to get the slashed-0 into the font build 🙂)

macintacos avatar Dec 01 '19 05:12 macintacos

This is OS - independent problem. In dev branch glyph files named by symbol names, but in the rest by unicode representation

Fix:

find postbuild_processing/tt-hinting/ -type f -exec sed -i 's/uni0023/numbersign/g' {} +
find postbuild_processing/tt-hinting/ -type f -exec sed -i 's/uni0025/percent/g' {} +
find postbuild_processing/tt-hinting/ -type f -exec sed -i 's/uni002B/plus/g' {} +
find postbuild_processing/tt-hinting/ -type f -exec sed -i 's/uni0030/zero/g' {} +
find postbuild_processing/tt-hinting/ -type f -exec sed -i 's/uni0038/eight/g' {} +
find postbuild_processing/tt-hinting/ -type f -exec sed -i 's/uni0021/exclam/g' {} +

cetver avatar Mar 07 '20 19:03 cetver

@cetver Thanks. Full instruction for Windows 10 and zero glif https://github.com/kisswiki/kisswiki/blob/master/src/00other/font_Hack_customization.md#windows-10

rofrol avatar Jul 28 '21 11:07 rofrol

I'm also getting this error on Manjaro Linux, this is not MacOS specific.

mahmoudhossam avatar Feb 14 '22 15:02 mahmoudhossam

Getting this error on Ubuntu 20.04.4 LTS using make build-with-dependencies.

remd avatar Apr 26 '22 15:04 remd