有關字體的一點參考:
TTC和TTF的解釋:
TTC:TrueType Collection file. A scheme where multiple TrueType fonts can be stored in a single file, typically used when only a subset of glyphs changes among different designs. They're used in Japanese fonts, where the Kana glyphs change but the Kanji remain the same.
TTF:The recommended file extension for TrueType font files on the PC. On the Macintosh, exactly the same data is in an *'sfnt' resource. The recommended file extension for the TrueType flavour of *OpenType fonts is also TTF. (But Type 1 flavour OpenType fonts should have an OTF extension.)
所以我個人認為TTF才是一個將一種字體定義好的文件格式,它里面應該包括每個字的寫法。而TTC是一個鏈接容器,可能只有部分字體的寫法,其他的字體是從別的TTF中鏈接過來的。
ttc 是TrueType的集合,可能會在一個ttc文件中包含多個type 接口。可以用FontLab, 或者 breakttc.exe 將一個ttc文件分離成多個ttf文件。
因此,TTC是幾個TTF合成的字庫,安裝后字體列表中會看到兩個以上的字體。兩個字體中大部分字都一樣時,可以將兩種字體做成一個TTC文件,現在常見的TTC中的不同字體,漢字一般沒有差別,只是英文符號的寬度不一樣,以便適應不同的版面要求。
我想說的以后的TTC字庫可能就是一個發展趨勢,因為它很有優越行,任何字體可以合成TTC字庫的
生成字形位圖后,我們要將字形位圖轉換為我們自己的圖形數據,生成最接近位圖大小的2的冪次方位圖

/**////This function gets the first power of 2 >= the
///int that we pass it.
inline int next_p2 ( int a )


{
int rval=1;
while(rval<a) rval<<=1;
return rval;
}
位圖數據轉換為RGBA格式,RGB分別給0xFF而不是別的顏色,因為這樣的話就可以在外界傳入字體顏色 任何傳入字體顏色&0xFF = 字體顏色
alpha數據,我們就傳入字形位圖的數據(里面包含著FreeType生成的反鋸齒位圖的alpha數據)參考:
http://freetype.sourceforge.net/freetype2/docs/tutorial/step1.html 官方教學
http://www.linuxforum.net/forum/showflat.php?Board=kylix&Number=592188 對應的中文翻譯
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=43
posted on 2010-09-10 18:28
風輕云淡 閱讀(1691)
評論(0) 編輯 收藏 引用 所屬分類:
GameDevelop