[Ubuntu]flash中文顯示亂碼(方塊) 解決方法

打開終端,輸入以下命令

cd /etc/fonts/conf.d/
sudo cp 49-sansserif.conf 49-sansserif.conf_backup
sudo rm 49-sansserif.conf

以上命令的功能是先備份49-sansserif.conf文件,再刪除,經測試後有效。(來源:PenguinOL)
===============================================================================

ubuntu flash亂碼
另外如果出現flash亂碼現象,可以用以下兩條命令解決:

sudo cp /etc/fonts/conf.d/49-sansserif.conf /etc/fonts/conf.d/49-sansserif.conf.bak

sudo rm /etc/fonts/conf.d/49-sansserif.conf

對於linux下使用ff的朋友,一定要注意字體是否很合適,不合適的字體會嚴重降低ff的繪製能力,儘量不能使用壓縮的字體並且考慮使用ttf字體,推薦文泉譯正黑字體http://wenq.org/?ZenHei


打開終端,執行:
cd /etc/fonts/conf.d/

爲了安全,備份一下字體配置文件
sudo cp 49-sansserif.conf 49-sansserif.conf_backup

root身份打開:
sudo gedit ./49-sansserif.conf

此時文件顯示的內容如下:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!--
If the font still has no generic name, add sans-serif
-->
<match target="pattern">
<test qual="all" name="family" compare="not_eq">
<string>sans-serif</string>
</test>
<test qual="all" name="family" compare="not_eq">
<string>serif</string>
</test>
<test qual="all" name="family" compare="not_eq">
<string>monospace</string>
</test>
<edit name="family" mode="append_last">
<string>sans-serif</string>
</edit>
</match>
</fontconfig>

如上所示,將其中的第1、2、4個<string>後面的sans-serif或者serif用你自己系統中支持中文的字體的名字代替,注意字體名字的大小寫
比如:我的系統中安裝了wqy-zenhei.ttf,我則用wqy-zenhei代替上述所說的字段:
我的系統修改後的文件如下所示(注意:個人根據自己的實際情況修改)

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!--
If the font still has no generic name, add sans-serif
-->
<match target="pattern">
<test qual="all" name="family" compare="not_eq">
<string>wqy-zenhei</string>
</test>
<test qual="all" name="family" compare="not_eq">
<string>wqy-zenhei</string>
</test>
<test qual="all" name="family" compare="not_eq">
<string>monospace</string>
</test>
<edit name="family" mode="append_last">
<string>wqy-zenhei</string>
</edit>
</match>
</fontconfig>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章