The smallest valid font for Windows

Post general font related questions (e.g. how to install, convert and use fonts) and requests (looking for fonts, designers etc.) here.
Erwin Denissen
Moderator
Moderator
Posts: 6068
Joined: Fri Oct 04, 2002 12:41 am
Location: De Bilt, The Netherlands
Contact:

The smallest valid font for Windows

Postby Erwin Denissen » Mon Feb 03, 2014 12:25 pm

Most people don't care about the size of their fonts, but sometimes there is need for a small font.

FontCreator will try to keep the file size as low as possible, so to some extent it can be used for this purpose.

To really, really, make a font with the smallest file size, it will become a font which can't be used to actually display text, as we need to make it as bare as possible but still obey all requirements as found in the TrueType/OpenType specifications.

There are several specific parts that need attention:

The font naming values
Since a font needs to have a name, we will use a single character (s for small).

A glyph with an outline
We will keep the first glyph as the .notdef glyph, and will add another glyph mapped to the hyphen character. We avoid complexity as that would only increase the font file size, so the glyph will only have a single rectangle.

No advanced features
All things that are not required will be avoided, so we will not include kerning, hinting, or OpenType layout features.

The font generated by FontCreator 7.5 contains 696 bytes:
s696.otf
(696 Bytes) Downloaded 100 times


We can even reduces the size some more by using FontCreator 6.5 as that version allows you to further fine-tune platform specific data. That font file has 552 bytes and is still valid according to Windows. This file can both be downloaded here:
s552.ttf
(552 Bytes) Downloaded 107 times


I'm sure there are some more ways to squeeze a byte or two (change the outline from a rectangle to a triangle), but 552 bytes is close to the limit for a valid Windows font. Excluding the internal OS/2 and post tables is another option, but then you end up with a legacy font which is beyond the limit in my opinion.

The main reason version 7.5 of our font editor produces slightly larger fonts, is the fact it is designed with the latest versions of the OpenType font specification in mind. However that is not the only reason. Since we continually improve our software, making it more intuitive, we also strive to simplify complex/technical parts of font design, which means you are less likely to make mistakes, and have more time to complete your fonts.
Erwin Denissen
High-Logic
Proven Font Technology

Erwin Denissen
Moderator
Moderator
Posts: 6068
Joined: Fri Oct 04, 2002 12:41 am
Location: De Bilt, The Netherlands
Contact:

Re: The smallest valid font for Windows

Postby Erwin Denissen » Mon Feb 17, 2014 10:20 am

Due to recent insights (see the discusion at the Typophile forum), I've further reduced the font file size.

As mentioned in my first post, the size can be further reduced by changing the outline from a rectangle into a triangle.

jasonc has a good point, as you can indeed save some bytes if you can store positions, (actually offsets) of coordinates in a byte instead of a short (two bytes). I therefor changed the units per em from 2048 to 64, and then rescaled the triangle so it benefits from this.

The new font file is 544 bytes.
s544b.ttf
(544 Bytes) Downloaded 85 times


This file obeys to the official standard, and will work just fine on Windows .

Again you could save an additional 110 bytes by excluding the OS/2 and post tables, but you will end up with a "legacy font" which is not guaranteed to work for the next decade.
Erwin Denissen
High-Logic
Proven Font Technology

Bhikkhu Pesala
Top Typographer
Top Typographer
Posts: 6353
Joined: Tue Oct 29, 2002 5:28 am
Location: Seven Kings, London UK
Contact:

Re: The smallest valid font for Windows

Postby Bhikkhu Pesala » Mon Feb 17, 2014 10:35 am

I am not sure what the point of all this is, but presumably you could reduce the triangle to a single node by deleting two of the nodes.
My FontsReviews: MainTypeFont CreatorHelpFC10.1 Pro + MT7.0 @ Win10

Erwin Denissen
Moderator
Moderator
Posts: 6068
Joined: Fri Oct 04, 2002 12:41 am
Location: De Bilt, The Netherlands
Contact:

Re: The smallest valid font for Windows

Postby Erwin Denissen » Mon Feb 17, 2014 11:24 am

For most people there is no use for this, so feel free to ignore this post.

Leaving just a single node would save another 4 bytes, reducing the file size to 540 byes.
s540.ttf
(540 Bytes) Downloaded 100 times


And without nodes the size would become 524 bytes, but then the font file in no longer valid according to Windows.
Erwin Denissen
High-Logic
Proven Font Technology


Return to “General Font Discussions”

Who is online

Users browsing this forum: No registered users and 2 guests