Page 1 of 1

Should I delete all my empty glyphs?

Posted: Fri Jan 04, 2019 9:54 pm
by Psymon
When you've finished up your font, and are ready to "put it out there" for people to download/use, how important is it to delete all the unused, empty glyphs? In each of my fonts I have tons and tons of empty glyphs in the PUA section of each font. The reason for that is because all the various ligatures in each font are coordinated in the same slots, but each font has different ligs, and some not many ligs at all. It's nice to leave all those empty slots there while I'm working on this family (so that if I discover I need to add in an additional lig I can squeeze it in easily), but is it "important" to delete them when you're finished up? I can see that it would bring the file size down a little, but they're all just empty slots, so I can't imagine that it would be a huge saving in file size, really.

Other than that, though, is there any real practical reason to delete all the empty slots (other than the necessary ones, of course)?

Re: Should I delete all my empty glyphs?

Posted: Fri Feb 22, 2019 10:43 am
by Erwin Denissen
It is best to delete all unused glyphs. Otherwise external software like word processors or font managers might show the glyphs to the end user while you never intended this.

And, yes, it will also save some bytes.

We could add a new feature which allows you to mark a glyph to be included on export. This is similar to what we're used with our manual generation software.

Re: Should I delete all my empty glyphs?

Posted: Fri Feb 22, 2019 6:30 pm
by Psymon
Erwin Denissen wrote:
Fri Feb 22, 2019 10:43 am
It is best to delete all unused glyphs. Otherwise external software like word processors or font managers might show the glyphs to the end user while you never intended this.

And, yes, it will also save some bytes.
Yeah, that's what I figured -- and what I ended up doing with my fonts. ;)
We could add a new feature which allows you to mark a glyph to be included on export. This is similar to what we're used with our manual generation software.
Cool -- not sure if I would personally take advantage of that feature myself, but it's always nice to have more features for those that might. :)

Re: Should I delete all my empty glyphs?

Posted: Fri Feb 22, 2019 6:56 pm
by Bhikkhu Pesala
I use a transform script to mark all of the glyphs in my fonts that I do not wish to include in the WOFF versions. It takes longer to explain than it does to do. It relies on using consistent glyph names. You can generate glyph names from the Tools menu if you don't use your own naming convention.
  1. Tag all of the glyphs that you do not wish to include
  2. Select all of the glyphs with that tag
  3. Copy to the clipboard
  4. Paste into Notepad2.exe
  5. Join all paragraphs = Ctrl+Shift+J
  6. Find and Replace "space" and replace it with "comma space"
  7. Paste into a Transform script for "Override Range by Glyph Name"
  8. Save the script for reuse on other fonts
  9. Run the script to select the glyphs to be tagged
  10. Before exporting the font, delete all tagged glyphs
  11. After exporting the font, undo delete

Re: Should I delete all my empty glyphs?

Posted: Fri Feb 22, 2019 7:08 pm
by Psymon
Cool. I can't see myself having a need to do anything like that right now, but who knows, maybe some day I'll be back here to take a closer look at that again to try out. :)

Re: Should I delete all my empty glyphs?

Posted: Sat Feb 23, 2019 10:11 am
by William
However, if you do delete all the unused Private Use Area (PUA) cells that each contain nothing, then if some user of your font uses one of those PUA code points then the Windows operating system might insert a Japanese character. So as you wrote:

> In each of my fonts I have tons and tons of empty glyphs in the PUA section of each font. The reason for that is because all the various ligatures in each font are coordinated in the same slots, but each font has different ligs, and some not many ligs at all.

So maybe for this particular circumstance a glyph of your own to mean "Not supported in this particular font" might be a better choice, so that if some user of your font uses one of those PUA code points, then he or she gets a "Not supported in this particular font" glyph that is documented for your fonts, rather than a Japanese character that is nothing to do with it.

William

Re: Should I delete all my empty glyphs?

Posted: Tue Feb 26, 2019 4:07 pm
by Psymon
Oh, that's a thought -- or maybe just copy/paste the .notdef glyph into each of those unused slots.

I'll think about that, might not be a bad idea. :)

Re: Should I delete all my empty glyphs?

Posted: Wed Feb 27, 2019 10:22 am
by William
> ... maybe just copy/paste the .notdef glyph into each of those unused slots.

Yes, that would be a good idea.

Keeping the cells in the font also has the advantage that should you at some future time want to add to the capabilities of a particular font, the cells would be already there in place rather than needing to add them in (again).

William

Re: Should I delete all my empty glyphs?

Posted: Wed Feb 27, 2019 11:02 am
by Bhikkhu Pesala
Even if you paste the .notdef glyph into each empty glyph as a composite glyph, it is still adding useless data to the font.

Delete the unused glyphs from the Font Project file, export the font, then undelete the deleted glyphs. If you tag the unused glyphs, deleting them takes a few clicks, and undeleting them is just Ctrl+Z.