看板 FreeBSD 關於我們 聯絡資訊
※ 引述《statue (statue)》之銘言: > chinese/moefonts-cid 只有基本的字體,看過 gs-cjk 的作法後, > 幫 moefonts-dir 增加粗體,斜體,粗斜體支援,由於還在測試所以先放 > outta-port,幫忙看看有沒有問題吧 :) > # cd /usr/ports/outta-port/moefonts-cid > # make install > # gv work/moefonts-cid-1.0/cid.ps > snapshot: http://freebsd.sinica.edu.tw/~statue/snapshot/moefonts-cid.png
如果對列印的部分有興趣可以參考 現在的中文列印 http://freebsd.sinica.edu.tw/~statue/index.php?file=20020527 kde2 中文列印 http://freebsd.sinica.edu.tw/~statue/index.php?file=20020614 CID-keyed http://freebsd.sinica.edu.tw/~statue/zh-tut/cidps.html chinese/ghostscript6 已經不需要了,經由 gs-cjk 的整合,現在已經是 print/ghostscript-gnu 內建的一部分了,而 outta-port/ghostscript-gnu-zhfont 也已經可以由 chinese/ttfm 的 gs-cjk 模組來產生了。 以 MOESung-Regular 為例子 從 adobe 網站可以抓到 40pt 的 MOESung-Regular 檔案,這是 CIDFont, 所以必須額外安裝 adobe-cmaps 來搭配,所以會 DEPENDS print/adobe-cmaps。 再來是建立粗體,斜體,粗斜體等,在看完 ttfm 的 gs-cjk 模組後, 有個想法就是 gs-cjk 的做法是在 ttf 上面建立粗體,斜體,粗斜體等, 這些做法是不是應該也適用於 moefonts-cid? 因此就建立了 MOESung-Regular-Bold === ---< === %!PS-Adobe-3.0 Resource-CIDFont %%BeginResource: CIDFont (MOESung-Regular-Bold) /MOESung-Regular-Bold /MOESung-Regular /CIDFont findresource 16 dict begin /basecidfont exch def /basefont-H /.basefont-H /Identity-H [ basecidfont ] composefont def /basefont-V /.basefont-V /Identity-V [ basecidfont ] composefont def /CIDFontName dup basecidfont exch get def /CIDFontType 1 def /CIDSystemInfo dup basecidfont exch get def /FontInfo dup basecidfont exch get def /FontMatrix [ 1 0 0 1 0 0 ] def /FontBBox [ basecidfont /FontBBox get cvx exec 4 2 roll basecidfont /FontMatrix get transform 4 2 roll basecidfont /FontMatrix get transform ] def /cid 2 string def /BuildGlyph { gsave exch begin dup 256 idiv cid exch 0 exch put 256 mod cid exch 1 exch put rootfont /WMode known { rootfont /WMode get 1 eq } { false } ifelse { basefont-V } { basefont-H } ifelse setfont .03 setlinewidth 1 setlinejoin newpath 0 0 moveto cid false charpath stroke 0 0 moveto cid show currentpoint setcharwidth end grestore } bind def currentdict end /CIDFont defineresource pop %%EndResource %%EOF === >--- === 以及 MOESung-Regular-Bold-ETen-B5-H.gsf === ---< === /MOESung-Regular-Bold-ETen-B5-H /MOESung-Regular-Bold (MOESung-Regular-Bold) /ETen-B5-H (CMap/ETen-B5-H) 1 index /CMap resourcestatus {pop pop pop} {runlibfile} ifelse /CMap findresource 3 1 roll 1 index /CIDFont resourcestatus {pop pop pop} {runlibfile} ifelse /CIDFont findresource [ exch ] composefont pop === >--- === 結果發現在測試檔 cid.ps === ---< === /MOESung-Regular-ETen-B5-H findfont 30 scalefont setfont 50 600 moveto (2000年5月29日) show /MOESung-Regular-Bold-ETen-B5-H findfont 30 scalefont setfont 50 560 moveto (2000年5月29日) show /MOESung-Regular-Italic-ETen-B5-H findfont 30 scalefont setfont 50 520 moveto (2000年5月29日) show /MOESung-Regular-BoldItalic-ETen-B5-H findfont 30 scalefont setfont 50 480 moveto (2000年5月29日) show /MOEKai-Regular-ETen-B5-H findfont 30 scalefont setfont 50 440 moveto (2000年5月29日) show /MOEKai-Regular-Bold-ETen-B5-H findfont 30 scalefont setfont 50 400 moveto (2000年5月29日) show /MOEKai-Regular-Italic-ETen-B5-H findfont 30 scalefont setfont 50 360 moveto (2000年5月29日) show /MOEKai-Regular-BoldItalic-ETen-B5-H findfont 30 scalefont setfont 50 320 moveto (2000年5月29日) show showpage quit === >--- === 粗體的部分出現了預期的效果,所以就繼續製作斜體與粗斜體, 這部分可以參考 斜體:MOESung-Regular-Italic 粗斜體:MOESung-Regular-BoldItalic 最後,記得把這些 .gsf 寫入 /usr/local/share/ghostscript/7.05/lib/Fontmap.GS 寫法是:字型 (字型.gsf) === ---< === /MOESung-Regular-ETen-B5-H (MOESung-Regular-ETen-B5-H.gsf) ; /MOESung-Regular-Bold-ETen-B5-H (MOESung-Regular-Bold-ETen-B5-H.gsf) ; /MOESung-Regular-BoldItalic-ETen-B5-H (MOESung-Regular-BoldItalic-ETen-B5-H.gsf) ; /MOESung-Regular-Italic-ETen-B5-H (MOESung-Regular-Italic-ETen-B5-H.gsf) ; === >--- === 最後修改一下 -H 成 -V 再重複上面的過程即可, 其他的字型也是幾乎一樣的做法就可以完工了, 不過,真的比不上用 ttf 做出來的呀 :p 如此建立完,就會有一堆可用的 CID-keyed 字型 MOESung-Regular-ETen-B5-H MOESung-Regular-Bold-ETen-B5-H MOESung-Regular-BoldItalic-ETen-B5-H MOESung-Regular-Italic-ETen-B5-H 這樣子在配合文書軟體上,應該會更好,我想文書軟體慢慢的也會把列印的部分用 gs 所提供的字型來模擬,像是 editors/Abiword 就是個很棒的例子, 而 kde2 則是自己做粗體,斜體等的模擬,不過我還沒去測試到粗體和斜體的部分, 等有空閒了再去試試... 另外,想徵求人來做 FreeBSD Chinese HOWTO 的維護,當時間越來越少的時候, 很怕這份文件會爛掉 :Q -- ※ Origin: SayYA 資訊站 <bbs.sayya.org> ◆ From: u8-177.u203-204.giga.net.tw