你好,游客 登录 注册 搜索
背景:
阅读新闻

Ubuntu 字体设置:使用Windows 字体

[日期:2014-08-16] 来源:Linux社区  作者:dy200811 [字体: ]

Ubuntu 字体设置:使用Windows 字体

基础知识

Sans-serif=无衬线体=黑体:并不是具体一款字体,而是一类字体,选择它其实等于选择这类字体中优先级最高的那款字体。

Serif=衬线体=白体:同上

Monospace=等宽字体,意思是字符宽度相同:同上

点阵字体=位图字体

无衬线体更适合电脑屏幕阅读,衬线体适合打印。——因为衬线可以使得人视线平齐于一行。也就是说不会读破行。

中文显示时有不同的方式,一方面因为中文本身拥有的横和同高度就可以导致这种平齐。行距对中文更重要。

1. 安装字体

sudo apt-get install ttf-mscorefonts-installer #微软字体
sudo apt-get install xfonts-wqy  #文泉驿-点阵宋体
cd ~
wget http://www.stchman.com/tools/MS_fonts/tahoma.zip #Tahoma 字体
sudo unzip -d /usr/share/fonts/truetype/msttcorefonts ~/tahoma.zip
sudo fc-cache -f -v
rm -f ~/tahoma.zip
fc-cache -f -s -v  #刷新字体缓存

2. 进入 “Advanced settings" 设置(如果没有安装,执行 sudo apt-get install gnome-tweak-tool)

如下设置:

Ubuntu 字体设置:使用Windows 字体

3. 配置:

注意使用文泉驿的视觉习惯工具把网页上的英文和中文字体都调整清晰, 点 Create, 按说明保存好。

本人调的是 Tahoma 第一位,wenquanyi  bitmap 第二位, 这样英文和中文都没问题。

Linux字体

字体文件存放路径

/usr/share/fonts/  #系统字体,需要root权限才能操作

~/.fonts #用户字体,随便怎么搞,推荐

配置文件路径

/etc/fonts/fonts.conf #系统配置文件,需要root权限才能操作,对需要输入root密码的程序有效

~/.fonts.conf #用户配置文件,随便怎么搞,只对当前用户运行的程序有效

命令

fc-cache -fv #通常复制字体进~/.fonts就会自动刷新字体,如果没有,用这个命令,如果复制进的是/usr/share/fonts/,用sudo fc-cache -fv

fc-match sans-serif #抓取当前用户sans-serif类字体优先级最高的那款字体

fc-match serif #抓取当前用户serif类字体优先级最高的那款字体

fc-match monospace #抓取当前用户monospace类字体优先级最高的那款字体

4. 上一步配置对 Firefox 和 Thunderbird 无效, 再设置 ~/.fonts.conf, 在 <fontconfig> 中加入:

    <match target="font">
        <edit mode="assign" name="autohint">
            <bool>false</bool>
        </edit>
    </match>
    <match target="font">
        <edit mode="assign" name="hinting">
            <bool>true</bool>
        </edit>
    </match>
    <match target="font">
        <edit mode="assign" name="hintstyle">
            <const>hintfull</const>
        </edit>
    </match>
    <match target="font">
        <edit mode="assign" name="antialias">
            <bool>false</bool>
        </edit>
    </match>
<!-- 大字体的时候启用抗锯齿 -->
<match target="font" >
    <test name="size" qual="any" compare="more">
        <double>12</double>
    </test>
    <edit name="antialias" mode="assign">
        <bool>true</bool>
    </edit>
</match>
<match target="font" >
    <test name="pixelsize" qual="any" compare="more">
        <double>16</double>
    </test>
    <edit name="antialias" mode="assign">
        <bool>true</bool>
    </edit>
</match>

5. 登出 或 重启系统 就可看到完整的效果(由于图片受到压缩,请在图片上点右键,在新窗口中查看)

Ubuntu 字体设置:使用Windows 字体

更多Ubuntu相关信息见Ubuntu 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=2

本文永久更新链接地址http://www.linuxidc.com/Linux/2014-08/105640.htm

linux
相关资讯       ubuntu字体  Ubuntu字体设置 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款