gembin

OSGi, Eclipse Equinox, ECF, Virgo, Gemini, Apache Felix, Karaf, Aires, Camel, Eclipse RCP

HBase, Hadoop, ZooKeeper, Cassandra

Flex4, AS3, Swiz framework, GraniteDS, BlazeDS etc.

There is nothing that software can't fix. Unfortunately, there is also nothing that software can't completely fuck up. That gap is called talent.

About Me

 

Excluding font outlines in Flex can shave off over 200kb!

Often when you need to embed a font you also need to include ‘bold’ and sometimes ‘italic’ styles. Sometimes you need more than one fontFamily. Flex by default will embed all glyphs of a fontFamily. Embedding every glyph if generally unnecessary. By restricting the character set (’unicode-range’) you can shave off between 50-100kb or more per font style (FontFamilies have varying amounts of glyphs and obviously varying complexities of outlines which effects how much you can save). Anyway by setting unicode-range for fonts we managed to shave 300kb off our application, I wasn’t expecting it to be so much so thought worth a blog ;)

@font-face {
src: url("assets/Arial.ttf");
fontFamily: Arial;
advancedAntiAliasing: true;
unicode-range: U+0030-U+0039, /* 0-9 */
U+0041-U+005A, /* Uppercase A-Z */
U+0061-U+007A, /* Lowercase a-z */
U+0021-U+002F, /* !"#$%&'()*+,-./ */
U+003A-U+0040, /* :;<=>?@ */
U+005B-U+0060, /* [\]^_ */
U+00A3-U+00A3, /* £ */
U+00A9-U+00A9, /* © */
U+00AE-U+00AE /* ® */
/* U+00BF-U+0259 FOREIGN CHRS */
}
Further reading:
http://livedocs.adobe.com/flex/3/html/help.html?content=fonts_07.html

if anyone knows of other ranges you think can be generally useful please let me know ;)

posted on 2008-09-18 13:50 gembin 阅读(268) 评论(0)  编辑  收藏 所属分类: Flex


只有注册用户登录后才能发表评论。


网站导航:
 

导航

统计

常用链接

留言簿(6)

随笔分类(440)

随笔档案(378)

文章档案(6)

新闻档案(1)

相册

收藏夹(9)

Adobe

Android

AS3

Blog-Links

Build

Design Pattern

Eclipse

Favorite Links

Flickr

Game Dev

HBase

Identity Management

IT resources

JEE

Language

OpenID

OSGi

SOA

Version Control

最新随笔

搜索

积分与排名

最新评论

阅读排行榜

评论排行榜

free counters