OTF File size
OTF File size
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
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
-
- Top Typographer
- Posts: 9878
- Joined: Tue Oct 29, 2002 5:28 am
- Location: Seven Kings, London UK
- Contact:
Re: OTF File size
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.
These are my results:
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.
These are my results:
- No glyph names, no kerning tables, no hinting: 68 Kbytes
- No Glyph Names, GPOS kerning table, Autohinting: 161 Kbytes
- Glyph Names, GPOS kerning table, No hinting: 137 Kbytes
- Glyph Names, GPOS kerning table, Autohinting: 169 Kbytes
- Glyph Names, GPOS kerning table, Legacy kern table, Autohinting: 253 Kbytes
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.
Re: OTF File size
Thank you for your reply.
I've used FC 8 with kerning groups.
Here's how it looks like the grouping and kernings
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.
-
- Top Typographer
- Posts: 9878
- Joined: Tue Oct 29, 2002 5:28 am
- Location: Seven Kings, London UK
- Contact:
Re: OTF File size
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.
The only thing that will reduce the font file size is reducing the number of kerning pairs. You have some large groups.
Re: OTF File size
Here it is
Thank you
All I did was to include in groups all the diacritics (composite glyph)
Thank you
All I did was to include in groups all the diacritics (composite glyph)
- Attachments
-
- FC_Help.zip
- zip file
- (3.17 KiB) Downloaded 320 times
-
- Top Typographer
- Posts: 9878
- Joined: Tue Oct 29, 2002 5:28 am
- Location: Seven Kings, London UK
- Contact:
Re: OTF File size
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.
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.
Re: OTF File size
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
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
-
- Top Typographer
- Posts: 9878
- Joined: Tue Oct 29, 2002 5:28 am
- Location: Seven Kings, London UK
- Contact:
Re: OTF File size
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
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
Re: OTF File size
what do you mean by
This way lowercase disappear"copying the codepoints from lowercase to uppercase — copy, paste special. override codepoints."
-
- Top Typographer
- Posts: 9878
- Joined: Tue Oct 29, 2002 5:28 am
- Location: Seven Kings, London UK
- Contact:
Re: OTF File size
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.
Re: OTF File size
I see, so in this case I should use add option from paste special
I can apply the same technique to the composite glyph?-
- Top Typographer
- Posts: 9878
- Joined: Tue Oct 29, 2002 5:28 am
- Location: Seven Kings, London UK
- Contact:
Re: OTF File size
Try it and see is the best way to find out how it works.Daniel wrote:I can apply the same technique to the composite glyph?
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.
Re: OTF File size
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?
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?
-
- Top Typographer
- Posts: 9878
- Joined: Tue Oct 29, 2002 5:28 am
- Location: Seven Kings, London UK
- Contact:
Re: OTF File size
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.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?
Re: OTF File size
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.
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.