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

[makeotf] expects .glif file to be in a specific order #705

Closed
frankrolf opened this issue Dec 20, 2018 · 4 comments
Closed

[makeotf] expects .glif file to be in a specific order #705

frankrolf opened this issue Dec 20, 2018 · 4 comments

Comments

@frankrolf
Copy link
Member

frankrolf commented Dec 20, 2018

This is probably related to #701.
makeotf inexplicably stopped working for me, for an in-development UFO file.
I could isolate the bug to the element order in a .glif file.

This example will make makeotf fail:

<?xml version="1.0" encoding="UTF-8"?>
<glyph name="C" format="2">
	<unicode hex="0043"/>
	<advance width="663"/>
	<outline>
		<contour>
			<point x="649" y="54" type="curve"/>
			<point x="644" y="87"/>
			<point x="636" y="118"/>
			<point x="622" y="146" type="curve"/>
			<point x="558" y="118"/>
			<point x="508" y="106"/>
		</contour>
	</outline>
	<guideline x="713" y="389" angle="90" identifier="c2PHNxJalT"/>
</glyph>
$ makeotf -f GuidelineTest.ufo/
makeotf [Error] Could not find FontName (a.k.a. PostScript name) in FontDict of file '/Users/fgriessh/work/Chidori/UFO copy/GuidelineTest.ufo'

This modification makes it work:

<?xml version="1.0" encoding="UTF-8"?>
<glyph name="C" format="2">
	<unicode hex="0043"/>
	<advance width="663"/>
	<guideline x="713" y="389" angle="90" identifier="c2PHNxJalT"/>
	<outline>
		<contour>
			<point x="649" y="54" type="curve"/>
			<point x="644" y="87"/>
			<point x="636" y="118"/>
			<point x="622" y="146" type="curve"/>
			<point x="558" y="118"/>
			<point x="508" y="106"/>
		</contour>
	</outline>
</glyph>
$ makeotf -f GuidelineTest.ufo/
makeotfexe [NOTE] Adding glyph .notdef, SID 0.
Built development mode font 'GuidelineTest-Regular.otf'.

Note that the latter is not the order in which the UFOnormalizer sorts the XML structure – after normalizing, guidelines end up at the bottom of the tree.

Test UFO file attached.
GuidelineTest.ufo.zip

@miguelsousa miguelsousa self-assigned this Feb 8, 2019
@miguelsousa
Copy link
Member

This is a shortcoming in tx's UFO-reading code as well. Working on a fix.

@benkiel
Copy link
Contributor

benkiel commented Feb 8, 2019

Thought: use fonttools.ufoLib to read UFOs in tx?

@miguelsousa
Copy link
Member

We've discussed that already in #475

@benkiel
Copy link
Contributor

benkiel commented Feb 8, 2019

Duh. Apologies.

miguelsousa added a commit that referenced this issue Feb 9, 2019
miguelsousa added a commit that referenced this issue Feb 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants