認識點陣字型 Bitmap Font
點陣字型該如何取得? ttf2bdf - TrueType to BDF font converter
在 MS-DOS 時代字型是點陣的,現在要找倚天中文軟體取出字型檔有點不現實,比較快、方便的作法是將 TTF True Type Font 字型作轉換。
ttf2bdf 指令使用說明
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
Usage: ttf2bdf [options below] font.ttf -h This message. -v Print warning messages during conversion. -l "subset" Specify a subset of glyphs to generate. -m mapfile Glyph reencoding file. -n Turn off glyph hinting. -c c Set the character spacing (default: from font). -f name Set the foundry name (default: freetype). -t name Set the typeface name (default: from font). -w name Set the weight name (default: Medium). -s name Set the slant name (default: R). -k name Set the width name (default: Normal). -d name Set the additional style name (default: empty). -u char Set the character to replace '-' in names (default: space). -pid id Set the platform ID for encoding (default: 3). -eid id Set the encoding ID for encoding (default: 1). -p n Set the point size (default: 12pt). -r n Set the horizontal and vertical resolution (default: 100dpi). -rh n Set the horizontal resolution (default: 100dpi) -rv n Set the vertical resolution (default: 100dpi) -o outfile Set the output filename (default: stdout). |
ttf2bdf 指令使用範例
1 |
ttf2bdf -p 16 KMIN00M.ttf -o output.bdf |
output.bdf 點陣字型檔案內單一字元
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
STARTCHAR 2460 ENCODING 9312 SWIDTH 990 0 DWIDTH 22 0 BBX 22 21 0 -2 BITMAP 00FC00 030300 0C00C0 100020 201010 20F010 403008 403008 803008 803004 803004 803004 803008 403008 403008 20FC10 200010 100020 080040 060180 01FE00 ENDCHAR |
- BITMAP 下一行開始就是字型點陣資料,一直到 ENDCHAR 結束,字型間寬度、高度不一定相同
- 上面這個點陣字是圓圈一,程式運作結果如下,小圖是一比一實際大小,大圖放大了十倍。
直接將十六進制轉換成二進制就可以看出點陣圖形輪廓了,如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
0000000011111100000000000000 0000001100000011000000000000 0000110000000000110000000000 0001000000000000001000000000 0010000000010000000100000000 0010000011110000000100000000 0100000000110000000010000000 0100000000110000000010000000 1000000000110000000010000000 1000000000110000000001000000 1000000000110000000001000000 1000000000110000000001000000 1000000000110000000010000000 0100000000110000000010000000 0100000000110000000010000000 0010000011111100000100000000 0010000000000000000100000000 0001000000000000001000000000 0000100000000000010000000000 0000011000000001100000000000 0000000111111110000000000000 0000000000000000000000000000 |
參考資源
BDF 字体文件格式 - renjwjx的专栏 - 52RD博客_52RD.com (本機備份)
必備 Chortkeh BDF Font Viewer (本機備份),可以讀取 .bdf Bitmap 點陣字型檔案。
4,610 total views, 1 views today