Is there any way to reduce the size of the .ttf fonts? i.e. if we want to remove some glyps which we are not using.
相关问题
- how to Enumerate local fonts in silverlight 4
- Scaling png font down
- GD error while try load font
- Rails 4 - Custom Fonts
- Underline is drawn outside of rectangle reported b
With Google Web Fonts, you can limit the character set like:
This would be particularly useful if Google had icon fonts like Font Awesome
You can use fontforge to reduce the file size
This is explained at http://www.cnx-software.com/2010/02/19/reducing-truetype-font-file-size-for-embedded-systems/
FontSquirrel's Webfont generator makes it very easy to reduce a font's filesize.
I was able to take a 263kb font down to 34kb.
What is the application for this? Most fonts are relatively lightweight. TTFs store vector data instead of bitmap data, so it takes relatively few bytes to describe the shape of each glyph. Even very busy fonts can be kept below 100kb. Many modern fonts come with ClearType hinting, but even this adds very little file size.
If you really want to take certain glyphs out of a font, then you will need a font editing tool (Macromedia had one called Fontographer that is now owned by FontLab). But you're probably better off just picking a lighter font. For example,
OCR A Std
is only 30kb and includes ClearType hinting as well as all US ASCII characters. Try to avoid Unicode fonts since full Unicode support requires a ton of glyphs. But most fonts don't offer full Unicode support.Lastly, if you do decide to modify a font, make sure you name it something else. A naming conflict could result in some really annoying surprises for users.
I was using fontmin to remove glyph from ttf fonts.
It succeeded to reduce Noto Sans (weight=medium) from 20MB to less than 10, yet still cover common Chinese/Japanese characters.
I did the following to remove all Cyrillic glyphs (letters) from a font, hence cutting file size in half as I only needed the Latin letters.
Please consider that I am not a pro in this. But I needed a fast solution.
Here you can read more on this topic: http://wiki.unity3d.com/index.php?title=Create_a_new_TrueType_font_using_a_subset_of_characters_from_an_existing_TrueType_font