Page 1 of 1

[FIXED] OpenType CFF font files take forever to open

Posted: Wed Nov 30, 2016 5:12 pm
by nabsltd
In FontCreator 10.1, pretty much every font with PostScript outlines now takes 20 to 30 times as long to open as in 10.0:

Code: Select all

                               10.0     10.1
Adobe   AachenStd-Bold.otf     0:05     1:15
Storm   Aahoj.otf              0:02     1:09
GNU     FreeSerif-Regular.otf  0:24     5:00 (gave up and killed the process)
Fonts with TrueType outlines don't seem to be affected.

Re: OpenType CFF font files take forever to open

Posted: Wed Nov 30, 2016 5:25 pm
by Bhikkhu Pesala
Confirmed here. One of my large fonts takes about 3 seconds to open, but the progress bar is stuck on less than one third when opening the same font with CFF outlines.

Hopefully, Erwin will be able to fix this soon, but he might be busy now with sending out the Newsletter etc.

Re: OpenType CFF font files take forever to open

Posted: Wed Nov 30, 2016 5:31 pm
by Bhikkhu Pesala
Here's the good news. It didn't take forever. It did finally open OK.

Re: OpenType CFF font files take forever to open

Posted: Wed Nov 30, 2016 6:32 pm
by Erwin Denissen
It is slower because we improved accuracy while keeping the number of points as low as possible.

Re: OpenType CFF font files take forever to open

Posted: Wed Nov 30, 2016 6:40 pm
by MikeW
I was just popping in with the same issue.

I had accidentally deleted a font project by accident and I couldn't recover it, so I reopened the OTF I had been sent. This took nearly ten minutes.

Glad to know the why. Thanks, Erwin.

Re: OpenType CFF font files take forever to open

Posted: Wed Nov 30, 2016 7:00 pm
by nabsltd
Erwin Denissen wrote:It is slower because we improved accuracy while keeping the number of points as low as possible.
The accuracy can't be enough improved to warrant the 20 to 30 times increase in load time. It also means that drag and drop to open is pretty unusable, as the Explorer window is unresponsive until FontCreator finishes. And, dragging multiple files is really bad, since FontCreator is unresponsive until all the files are opened, and the progress bar doesn't show correctly, so there's no telling how long the operation will take.

Right now, FontCreator is basically unusable for opening OpenType files with PostScript outlines and more than a handful of glyphs.

Re: OpenType CFF font files take forever to open

Posted: Wed Nov 30, 2016 8:03 pm
by Bhikkhu Pesala
nabsltd wrote:Right now, FontCreator is basically unusable for opening OpenType files with PostScript outlines and more than a handful of glyphs.
Maybe you can find a work-around by following this tip to install 10.1 in a different folder. Run 10.0 when you want to open fonts with CFF Outlines, save the project files, then open those in FontCreator 10.1.

I have several old versions installed for testing purposes.
FontCreator Old Versions.png
FontCreator Old Versions.png (37.28 KiB) Viewed 3217 times
Note that FontCreator 10.1 projects won't open in FontCreator 10.0

Re: OpenType CFF font files take forever to open

Posted: Sat Dec 03, 2016 7:27 pm
by nabsltd
Erwin Denissen wrote:It is slower because we improved accuracy while keeping the number of points as low as possible.
Now that I've wasted a lot more time waiting out the nearly two-hour load time for some fonts, I've realized a few things.

First, why is FontCreator doing anything at all with the outlines on font open? It should just open the file, grab all the metadata (which glyphs are present, OpenType features, font names, etc.) and store the raw outline data somewhere in memory. There is no use for the outline data when showing the grid with all the glyphs...MainType doesn't need that kind of detail to show the same display. And, it buys us nothing. Here's a glyph as displayed in the grid for each of 3 versions of FontCreator, along with a zoomed in view from a screen capture:
GridDisplay.png
GridDisplay.png (7.4 KiB) Viewed 3211 times
Yes, the 10.1 is very slightly better than the 10.0 when zoomed, but at the normal size, there is zero visual difference. 10.0 displays the glyphs slightly larger than 8.0, and that is most of the improvement between the two.

