OTF File size

Get help with FontCreator here. Please do not post feature requests or bug reports here.
Post Reply
Daniel
Posts: 23
Joined: Wed May 07, 2014 7:13 pm

OTF File size

Post by Daniel »

Hi there

Is there a way to reduce the file size of the OTF files?
My otf has over 800kb due to the large amount of kerning pairs (~90k)
I have over 800 glyphs

Thank you for your help
Bhikkhu Pesala
Top Typographer
Top Typographer
Posts: 9878
Joined: Tue Oct 29, 2002 5:28 am
Location: Seven Kings, London UK
Contact:

Re: OTF File size

Post by Bhikkhu Pesala »

It seems that you have a lot more kerning pairs than you really need. My smallest font, Verajja PDA, has 994 glyphs, but only about 15K kerning pairs.
Image
These are my results:
  1. No glyph names, no kerning tables, no hinting: 68 Kbytes
  2. No Glyph Names, GPOS kerning table, Autohinting: 161 Kbytes
  3. Glyph Names, GPOS kerning table, No hinting: 137 Kbytes
  4. Glyph Names, GPOS kerning table, Autohinting: 169 Kbytes
  5. Glyph Names, GPOS kerning table, Legacy kern table, Autohinting: 253 Kbytes
These are simple, Sans Serif glyphs, with few nodes. Fonts with large numbers of nodes will need a lot more bytes for hinting.

The legacy kerning table can only contain about 10,000 kerning pairs and uses 6 bytes for each pair.

Have you used FontCreator 8.0 and added kerning groups to your font? How have you got so many? If you can attach your font project we might be able to suggest some improvements.
My FontsReviews: MainTypeFont CreatorHelpFC15 + MT12.0 @ Win 10 64-bit build 19045.2486
Daniel
Posts: 23
Joined: Wed May 07, 2014 7:13 pm

Re: OTF File size

Post by Daniel »

Thank you for your reply.
I've used FC 8 with kerning groups.
Here's how it looks like the grouping and kernings

Code: Select all

---------deleted --------------
Last edited by Daniel on Sun Jun 29, 2014 11:07 am, edited 1 time in total.
Bhikkhu Pesala
Top Typographer
Top Typographer
Posts: 9878
Joined: Tue Oct 29, 2002 5:28 am
Location: Seven Kings, London UK
Contact:

Re: OTF File size

Post by Bhikkhu Pesala »

I cannot do anything with that code. Please export the script from the OpenType Designer, ZIP it and and attach that here.

The only thing that will reduce the font file size is reducing the number of kerning pairs. You have some large groups.
My FontsReviews: MainTypeFont CreatorHelpFC15 + MT12.0 @ Win 10 64-bit build 19045.2486
Daniel
Posts: 23
Joined: Wed May 07, 2014 7:13 pm

Re: OTF File size

Post by Daniel »

Here it is
Thank you

All I did was to include in groups all the diacritics (composite glyph)
preview
preview
FChelp.png (35.75 KiB) Viewed 11754 times
Attachments
FC_Help.zip
zip file
(3.17 KiB) Downloaded 320 times
Bhikkhu Pesala
Top Typographer
Top Typographer
Posts: 9878
Joined: Tue Oct 29, 2002 5:28 am
Location: Seven Kings, London UK
Contact:

Re: OTF File size

Post by Bhikkhu Pesala »

In defining your groups, you need to think how they will combine as kerning pairs.

It is OK to include A Á À Ä etc., in the same group as they are the same shape, but none of the lowercase a, à, á etc., belong in the A Caps group. Greek capital Delta could be, as it's the same shape, as could Alpha and Lambda, but will they appear adjacent to Latin Letter T ?

AT and TA will kern neatly, and L will kern with T, but T won't kern with L so there's no point creating adjustment pairs that won't be needed. This is just bloating the font and making the kerning completely useless.

Punctuation is not all the same shape. Adjustment pairs of T with , . and - will work, and maybe / but why are all the other punctuation marks in the same group? A will kern with ’ and ”, but T won't.
T Comma.png
T Comma.png (1.53 KiB) Viewed 11752 times
T Bracket.png
T Bracket.png (1.47 KiB) Viewed 11752 times
My FontsReviews: MainTypeFont CreatorHelpFC15 + MT12.0 @ Win 10 64-bit build 19045.2486
Daniel
Posts: 23
Joined: Wed May 07, 2014 7:13 pm

Re: OTF File size

Post by Daniel »

