[FIXED] OpenType CFF font files take forever to open

Post your bug reports here. Include information that helps us to understand and reproduce the bug.
Post Reply
nabsltd
Posts: 132
Joined: Tue Oct 18, 2016 12:35 am

[FIXED] OpenType CFF font files take forever to open

Post 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.
Bhikkhu Pesala
Top Typographer
Top Typographer
Posts: 9873
Joined: Tue Oct 29, 2002 5:28 am
Location: Seven Kings, London UK
Contact:

Re: OpenType CFF font files take forever to open

Post 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.
My FontsReviews: MainTypeFont CreatorHelpFC15 + MT12.0 @ Win 10 64-bit build 19045.2486
Bhikkhu Pesala
Top Typographer
Top Typographer
Posts: 9873
Joined: Tue Oct 29, 2002 5:28 am
Location: Seven Kings, London UK
Contact:

Re: OpenType CFF font files take forever to open

Post by Bhikkhu Pesala »

Here's the good news. It didn't take forever. It did finally open OK.
My FontsReviews: MainTypeFont CreatorHelpFC15 + MT12.0 @ Win 10 64-bit build 19045.2486
Erwin Denissen
Moderator
Moderator
Posts: 11108
Joined: Fri Oct 04, 2002 12:41 am
Location: Bilthoven, The Netherlands
Contact:

Re: OpenType CFF font files take forever to open

Post by Erwin Denissen »

It is slower because we improved accuracy while keeping the number of points as low as possible.
Erwin Denissen
High-Logic
Proven Font Technology
MikeW
Posts: 625
Joined: Mon May 20, 2013 2:51 pm

Re: OpenType CFF font files take forever to open

Post 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.
nabsltd
Posts: 132
Joined: Tue Oct 18, 2016 12:35 am

Re: OpenType CFF font files take forever to open

Post 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.
Bhikkhu Pesala
Top Typographer
Top Typographer
Posts: 9873
Joined: Tue Oct 29, 2002 5:28 am
Location: Seven Kings, London UK
Contact:

Re: OpenType CFF font files take forever to open

Post 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 11482 times
Note that FontCreator 10.1 projects won't open in FontCreator 10.0
My FontsReviews: MainTypeFont CreatorHelpFC15 + MT12.0 @ Win 10 64-bit build 19045.2486
nabsltd
Posts: 132
Joined: Tue Oct 18, 2016 12:35 am

Re: OpenType CFF font files take forever to open

Post 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 11476 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.
Erwin Denissen
Moderator
Moderator
Posts: 11108
Joined: Fri Oct 04, 2002 12:41 am
Location: Bilthoven, The Netherlands
Contact:

Re: OpenType CFF font files take forever to open

Post 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.
Erwin Denissen
High-Logic
Proven Font Technology
Erwin Denissen
Moderator
Moderator
Posts: 11108
Joined: Fri Oct 04, 2002 12:41 am
Location: Bilthoven, The Netherlands
Contact:

Re: OpenType CFF font files take forever to open

Post 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
Erwin Denissen
High-Logic
Proven Font Technology
Erwin Denissen
Moderator
Moderator
Posts: 11108
Joined: Fri Oct 04, 2002 12:41 am
Location: Bilthoven, The Netherlands
Contact:

Re: OpenType CFF font files take forever to open

Post by Erwin Denissen »

The update released earlier today solves the issue.
Erwin Denissen
High-Logic
Proven Font Technology
Bhikkhu Pesala
Top Typographer
Top Typographer
Posts: 9873
Joined: Tue Oct 29, 2002 5:28 am
Location: Seven Kings, London UK
Contact:

Re: OpenType CFF font files take forever to open

Post 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.
My FontsReviews: MainTypeFont CreatorHelpFC15 + MT12.0 @ Win 10 64-bit build 19045.2486
nabsltd
Posts: 132
Joined: Tue Oct 18, 2016 12:35 am

Re: OpenType CFF font files take forever to open

Post 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?
Post Reply