-
Notifications
You must be signed in to change notification settings - Fork 94
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
Fontmake can not compile some ufo files in noto-sources #260
Comments
booleanOperations currently does not support removing overlaps from outlines containing (TrueType) quadratic curves. |
I see. So IIUC, overlaps are the intersection area of different contours in a glyph. Why do we need to remove overlaps and why does source design file allow overlaps?
Is quadratics branch still under developing and can not merged to master now?
… On Feb 17, 2017, at 4:42 PM, Cosimo Lupo ***@***.***> wrote:
booleanOperations currently does not support removing overlaps from outlines containing (TrueType) quadratic curves.
There's a "quadratics" branch, but it's not merged into master yet:
https://github.com/typemytype/booleanOperations/tree/quadratics
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Quadratics don't require overlaps to be removed in the first place :)
…On Feb 18, 2017 10:25 PM, "Bo Song" ***@***.***> wrote:
I see. So IIUC, overlaps are the intersection area of different contours
in a glyph. Why do we need to remove overlaps and why does source design
file allow overlaps?
Is quadratics brach still under developing and can not merged to master
now?
> On Feb 17, 2017, at 4:42 PM, Cosimo Lupo ***@***.***>
wrote:
>
> booleanOperations currently does not support removing overlaps from
outlines containing (TrueType) quadratic curves.
> There's a "quadratics" branch, but it's not merged into master yet:
> https://github.com/typemytype/booleanOperations/tree/quadratics
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub, or mute the thread.
>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#260 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAP9y1f1XYVmeSZnJDH7id_zoN_O_sEvks5rdyJrgaJpZM4ME54g>
.
|
@davelab6, not even when building CFF fonts from quadratic sources, which (I think) is what happened here? Of course it’s a weird case, but why shouldn’t fontmake support it? |
If that's the case then yes of course cff requires overlap removal. But
when I did read and now just reread the OP, I assumed that it was
outputting TTF flavour... :) I'm curious where cff was indicated
…On Feb 19, 2017 1:19 PM, "Sascha Brawer" ***@***.***> wrote:
@davelab6 <https://github.com/davelab6>, not even when building CFF fonts
from quadratic sources, which (I think) is what happened here? Of course
it’s a weird case, but why shouldn’t fontmake support it?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#260 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAP9y5mOeoiD0fE8wTW0vZjnh9QHeN2Jks5rd_QLgaJpZM4ME54g>
.
|
The OP typed However, the AssertionError in the traceback above was not caused by fontmake trying to create a CFF-OTF from a UFO containing TrueType outlines (this is not supported yet, depends on googlefonts/cu2qu#29 being landed first). I haven't checked the source files, but if they contain quadratic contours, it's likely that these were generated by decompiling binary TTF rather than drawn that way, and hence they may already have overlaps removed. Passing options |
On Feb 20, 2017 12:32 AM, "Cosimo Lupo" <[email protected]> wrote:
I'm curious where cff was indicated
the OP typed fontmake -u NotoSansLao-Bold.ufo, so fontmake by default tries
to compile both OTF and TTF, in that order.
OK cool :)
However, the AssertionError in the traceback above was *not* caused by
fontmake trying to create a CFF-OTF from a UFO containing TrueType outlines
(this is not supported yet, depends on googlefonts/cu2qu#29
<googlefonts/cu2qu#29> being landed first).
Aha :)
The problem is that booleanOperations can't remove overlaps from contours
with TrueType outlines ("qcurve"), and fontmake by default attempts to
remove the overlaps, unless told otherwise with --keep-overlaps option.
It seems to me that removing overlaps by default in TTF is suboptimal. Why
is this done?
I haven't checked the source files, but if they contain quadratic contours,
it's likely that these were generated by decompiling binary TTF rather than
drawn that way, and hence they may already have overlaps removed. Passing
options --keep-overlaps -o ttf should complete successfully
Sweet 🎉
|
Tried to pass* --keep-overlaps *option to fontmake but it still fails,
though this time it fails at a different stage rather than removing
overlapping. (NotoSansCham-Regular/Bold, NotoSansLao-Regular/Bold and
NotoSerifLao-Regular/Bold all fails with same error. Error stack is
attached below)
The reason is that these problematic fonts do not contain xHeight and
capHeight attribute in its fontinfo.plist file. I added these two
attributes to NotoSansCham-Regular.ufo/ and it is compiled successfully
with *--keep-overlaps* option.
AFAIK, this issue contains two root problems:
1. The master branch of fontmake can not remove qcurve overlaps.
2. The ChamRegular/Bold and LaoRegular/Bold ufo files are problematic. They
do not contain xHeight and capHeight (and probably more optional tags).
For 1, it seems no recent progress on merging the quadratic branch into
master typemytype/booleanOperations#26 . *What
will the potential problem be if we build the font with --keep-overlaps
option?*
For 2, who should be the source of truth that can fix these font? Can we
reach out the font designer?
FYI:
Error stack:
(dev) bosong-macbookpro:NotoSansCham bosong$ *fontmake -u
NotoSansCham-Regular.ufo --keep-overlaps -o ttf*
INFO:fontmake.font_project:Building TTFs
INFO:fontmake.font_project:Decomposing glyphs for NotoSansCham-Book
INFO:fontmake.font_project:Converting curves for NotoSansCham-Book
INFO:cu2qu.ufo:New spline lengths:
INFO:fontmake.font_project:Saving TTF for NotoSansCham-Book
Traceback (most recent call last):
File "/Users/bosong/i18n/fonttools/dev/bin/fontmake", line 11, in <module>
load_entry_point('fontmake', 'console_scripts', 'fontmake')()
File "/Users/bosong/i18n/fontmake/Lib/fontmake/__main__.py", line 183, in
main
ufo_paths, is_instance=args.pop('masters_as_instances'), **args)
File "/Users/bosong/i18n/fontmake/Lib/fontmake/font_project.py", line
443, in run_from_ufos
mti_paths=mti_paths, **kwargs)
File "/Users/bosong/i18n/fontmake/Lib/fontmake/font_project.py", line
165, in build_ttfs
self.save_otfs(ufos, ttf=True, **kwargs)
File "/Users/bosong/i18n/fonttools/Lib/fontTools/misc/loggingTools.py",
line 372, in wrapper
return func(*args, **kwds)
File "/Users/bosong/i18n/fontmake/Lib/fontmake/font_project.py", line
264, in save_otfs
convertCubics=False, optimizeCff=subroutinize)
File
"/Users/bosong/i18n/fonttools/dev/lib/python2.7/site-packages/ufo2ft/__init__.py",
line 42, in compileTTF
return compileOTF(ufo, outlineCompilerClass=outlineCompilerClass,
**kwargs)
File
"/Users/bosong/i18n/fonttools/dev/lib/python2.7/site-packages/ufo2ft/__init__.py",
line 27, in compileOTF
otf = outlineCompiler.compile()
File
"/Users/bosong/i18n/fonttools/dev/lib/python2.7/site-packages/ufo2ft/outlineOTF.py",
line 91, in compile
self.setupTable_OS2()
File
"/Users/bosong/i18n/fonttools/dev/lib/python2.7/site-packages/ufo2ft/outlineOTF.py",
line 434, in setupTable_OS2
xHeight = getAttrWithFallback(font.info, "xHeight")
File
"/Users/bosong/i18n/fonttools/dev/lib/python2.7/site-packages/ufo2ft/fontInfoData.py",
line 420, in getAttrWithFallback
value = staticFallbackData[attr]
KeyError: u'xHeight'
On Mon, Feb 20, 2017 at 2:24 AM, Dave Crossland <[email protected]>
wrote:
… On Feb 20, 2017 12:32 AM, "Cosimo Lupo" ***@***.***> wrote:
I'm curious where cff was indicated
the OP typed fontmake -u NotoSansLao-Bold.ufo, so fontmake by default tries
to compile both OTF and TTF, in that order.
OK cool :)
However, the AssertionError in the traceback above was *not* caused by
fontmake trying to create a CFF-OTF from a UFO containing TrueType outlines
(this is not supported yet, depends on googlefonts/cu2qu#29
<googlefonts/cu2qu#29> being landed first).
Aha :)
The problem is that booleanOperations can't remove overlaps from contours
with TrueType outlines ("qcurve"), and fontmake by default attempts to
remove the overlaps, unless told otherwise with --keep-overlaps option.
It seems to me that removing overlaps by default in TTF is suboptimal. Why
is this done?
I haven't checked the source files, but if they contain quadratic contours,
it's likely that these were generated by decompiling binary TTF rather than
drawn that way, and hence they may already have overlaps removed. Passing
options --keep-overlaps -o ttf should complete successfully
Sweet 🎉
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#260 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEGl792c1mZJ7BYS1nkIDeraMm1Vu7F9ks5reWnagaJpZM4ME54g>
.
--
Sincerely,
Bo Song
Master Student in Computer Science
Yale University
|
@zjusbo : we are replacing Lao with the new sources |
I'm closing this issue since:
|
Affected files are :
noto-source/src/NotoSansCham/NotoSansCham-Regular.ufo
noto-source/src/NotoSansCham/NotoSansCham-Bold.ufo
noto-source/src/NotoSansLao/NotoSansLao-Regular.ufo
noto-source/src/NotoSansLao/NotoSansLao-Bold.ufo
and probably more.
The error is
(dev) bosong-macbookpro:NotoSansLao bosong$ fontmake -u NotoSansLao-Bold.ufo/
INFO:fontmake.font_project:Building OTFs
INFO:fontmake.font_project:Decomposing glyphs for NotoSansLao-Bold
INFO:fontmake.font_project:Removing overlaps for NotoSansLao-Bold
Traceback (most recent call last):
File "/Users/bosong/i18n/fonttools/dev/bin/fontmake", line 11, in
load_entry_point('fontmake', 'console_scripts', 'fontmake')()
File "/Users/bosong/i18n/fontmake/Lib/fontmake/main.py", line 183, in main
ufo_paths, is_instance=args.pop('masters_as_instances'), **args)
File "/Users/bosong/i18n/fontmake/Lib/fontmake/font_project.py", line 435, in run_from_ufos
ufos, remove_overlaps, mti_paths=mti_paths, **kwargs)
File "/Users/bosong/i18n/fontmake/Lib/fontmake/font_project.py", line 146, in build_otfs
self.remove_overlaps(ufos)
File "/Users/bosong/i18n/fonttools/Lib/fontTools/misc/loggingTools.py", line 372, in wrapper
return func(*args, **kwds)
File "/Users/bosong/i18n/fontmake/Lib/fontmake/font_project.py", line 87, in remove_overlaps
union(contours, glyph.getPointPen())
File "/Users/bosong/i18n/fonttools/dev/lib/python2.7/site-packages/booleanOperations/booleanOperationManager.py", line 104, in union
return _performOperation("union", contours, [], outPen)
File "/Users/bosong/i18n/fonttools/dev/lib/python2.7/site-packages/booleanOperations/booleanOperationManager.py", line 64, in _performOperation
subjectInputContours = [InputContour(contour) for contour in subjectContours if contour and len(contour) > 1]
File "/Users/bosong/i18n/fonttools/dev/lib/python2.7/site-packages/booleanOperations/flatten.py", line 72, in init
self.segments = _convertPointsToSegments(points)
File "/Users/bosong/i18n/fonttools/dev/lib/python2.7/site-packages/booleanOperations/flatten.py", line 440, in _convertPointsToSegments
willBeReversed=willBeReversed
File "/Users/bosong/i18n/fonttools/dev/lib/python2.7/site-packages/booleanOperations/flatten.py", line 174, in init
for pt1, pt2 in decomposeQuadraticSegment(pointCoordinates[1:]):
File "/Users/bosong/i18n/fonttools/Lib/fontTools/pens/basePen.py", line 329, in decomposeQuadraticSegment
assert n > 0
AssertionError
However, the fontmake can compile the intermediate ufo files generated by its self in master_ufo folder.
The text was updated successfully, but these errors were encountered: