Discussion:
[fontforge-users] "Errors Detected" after Conversion from TrueType to OpenType (CFF)
Kenneth Reid Beesley
2015-10-16 17:19:14 UTC
Permalink
Background:

I have used FontForge in the past (years ago), but I’m definitely no expert, and I’m basically relearning everything.

I’m using FontForge on Linux Mint 17.2.

$ fontforge -version

returns

Copyright (c) 2000-2012 by George Williams.
Executable based on sources from 14:57 GMT 31-Jul-2012-ML.
Library based on sources from 14:57 GMT 31-Jul-2012.
fontforge 20120731
libfontforge 20120731-ML

Goal:
I want to add some glyphs (from the Pitman/Ellis 1847 phonotypic alphabet) to an existing font, and then use the resulting augmented font in LaTeX/XeTeX. As the Pitman/Ellis 1847 alphabet has not yet been added to Unicode (there's a moribund proposal to add these characters at http://www.unicode.org/L2/L2010/10229r-epa-proposal.pdf) I will add the new glyphs in a Unicode Private Use Area.

Plan A

For better or worse, here’s what I decided to try:
1. Start with DoulosSIL-R.ttf, which is obviously a TrueType font (quadratic splines).
2. Convert it to an .otf, so that I could edit glyphs with cubic splines. I found the following instructions, which I followed
https://fontforge.github.io/faq.html#outline-conversion

Converting from TrueType (quadratic splines, ttf files) to PostScript (cubic splines, otf and pfb files):

File->Open
(the truetype font)
Element->Font Info->Layers <https://fontforge.github.io/fontinfo.html#Layers>
Check <*> All layers cubic
[OK]
Edit->Select->Select All
Element->Simplify->Simplify <https://fontforge.github.io/elementmenu.html#Simplify>
Hints->Auto Hint <https://fontforge.github.io/hintsmenu.html#AutoHint>
File->Generate Fonts <https://fontforge.github.io/generate.html>
In addition, I changed the em size from 2048 to 1000.

I generated the font as OpenType(CFF).

Errors Detected

When automatic validation is done, the following message is printed:

Errors detected
The font contains errors.
Self Intersecting
Missing Points at Extreme
Glyph contains overlapped hints (in the same hint mask)
Would you like to review the errors or save the font anyway?

A review of the errors shows that there are, indeed, scores of errors reported?

Question: What, if anything, should I do about these errors?

Question: Anything else that I’m doing wrong?

Thanks,

Ken


********************************
Kenneth R. Beesley, D.Phil.
PO Box 540475
North Salt Lake UT 84054
USA






------------------------------------------------------------------------------
marty39
2016-02-23 12:45:34 UTC
Permalink
Interesting question. I proceeded more carefully:

Open DoulosSIL-R.ttf
Element, Validation, Validate: many, many "missing points at extrema";
therefore
Edit, Select, Glyphs Worth Outputting; Element, Add Extrema
Element, Validation, Validate: many, many "Non-integral coordinates"
Element, Round, To Int
Element, Validation, Validate: many, but not so many "non-integral
coordinates" and "missing points at extrema," sometimes both in the same
glyph.

In other words: by the strict standards used for FontForge validation, the
font as distributed is so badly formed that FontForge is unable to fix it
automatically. Maybe the only thing you're doing wrong is holding the font
to unnecessarily high standards.

With some effort I was able to fix all the problems. I ran cycles of
validate, round, validate, add extrema, repeat, until only four
self-intersection errors remained. Double-clicking each error message to
bring up glyph view, I identified the errors by zooming in on the selected
points, and fixed them by either untwisting at a corner point or deleting
small extraneous contours.

After converting to cubic splines and validating again, six glyphs with
ogoneks turned up as self-intersecting. These can be fixed by right-clicking
on the error message and selecting "mark for overlap fix before save."

I don't really know how to deal with overlapped hints. I get that error when
I autohint. FontForge has an option to add hints when it generates fonts,
possibly overlapping those created by autohinting. "Design with FontForge"
recommends not hinting. I don't know.




--
View this message in context: http://fontforge.10959.n7.nabble.com/Errors-Detected-after-Conversion-from-TrueType-to-OpenType-CFF-tp14900p14982.html
Sent from the User mailing list archive at Nabble.com.
Nikolaus Waxweiler
2016-02-23 17:09:07 UTC
Permalink
I run into the same issues all the time when converting fonts to .otf
for better rendering with FreeType's CFF engine and also when looking at
various fonts shipped with the system or elsewhere. Seriously, check a
few system fonts and wonder about all the faults FF finds.

This may be partly because the font sources were using floating point
coordinates and the production scripts rounded to integers in such a way
that you get off-by-one-missing-extremas on terminals and serifs and
stuff. Maybe the designer did it on purpose to save points. FontForge
also plays a role here, as the conversion between upEMs and conic/cubic
curves may introduce rounding problems. When doing ANYTHING to glyphs,
always do round-to-int immediately after, that might save you a bunch of
missing extremas. FF's automatic fixes can be hit and miss.
Self-intersections can stay if they don't show up as problems in apps,
otherwise mark them all for "unlink etc when generating". Remember to
round-to-int in the production script after that, because it *will*
result in floating point coordinates.

Loading...