Skip to content

Variable CFF2 fails due to OTF interpolatable drops duplicate point if starting point is in inner side #1151

@NightFurySL2001

Description

@NightFurySL2001

Source file with error: TestDoublePoint.zip

fontmake 3.10.1, fonttools v4.58.4, ufo2ft 3.5.0

If a starting point is set at this specific corner with another point duplicating in the same location, when building variable-cff2 or otf-interpolatable, the point will be dropped.

Image
Image

fontmake .\TestDoublePoint.designspace -o variable-cff2 raises:

INFO:fontmake.font_project:Loading 2 DesignSpace source UFOs
INFO:fontmake.font_project:Building variable fonts variable_otf\TestDoublePoint-VF.otf
INFO:ufo2ft:Features are compatible across masters; building later
INFO:ufo2ft:Pre-processing glyphs
INFO:ufo2ft.filters:Running interpolatable DecomposeComponentsIFilter
INFO:ufo2ft:Building OpenType tables for TestDoublePoint-Regular
INFO:ufo2ft:Building OpenType tables for Unnamed-Regular
INFO:ufo2ft:Building variable font: TestDoublePoint-VF
INFO:fontTools.varLib:Axes:
[{'axisLabels': [],
  'axisOrdering': None,
  'default': 1000.0,
  'hidden': False,
  'labelNames': {'en': 'Weight'},
  'map': [(1.0, 1.0), (400.0, 400.0), (1000.0, 1000.0)],
  'maximum': 1000.0,
  'minimum': 1.0,
  'name': 'weight',
  'tag': 'wght'}]
INFO:fontTools.varLib:Internal master locations:
[{'weight': 1000.0}, {'weight': 1.0}]
INFO:fontTools.varLib:Internal axis supports:
{'weight': [1.0, 1000.0, 1000.0]}
INFO:fontTools.varLib:Normalized master locations:
[{'weight': 0.0}, {'weight': -1.0}]
INFO:fontTools.varLib:Index of base master: 0
INFO:fontTools.varLib:Building variable font
INFO:fontTools.varLib:Loading master fonts
INFO:fontTools.varLib:Generating fvar
INFO:fontTools.varLib:Building variations tables
INFO:fontTools.varLib:Generating avar
INFO:fontTools.varLib:No need for avar
INFO:fontTools.varLib:Generating MVAR
INFO:fontTools.varLib:Generating HVAR
fontmake: Error: In 'TestDoublePoint.designspace': Generating fonts from Designspace failed: Glyph 'test': 'rlineto' at point index 24 in master index 1 differs from the default font point type 'rmoveto'

going through fontmake .\TestDoublePoint.designspace -o otf-interpolatable and then run AFDKO buildcff2vf -d ./master_otf_interpolatable/TestDoublePoint.designspace -c raise the same error too:

Reading source fonts...
Checking outline compatibility in source fonts...
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Python311\Scripts\buildcff2vf.exe\__main__.py", line 7, in <module>
  File "C:\Python311\Lib\site-packages\afdko\buildcff2vf.py", line 564, in main
    do_compatibility(vf, font_list, ds_data.base_idx)
  File "C:\Python311\Lib\site-packages\afdko\buildcff2vf.py", line 332, in do_compatibility
    region_charstring.draw(compat_pen)
  File "C:\Python311\Lib\site-packages\fontTools\misc\psCharStrings.py", line 1168, in draw
    extractor.execute(self)
  File "C:\Python311\Lib\site-packages\fontTools\misc\psCharStrings.py", line 636, in execute
    super().execute(charString)
  File "C:\Python311\Lib\site-packages\fontTools\misc\psCharStrings.py", line 360, in execute
    rv = handler(index)
         ^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\fontTools\misc\psCharStrings.py", line 727, in op_rlineto
    self.rLineTo(point)
  File "C:\Python311\Lib\site-packages\fontTools\misc\psCharStrings.py", line 654, in rLineTo
    self.pen.lineTo(self._nextPoint(point))
  File "C:\Python311\Lib\site-packages\fontTools\pens\basePen.py", line 328, in lineTo
    self._lineTo(pt)
  File "C:\Python311\Lib\site-packages\fontTools\varLib\cff.py", line 538, in _lineTo
    self.add_point("rlineto", pt_coords)
  File "C:\Python311\Lib\site-packages\afdko\buildcff2vf.py", line 134, in add_point
    raise VarLibCFFPointTypeMergeError(
fontTools.varLib.errors.VarLibCFFPointTypeMergeError: Glyph 'test': 'rlineto' at point index 24 in master index 1 differs from the default font point type 'rmoveto'

the point is dropped in EL OTF.

Image

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