satbyy / go-noto-universal

Noto fonts go universal! Download pan-Unicode, merged Noto fonts according to time of usage (current, ancient) or geographical region (South Asia, SE Asia, Africa-MiddleEast, Europe-Americas).
Other
151 stars 21 forks source link

Build error #69

Open kerams opened 2 months ago

kerams commented 2 months ago

Hey, I cloned the repo and followed the instructions to build temporal fonts, but I get

Attempting to fix OTLOffsetOverflowError ('GSUB', 'LookupIndex:', 2406, 'SubTableIndex:', None, 'ItemName:', None, 'ItemIndex:', None)
Traceback (most recent call last):
  File "/home/ubuntu/go-noto-universal/venv_fonty/lib/python3.10/site-packages/fontTools/ttLib/tables/otBase.py", line 440, in getData
    items[i] = packUShort(item.subWriter.pos - pos)
  File "/home/ubuntu/go-noto-universal/venv_fonty/lib/python3.10/site-packages/fontTools/ttLib/tables/otBase.py", line 868, in packUShort
    return struct.pack(">H", value)
struct.error: 'H' format requires 0 <= number <= 65535

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ubuntu/go-noto-universal/venv_fonty/bin/pyftmerge", line 8, in <module>
    sys.exit(main())
  File "/home/ubuntu/go-noto-universal/venv_fonty/lib/python3.10/site-packages/fontTools/misc/loggingTools.py", line 375, in wrapper
    return func(*args, **kwds)
  File "/home/ubuntu/go-noto-universal/venv_fonty/lib/python3.10/site-packages/fontTools/merge/__init__.py", line 244, in main
    font.save(options.output_file)
  File "/home/ubuntu/go-noto-universal/venv_fonty/lib/python3.10/site-packages/fontTools/ttLib/ttFont.py", line 216, in save
    writer_reordersTables = self._save(tmp)
  File "/home/ubuntu/go-noto-universal/venv_fonty/lib/python3.10/site-packages/fontTools/ttLib/ttFont.py", line 263, in _save
    self._writeTable(tag, writer, done, tableCache)
  File "/home/ubuntu/go-noto-universal/venv_fonty/lib/python3.10/site-packages/fontTools/ttLib/ttFont.py", line 713, in _writeTable
    tabledata = self.getTableData(tag)
  File "/home/ubuntu/go-noto-universal/venv_fonty/lib/python3.10/site-packages/fontTools/ttLib/ttFont.py", line 735, in getTableData
    return self.tables[tag].compile(self)
  File "/home/ubuntu/go-noto-universal/venv_fonty/lib/python3.10/site-packages/fontTools/ttLib/tables/otBase.py", line 158, in compile
    return self.tryPackingFontTools(writer)
  File "/home/ubuntu/go-noto-universal/venv_fonty/lib/python3.10/site-packages/fontTools/ttLib/tables/otBase.py", line 210, in tryPackingFontTools
    return writer.getAllData()
  File "/home/ubuntu/go-noto-universal/venv_fonty/lib/python3.10/site-packages/fontTools/ttLib/tables/otBase.py", line 700, in getAllData
    tableData = table.getData()
  File "/home/ubuntu/go-noto-universal/venv_fonty/lib/python3.10/site-packages/fontTools/ttLib/tables/otBase.py", line 447, in getData
    raise OTLOffsetOverflowError(overflowErrorRecord)
fontTools.ttLib.tables.otBase.OTLOffsetOverflowError: ('GSUB', 'LookupIndex:', 2406, 'SubTableIndex:', None, 'ItemName:', None, 'ItemIndex:', None)

Any clue what might be wrong?

kerams commented 2 months ago

I tracked this down to NotoSerifTibetanSubset-Regular.ttf. If I remove the font, GoNotoKurrent-Regular.ttf is generated successfully.

For GoNotoAncient.ttf to build I had to remove NotoSansPhags-Pa-Regular.ttf because it cannot be downloaded from the CDN.

MarcelBolten commented 2 months ago

Hi @kerams

The problem with the build is that some of the upstream noto fonts are updated and got additional glyphs. This results in too many glyphs being incorporated in the final go noto universal font files during the build. This line

struct.error: 'H' format requires 0 <= number <= 65535

in the error message indicates that the maximum number of glyphs in a ttf file is reached.

If you remove a font with enough glyphs, like you did, that will make the build work again, although without the removed font.

Regarding NotoSansPhags-Pa-Regular.ttf, it was renamed and the build tool is not up-to-date.

I am trying to customize the repo for a different project (eLabFTW, an electronic lab notebook) and have encountered similar issues. Maybe a look into my fork can help you: https://github.com/MarcelBolten/go-noto-elabftw/tree/elabftw