question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Assertion in compiling GPOS table built by feaLib

See original GitHub issue

I’m not sure if this is a feaLib bug, ttLib bug or a bug in my font. I’m getting this assertion error which I suspect is related to table splitting:

Parsing 'GlyphOrder' table...
Parsing 'head' table...
Parsing 'hhea' table...
Parsing 'maxp' table...
Parsing 'OS/2' table...
Parsing 'name' table...
Parsing 'cmap' table...
Parsing 'post' table...
Parsing 'CFF ' table...
Parsing 'BASE' table...
Parsing 'GDEF' table...
Parsing 'GPOS' table...
Parsing 'GSUB' table...
Parsing 'hmtx' table...
Attempting to fix OTLOffsetOverflowError ('GPOS', 'LookupIndex:', 11, 'SubTableIndex:', None, 'ItemName:', None, 'ItemIndex:', None)
Attempting to fix OTLOffsetOverflowError ('GPOS', 'LookupIndex:', 10, 'SubTableIndex:', 1, 'ItemName:', 'Coverage', 'ItemIndex:', None)
Attempting to fix OTLOffsetOverflowError ('GPOS', 'LookupIndex:', 10, 'SubTableIndex:', 1, 'ItemName:', 'Coverage', 'ItemIndex:', None)
Traceback (most recent call last):
  File "/fonttools/Lib/fontTools/ttx.py", line 383, in main
    process(jobs, options)
  File "/fonttools/Lib/fontTools/ttx.py", line 356, in process
    action(input, output, options)
  File "/fonttools/Lib/fontTools/misc/loggingTools.py", line 369, in wrapper
    return func(*args, **kwds)
  File "/fonttools/Lib/fontTools/ttx.py", line 277, in ttCompile
    ttf.save(output)
  File "/fonttools/Lib/fontTools/ttLib/__init__.py", line 216, in save
    self._writeTable(tag, writer, done)
  File "/fonttools/Lib/fontTools/ttLib/__init__.py", line 648, in _writeTable
    tabledata = self.getTableData(tag)
  File "/fonttools/Lib/fontTools/ttLib/__init__.py", line 659, in getTableData
    return self.tables[tag].compile(self)
  File "/fonttools/Lib/fontTools/ttLib/tables/otBase.py", line 90, in compile
    self.table.compile(writer, font)
  File "/fonttools/Lib/fontTools/ttLib/tables/otBase.py", line 660, in compile
    conv.write(writer, font, table, value)
  File "/fonttools/Lib/fontTools/ttLib/tables/otConverters.py", line 358, in write
    value.compile(subWriter, font)
  File "/fonttools/Lib/fontTools/ttLib/tables/otBase.py", line 635, in compile
    conv.write(writer, font, table, value, i)
  File "/fonttools/Lib/fontTools/ttLib/tables/otConverters.py", line 358, in write
    value.compile(subWriter, font)
  File "/fonttools/Lib/fontTools/ttLib/tables/otBase.py", line 635, in compile
    conv.write(writer, font, table, value, i)
  File "/fonttools/Lib/fontTools/ttLib/tables/otConverters.py", line 358, in write
    value.compile(subWriter, font)
  File "/fonttools/Lib/fontTools/ttLib/tables/otBase.py", line 618, in compile
    writer['LookupType'].setValue(self.__class__.LookupType)
  File "/fonttools/Lib/fontTools/ttLib/tables/otBase.py", line 514, in setValue
    assert table[name] == value, (name, table[name], value)
AssertionError: (('LookupType', 9, 2), 'PairPos[2]', 'Lookup[10]', 'LookupList')

When compiling the attached ttx file (which was created by from https://github.com/khaledhosny/mada. I had to save a ttx file since compiling directly was failing with the same assert). Mada-Light.ttx.zip

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
behdadcommented, Jul 13, 2016

Ok, took a while to debug. But should be fixed. Please test and report. Thanks!

0reactions
anthrotypecommented, Jul 13, 2016

Thank you Behdad! It seems to be working now 👏

Read more comments on GitHub >

github_iconTop Results From Across the Web

fonttools/builder.py at main - GitHub
A library to manipulate font files from Python. Contribute to fonttools/fonttools development by creating an account on GitHub.
Read more >
Source code for fontTools.feaLib.builder
feaLib.variableScalar import VariableScalar from fontTools. ... parseTree.build(self) # by default, build all the supported tables if tables is None: tables ...
Read more >
NEWS.rst - third_party/fonttools - Git at Google - fuchsia Git ...
[varLib] Re-enabled generation of ``HVAR`` table for fonts with. TrueType outlines; removed ``--build-HVAR`` command-line option. - [feaLib] The parser can ...
Read more >
fonttools [python-library] - Occam :: Details
[feaLib] You can export FONTTOOLS_LOOKUP_DEBUGGING=1 to enable feature file debugging info stored in Debg table (#2106). [otlLib] Build more efficient format 1 ...
Read more >
Problem compiling GPOS table - Glyphs Forum
The GPOS table can store ~64 kB data. Kerning and mark positioning will fill up that data quite quickly. When using extension lookups, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found