You're right, I didn't consider this aspect of pairing. Thank you
Dou you know anywhere out there proper guidance to the most usual pair of letter to kern without missing any possible combination for any language? (google it's helpless)
It's clear to me now that I have to reduce the paring only to the most used combinations

I forgot to mention that I use the same shapes for uppercase and lowercase,that's why my groups include both
Bhikkhu Pesala
Top Typographer
Top Typographer
Posts: 9878
Joined: Tue Oct 29, 2002 5:28 am
Location: Seven Kings, London UK
Contact:

Re: OTF File size

Post by Bhikkhu Pesala »

If Uppercase and Lowercase use the same glyphs, save work by copying the codepoints from lowercase to uppercase — copy, paste special. override codepoints. Then you only need one glyph in the group instead of two.

If they are the same shape, but different sizes, make a group each for Uppercase and lowercase.

Don't worry about looking for which pairs appear together — just get your groups and pairs right according to the letter shapes.

Scroll through the drop lists to check kerning pairs for all group members.

FontCreator 8.0 Adjustment Pairs
My FontsReviews: MainTypeFont CreatorHelpFC15 + MT12.0 @ Win 10 64-bit build 19045.2486
Daniel
Posts: 23
Joined: Wed May 07, 2014 7:13 pm

Re: OTF File size

Post by Daniel »

what do you mean by
"copying the codepoints from lowercase to uppercase — copy, paste special. override codepoints."
This way lowercase disappear
Bhikkhu Pesala
Top Typographer
Top Typographer
Posts: 9878
Joined: Tue Oct 29, 2002 5:28 am
Location: Seven Kings, London UK
Contact:

Re: OTF File size

Post by Bhikkhu Pesala »

If the glyphs are identical, you only need one in the font, which is mapped to both codepoints. Whether the user types A or a, they get the same glyph.
Dual Mapping.png
Dual Mapping.png (11.68 KiB) Viewed 11748 times
My FontsReviews: MainTypeFont CreatorHelpFC15 + MT12.0 @ Win 10 64-bit build 19045.2486
Daniel
Posts: 23
Joined: Wed May 07, 2014 7:13 pm

Re: OTF File size

Post by Daniel »

I see, so in this case I should use add option from paste special
addcode.png
addcode.png (14.11 KiB) Viewed 11748 times
I can apply the same technique to the composite glyph?
Bhikkhu Pesala
Top Typographer
Top Typographer
Posts: 9878
Joined: Tue Oct 29, 2002 5:28 am
Location: Seven Kings, London UK
Contact:

Re: OTF File size

Post by Bhikkhu Pesala »

Daniel wrote:I can apply the same technique to the composite glyph?
Try it and see is the best way to find out how it works.

Again, you only need one glyph mapped to both À and à. Whichever the user types, they will get the same result. You only need one composite glyph in your font instead of two. I think this will also reduce the font size slightly, though not by much since Composite glyphs are already reusing the data that describes the glyph's outline.
My FontsReviews: MainTypeFont CreatorHelpFC15 + MT12.0 @ Win 10 64-bit build 19045.2486
Daniel
Posts: 23
Joined: Wed May 07, 2014 7:13 pm

Re: OTF File size

Post by Daniel »

Thank you Bhikkhu, it worked great :)

By this technique the kerning were reduced to only 27k. I'll see if I can reduce them more but the file size of the otf it's ~200kb
One more question.
I see in the OT Designer 27k kerning pairs but exporting the otf file and inspecting the file it shows only ~5k kerning pairs. Why this large amount of lost pairs?
Bhikkhu Pesala
Top Typographer
Top Typographer
Posts: 9878
Joined: Tue Oct 29, 2002 5:28 am
Location: Seven Kings, London UK
Contact:

Re: OTF File size

Post by Bhikkhu Pesala »

Daniel wrote:One more question.
I see in the OT Designer 27k kerning pairs but exporting the otf file and inspecting the file it shows only ~5k kerning pairs. Why this large amount of lost pairs?
Maybe a lot of them are zero, or outside of the range of supported pairs. The current version of FontCreator only exports pairs in these ranges.
My FontsReviews: MainTypeFont CreatorHelpFC15 + MT12.0 @ Win 10 64-bit build 19045.2486
Daniel
Posts: 23
Joined: Wed May 07, 2014 7:13 pm

Re: OTF File size

Post by Daniel »

I don't think the range is the reason.
I did a double check with the previous large otf file and kernings that were active in that file and are in my new file also don't work anymore with my new file when used in any editing software.
Don't know how to debug this.
Post Reply