Limit characterset of a Webfont?

*爱你&永不变心* 提交于 2019-12-11 11:04:29

问题


I wonder if it is possible to limit the characterset of an embedded webfont?

E.g. "Typekit" has an option in its "Kit Editor" where you can choose between All Characters or Default.

However in my case I don't use Typekit but a normal embedded webfont. The fontfiles are rather big due to the large amounts of characters.

Is there some "meta-tag" or "attribute" for the @font-face call to limit the charcterset to let's say "Latin-1"?

Thank you in advance, Matt


回答1:


@font-face simply tells the browser to use the font definition file(s) you provide, and it will download the whole thing. If the font file(s) are too big because they contain glyphs you don't actually use, you need to reduce the size of the definition files by removing (or rather, not including) glyphs. The web-font creation software I've used allows you to specify which characters are to be included.

Even if there were a way to tell the browser "Only use Latin-1" it would still have to download the whole file in order to throw part of it away.

[Note that if you subsequently call for a glyph you have omitted, your users will see a square, or question-mark-in-a-diamond. Been there, done that!]




回答2:


The Font Squirrel Font-Face Generator has a subsetting feature. Fully customizable if you use the Expert settings. http://www.fontsquirrel.com/fontface/generator



来源:https://stackoverflow.com/questions/10732372/limit-characterset-of-a-webfont

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!