Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[builder] Option to choose pathops as the overlapping backend for fontmake #654

Closed
NightFurySL2001 opened this issue Jan 30, 2023 · 3 comments
Labels
builder Issues related to the gftools-builder

Comments

@NightFurySL2001
Copy link

I am trying to migrate Google Font repo from using fontmake to gftools builder, and after running it throws the following error:

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 241, in compileTTF
    glyphSet = call_preprocessor(ufo, **kwargs)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\ufo2ft\__init__.py", line 70, in call_preprocessor
    return preProcessor.process()
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\ufo2ft\preProcessor.py", line 101, in process
    func(ufo, glyphSet)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\ufo2ft\filters\base.py", line 202, in __call__
    if include(glyph) and filter_(glyph):
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\ufo2ft\filters\removeOverlaps.py", line 47, in filter
    self.union(contours, pen)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\booleanOperations\booleanOperationManager.py", line 100, in union
    return _performOperation("union", contours, [], outPen)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\booleanOperations\booleanOperationManager.py", line 69, in _performOperation
    subjectInputContours = [InputContour(contour) for contour in subjectContours if contour and len(contour) > 1]
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\booleanOperations\booleanOperationManager.py", line 69, in <listcomp>
    subjectInputContours = [InputContour(contour) for contour in subjectContours if contour and len(contour) > 1]
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\booleanOperations\flatten.py", line 68, in __init__
    self.segments = _convertPointsToSegments(points)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\booleanOperations\flatten.py", line 446, in _convertPointsToSegments
    raise UnsupportedContourError(
booleanOperations.exceptions.UnsupportedContourError: ('Trying to perform operation on unsupported segment type.', 'qcurve')

It seems that the overlapping backend doesn't work for my font, and trying fontmake --overlaps-backend pathops does not result in the same error. Is there any way to let gftools builder use the pathops backend?

@RosaWagner RosaWagner added the builder Issues related to the gftools-builder label Feb 24, 2023
@simoncozens
Copy link
Contributor

This is done in builder2 with the extraFontmakeArgs parameter.

@hfhchan
Copy link

hfhchan commented May 1, 2024

I'm hitting this as well. Where do I put the extraFontmakeArgs parameter and what should I pass?

@simoncozens
Copy link
Contributor

I should mention that the underlying issue here is that you're using quadratic curves in your sources. Maybe you want to do that, in which case fine, but maybe those curves ended up as quadratic by accident and you should convert them back to cubic in your editor.

If you don't need overlap removal at all, add this to your sources/config.yaml:

removeOutlineOverlaps: false

If you specifically want to use pathops, add this to your sources/config.yaml:

extraFontmakeArgs: --overlaps-backend pathops

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builder Issues related to the gftools-builder
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants