googlefonts / googlefonts/fontmake

Building fallback font fails when building cmap: 'H' format requires 0 <= number <= 65535

Open
#992 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
888
Forks
97
Avg merge
4d 52m
Merged PRs (30d)
1

Description

When building fallback type font (similar to [Unicode Last Resort font](https://github.com/unicode-org/last-resort-font)), the font fails at building `cmap` table. Below is the UFO zipped file and the build log with `--verbose DEBUG`.

[MonuLast-8.10.ufo.zip](https://github.com/googlefonts/fontmake/files/11242484/MonuLast-8.10.ufo.zip)

```
DEBUG:fontmake.font_project:ufoLib UFO validation is disabled
INFO:fontmake.font_project:Building TTF for MonuLast-8.10
INFO:ufo2ft:Pre-processing glyphs
INFO:ufo2ft.filters.base:Running DecomposeComponentsFilter on MonuLast-8.10
INFO:ufo2ft.filters.base:Running CubicToQuadraticFilter on MonuLast-8.10
DEBUG:ufo2ft.filters.base:Took 0.044s to run CubicToQuadraticFilter on 412 glyphs
INFO:ufo2ft.filters.cubicToQuadratic:New spline lengths:
INFO:ufo2ft:Building OpenType tables
DEBUG:ufo2ft.featureWriters.kernFeatureWriter.KernFeatureWriter:No kerning data; skipped
DEBUG:ufo2ft.featureWriters.markFeatureWriter.MarkFeatureWriter:No mark-attaching anchors found; skipped
DEBUG:ufo2ft.featureWriters.gdefFeatureWriter.GdefFeatureWriter:No features to be generated; skipped
DEBUG:fontTools.ttLib.ttFont:Compiling 'glyf' table
DEBUG:fontTools.ttLib.ttFont:Writing 'glyf' table to disk
DEBUG:fontTools.ttLib.ttFont:Compiling 'maxp' table
DEBUG:fontTools.ttLib.ttFont:Writing 'maxp' table to disk
DEBUG:fontTools.ttLib.ttFont:Compiling 'loca' table
DEBUG:fontTools.ttLib.ttFont:Writing 'loca' table to disk
DEBUG:fontTools.ttLib.ttFont:Compiling 'head' table
DEBUG:fontTools.ttLib.ttFont:Writing 'head' table to disk
DEBUG:fontTools.ttLib.ttFont:Compiling 'hmtx' table
DEBUG:fontTools.ttLib.ttFont:Writing 'hmtx' table to disk
DEBUG:fontTools.ttLib.ttFont:Compiling 'hhea' table
DEBUG:fontTools.ttLib.ttFont:Writing 'hhea' table to disk
DEBUG:fontTools.ttLib.ttFont:Compiling 'OS/2' table
DEBUG:fontTools.ttLib.ttFont:Writing 'OS/2' table to disk
DEBUG:fontTools.ttLib.ttFont:Compiling 'cmap' table
ERROR:root:In 'MonuLast-8.10.ufo': Compiling UFO failed: 'H' format requires 0 <= number <= 65535
Traceback (most recent call last):
File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\fontmake\font_project.py", line 439, in _iter_compile
yield compile_func(ufo, debugFeatureFile=debugFeatureFile, **options)
File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\ufo2ft\__init__.py", line 250, in compileTTF
return call_postprocessor(otf, ufo, glyphSet, **kwargs)
File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\ufo2ft\__init__.py", line 81, in call_postprocessor
postProcessor = postProcessorClass(otf, ufo, glyphSet=glyphSet)
File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\ufo2ft\postProcessor.py", line 50, in __init__
self.otf = _reloadFont(otf)
File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\ufo2ft\postProcessor.py", line 394, in _reloadFont
font.save(stream)
File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\fontTools\ttLib\ttFont.py", line 201, in save
writer_reordersTables = self._save(tmp)
File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\fontTools\ttLib\ttFont.py", line 248, in _save
self._writeTable(tag, writer, done, tableCache)
File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\fontTools\ttLib\ttFont.py", line 700, in _writeTable
tabledata = self.getTableData(tag)
File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\fontTools\ttLib\ttFont.py", line 722, in getTableData
return self.tables[tag].compile(self)
File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\fontTools\ttLib\tables\_c_m_a_p.py", line 207, in compile
chunk = table.compile(ttFont)
File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\fontTools\ttLib\tables\_c_m_a_p.py", line 1029, in compile
header = struct.pack(
struct.error: 'H' format requires 0 <= number <= 65535

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\fontmake\__main__.py", line 657, in main
project.run_from_ufos(
File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\fontmake\font_project.py", line 1223, in run_from_ufos
self.build_ttfs(ufos, **kwargs)
File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\fontmake\font_project.py", line 251, in build_ttfs
self.save_otfs(ufos, ttf=True, **kwargs)
File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\fontTools\misc\loggingTools.py", line 375, in wrapper
return func(*args, **kwds)
File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\fontmake\font_project.py", line 580, in save_otfs
for font, ufo in zip(fonts, ufos):
File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\fontmake\font_project.py", line 441, in _iter_compile
raise FontmakeError("Compiling UFO failed", ufo.path) from e
fontmake.errors.FontmakeError: In 'MonuLast-8.10.ufo': Compiling UFO failed: 'H' format requires 0 <= number <= 65535
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.