Skip to content

varLib merger dies on CFF->CFF2 conversion #3488

@simoncozens

Description

@simoncozens

I'm trying to merge some OTFs to VF because reasons. The first thing that varLib.merge does is convert the default master CFF table to a CFF2. With this font:

from fontTools.ttLib import TTFont
from fontTools.varLib.cff import convertCFFtoCFF2

f = TTFont("NotoSansCJKjp-Light.otf")
f.ensureDecompiled()
convertCFFtoCFF2(f)

dies with

  File "/Users/simon/others-repos/fonttools/Lib/fontTools/cffLib/__init__.py", line 1549, in _read
    return SubrsIndex(file, isCFF2=isCFF2)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/simon/others-repos/fonttools/Lib/fontTools/cffLib/__init__.py", line 878, in __init__
    super(GlobalSubrsIndex, self).__init__(file, isCFF2=isCFF2)
  File "/Users/simon/others-repos/fonttools/Lib/fontTools/cffLib/__init__.py", line 784, in __init__
    assert offSize <= 4, "offSize too large: %s" % offSize
           ^^^^^^^^^^^^
AssertionError: offSize too large: 7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions