Take the 2-minute tour ×
Graphic Design Stack Exchange is a question and answer site for Graphic Design professionals, students, and enthusiasts. It's 100% free, no registration required.

I have a Chinese font file, the size of the file is 7.693 MB. Due to the size of the ttf file, the site loads only slowly.

Is there any way to reduce the size of the .ttf font?

share|improve this question
    
There's an identical question on the stackoverflow site. Hopefully this helps. stackoverflow.com/questions/2635423/… –  dinesh Nov 17 '12 at 10:16
    
Is that the norm for a Chinese typeface file? I know they have many more glyphs than a roman alphabet typeface, but that still seems excessive file-size-wise. Is this a reputable font or something grabbed from a free font site? If the latter, it may be simply a poorly built font file with way too many extraneous points in each glyph. –  DA01 Apr 21 at 1:04
    
@DA01: It's fairly normal. They're all around 7~12MB, at least. You can't store 20,000+ (in some extreme cases up to 200,000) hinted glyphs without exceeding 6MB. Here are some other common Chinese fonts that you can use as comparisons. Most are between 20K to 40K characters. This is one of the major drawbacks to ideogram-based languages (multi-byte characters, way too many glyphs, large font sizes, no standard ordering...). –  Lèse majesté Apr 21 at 2:16
    
Instead of trying to modify an existing font (almost always a bad idea, unless you're the font author), I would just avoid using webfonts with Chinese. Instead, use standard Chinese system fonts that are already installed on most computers: kendraschaefer.com/2012/06/… en.wikipedia.org/wiki/List_of_CJK_fonts#Ming –  Lèse majesté Apr 21 at 2:30
    
@Lèsemajesté good to know! Interesting stuff. –  DA01 Apr 21 at 3:41
add comment

2 Answers 2

There are a few ways to reduce the size of a TTF file, but most of them require that you know the consequences, since they are lossy.

  • Firstly, you can subset the font, which means to remove any glyphs (character images) that you don't need. If you have a font that covers several languages and you only need to support one language, then this can be for you. Or, if it has a lot of additional symbols and punctuation that you know you're not going to need, this is what you can do.

    There are various services that can do this on a semi-automated basis, the most famous being the fontsquirrel @font-face generator (in expert mode, under custom subsetting). Unfortunately, this doesn't seem to have pre-defined ranges for Chinese characters so this seems like it may not be very easy for you. Or you can do so in your favourite font editor eg. FontForge.

  • Secondly, you can simplify the glyph in the font. Glyphs in a font are vector images, which consist of many line segments with control points where there are curves. You can often remove a lot of vertexes and control points while still somewhat preserving the overall shape. This has the effect of "simplifying" the curves. They lose accuracy, but they also reduce in file size.

  • Thirdly, you can remove some metadata from the font that you know you don't need. Given the font is over 7MB, I highly doubt that metadata is playing much into it here. Also, this is somewhat of an expert option.

  • And lastly, compressing the font using a lossless compression, for example from TTF to WOFF and/or EOT. There are still some browsers out that that don't support WOFF or EOT fonts so you may need to fall back to TTF for those.

It's important that you understand that doing any of the above to the font (apart from the last one) has consequences in how well the font works or how many languages it supports properly, so you need to do a lot of testing.

One final important point is that by doing any of the above to the font (including, surprisingly, simply converting it to WOFF or EOT), you are legally creating a derivative work, for which you specifically need a license to do so from the font's author. Most commercial fonts probably won't let you create derivative works. A notable exception is an open license like the SIL OFL which specifically permits derivative works (if you change the name of the font).

share|improve this answer
add comment

I don't know if you speak Chinese or not, but in case you know what you are doing, you could subset the font and reduce it to the 3000-4000 most used glyphs. This should be enough to render most standard Chinese texts and could significantly reduce the file size (a Chinese font might come with over 20,000 glyphs). Do this only in case you master Chinese at least on an intermediate level or have someone who could help you identifying the subset of glyphs required for your purpose.

Here's a frequency list for the characters used in Mainland China. Unfortunately it is somewhat outdated (2004). It only contains 3500 characters, use it with caution. (the Xinhua Zidian lists approx. 10,000 characters and it is the most common character dictionary you will encounter in China). Given names might have any character, so a 3500 glyph subset will only cover the everyday language. Again, this is only for Mainland China. Taiwan and some overseas communities use other characters (the traditional ones). If you are not a Chinese speaker, you will need someone with expertise on this.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.