由 訪客 » 週六 4月 16, 2005 2:58 pm
我用 strace 跑了 firefox,發現在開 flash 時會去這幾個地方找字型:
strace firefox 2>&1 | grep font
...............................................................................
open("/usr/lib/X11/fonts/misc//fonts.dir", O_RDONLY) = 41
open("/usr/lib/X11/fonts/cyrillic//fonts.dir", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/X11/fonts/Type1//fonts.dir", O_RDONLY) = 41
open("/usr/lib/X11/fonts/CID/fonts.dir", O_RDONLY) = 41
open("/usr/lib/X11/fonts/Speedo//fonts.dir", O_RDONLY) = 41
read(41, "24\nfont0648.spd -bitstream-chart"..., 4096) = 1689
open("/usr/lib/X11/fonts/100dpi//fonts.dir", O_RDONLY) = 41
open("/usr/lib/X11/fonts/75dpi//fonts.dir", O_RDONLY) = 41
本來我並沒有 /usr/lib/X11/fonts/CID 這個目錄,所以我自己加了:
ln -sf /var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType /usr/lib/X11/fonts/CID
於是 flash 就可以找到我的字型了:
...............................................................................
stat64("/usr/lib/X11/fonts/CID/bkai00mp.ttf", {st_mode=S_IFREG|0644, st_size=10417860, ...}) = 0
open("/usr/lib/X11/fonts/CID/bkai00mp.ttf", O_RDONLY) = 40
而且 locale 不用設也可以正確顯示。