Created
April 28, 2023 18:21
-
-
Save anthrotype/743e35caa217cb6fb555666c9f52f768 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
The contours from https://gist.github.com/rsheeter/cef6cf71fa9e519c94f9f0d23906e5de are in fact not compatible | |
and this even before we attempt to reverse them. | |
See https://github.com/fonttools/fonttools/issues/3093 | |
""" | |
from ufoLib2 import Font | |
from ufo2ft import compileInterpolatableTTFs | |
# same routine as Rod's original gist: | |
# https://gist.github.com/rsheeter/cef6cf71fa9e519c94f9f0d23906e5de | |
def draw(pen, endp): | |
pen.moveTo((0, 0)) | |
pen.curveTo((1,1), (2,2), (3,3)) | |
pen.curveTo((4,4), (5,5), endp) | |
pen.closePath() | |
font1 = Font() | |
g = font1.newGlyph("A") | |
draw(g.getPen(), endp=(0, 0)) | |
font2 = Font() | |
g = font2.newGlyph("A") | |
draw(g.getPen(), endp=(6, 6)) | |
# reverseDirection=False so ReverseContourPen can't be blamed for this | |
for ttf in compileInterpolatableTTFs([font1, font2], reverseDirection=False): | |
# we never get here because cu2qu throws | |
# IncompatibleFontsError: fonts contains incompatible glyphs: 'A' | |
# That is not a bug, it's a feature. | |
print(ttf) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I guess I don't agree that isn't a bug :)