个人工具

Firefox 字体

来自Ubuntu中文

ABiNg讨论 | 贡献2007年11月12日 (一) 13:53的版本 (新页面: =Firefox程序的中文配置= 本文作者:aBiNg '''声明:本文更适用于,在Firefox首选项中无法设定中文字体的情况!''' 依据:firefox官方doc Much of Moz...)

(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航, 搜索

Firefox程序的中文配置

本文作者:aBiNg

声明:本文更适用于,在Firefox首选项中无法设定中文字体的情况!

依据:firefox官方doc

Much of Mozilla's fonts and colors are controlled via CSS (Cascading Style Sheets).
These are set in .css files in Mozilla's chrome directories, but the user can override them with two plain text files, called userContent.css and userChrome.css.

建立*.css文件

cd ~/.mozilla/firefox/*.default/chrome
cp userChrome-example.css userChrome.css
cp userContent-example.css userContent.css

写入配置

userChrome.css

将下面这段代码加入到userChrome.css文件后面:

* {
  font-size: 9pt !important;
  font-family: 微软雅黑 !important;
}

Note:那“微软雅黑"是自己设定的。正确的字体名称很重要。在文件浏览器(例如nautilus,ctrl+L,调出路径)中输入fonts://,查看字体属性,name一栏的就是。

上面代码中的通配符(*),包括了bookmarks和tabs字体。

userContent.css

将下面这段代码加入到userChrome.css文件后面:

* {
  font-size: 9pt !important;
  font-family: 微软雅黑 !important;
}

Note:同上。

重启Firefox,检验效果。

提示

1)浏览器的preferences中的fonts类型设置,默认就行。请允许页面选择自己的字体,这也是默认的。调整好最小字体大小。

2)1024x768的dpi(gnome的在字体设置的details里面),最好设置为90左右。gnome程序界面字体大小,请自行调整。别的分辨率的dpi,请google。

3)通配符未免一棒打死,失去了页面的多样性。深入些的,请查看官方css自定义帮助