个人工具

Firefox 字体

来自Ubuntu中文

Abing讨论 | 贡献2008年10月9日 (四) 09:57的版本

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

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: dejavu sans mono, wenquanyi bitmap song !important;
}


Note:英文采用“dejavu sans mono”字体,中文“wenquanyi bitmap song",都要根据个人系统设定。正确的字体名称很重要。在文件浏览器(例如nautilus,ctrl+L,调出路径)中输入 fonts://,查看字体属性,name 一栏的就是。或者执行 xlsfonts,再 grep 过滤关键字。

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

userContent.css

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

* {
  font-size: 9pt !important;
  font-family: dejavu sans mono, wenquanyi bitmap song !important;
}


Note:同上。

重启 Firefox,检验效果。

提示

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

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

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