What should happen is that outlines aren't looked at in detail until a glyph is opened for editing, or if you need to convert them to a different format when exporting a font or saving a project. And, it shouldn't change the outlines at all unless a glyph has been edited, but it obviously does, as saved files are much, much bigger than the original file (at least for PostScript outlines).

But, if that's not possible, then I have to ask...how in the world have you managed to write the most inefficient PostScript interpreter in the history of computers? The 90MHz processor in the LaserJet 1200 can render (and print) every glyph in a font at a size of 600 pixels in about 2 minutes. Why is it my 3.5GHz processor takes 60 times as long to do essentially the same thing when loading an OpenType font with CFF outlines? And, why are you rasterizing at all? Why not just keep the mathematically perfect PostScript Bézier curves until you need to actually rasterize to a pixel grid (which is really the only time-consuming thing about fonts in PostScript)? I admit, I don't really know exactly what the code is doing when the font file is opened, but whatever it is, that change to the code in 10.1 doesn't seem to offer any benefit to end users.

If you are going to keep this same algorithm, at the very least you are going to have to multi-thread (by dividing up the glyphs into partitions based on the number of cores) so you can get this down to a reasonable time. People downloading FontCreator for the first time to try it out are going to open their own fonts, and then give up and not buy when they see how long it takes.

Re: OpenType CFF font files take forever to open

Posted: Sun Dec 04, 2016 4:55 pm
by Erwin Denissen
nabsltd wrote:
Erwin Denissen wrote:It is slower because we improved accuracy while keeping the number of points as low as possible.
Now that I've wasted a lot more time waiting out the nearly two-hour load time for some fonts, I've realized a few things.
Insane; two hours for opening a single font with around 3K of glyphs! Opening a font should not takes minutes, and certainly not hours. We will release later next week which will solve the slow opening of CFF based fonts.
nabsltd wrote:First, why is FontCreator doing anything at all with the outlines on font open?
Because it is aimed at modifying fonts, and since FontCreator currently only supports quadratic bezier curves, all cubic curves need to be converted.

Re: OpenType CFF font files take forever to open

Posted: Sun Dec 04, 2016 10:14 pm
by Erwin Denissen
First tests show the improved algorithm will allow you to open the font in half the time compared to version 10.0 :D

Re: OpenType CFF font files take forever to open

Posted: Tue Dec 06, 2016 5:00 pm
by Erwin Denissen
The update released earlier today solves the issue.

Re: OpenType CFF font files take forever to open

Posted: Tue Dec 06, 2016 5:03 pm
by Bhikkhu Pesala
Bhikkhu Pesala wrote:Confirmed here. One of my large fonts takes about 3 seconds to open, but the progress bar is stuck on less than one third when opening the same font with CFF outlines.

Hopefully, Erwin will be able to fix this soon, but he might be busy now with sending out the Newsletter etc.
Confirmed fixed here. My large fonts again open in about 3 seconds if they contain CFF Postscript outlines.

Re: OpenType CFF font files take forever to open

Posted: Wed Dec 07, 2016 7:07 pm
by nabsltd
Erwin Denissen wrote:The update released earlier today solves the issue.
Definite fix...it's much, much faster than even 10.0 opened the fonts.
Erwin Denissen wrote:Because it is aimed at modifying fonts, and since FontCreator currently only supports quadratic bezier curves, all cubic curves need to be converted.
Despite the speed increase, it still would be better to delay the conversion until a glyph is opened for editing. That way, you avoid any losses, and your routine can be as precise as it needs to be (since you only cost time on the first open of the glyph). The huge increase in the size of the font when exported shows that your cubic->quadratic->cubic routines could use some refinement.

Part of the advantage of using PostScript outlines is the much smaller font size on disk. If you lose that advantage because the font editor doesn't do a good job at generating cubic Bézier outlines, then what reason do we have to save to PostScript outlines? Wouldn't TrueType outlines be a better choice for output from FontCreator?