惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

阮一峰的网络日志
阮一峰的网络日志
J
Java Code Geeks
Martin Fowler
Martin Fowler
宝玉的分享
宝玉的分享
V
Visual Studio Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
M
MIT News - Artificial intelligence
U
Unit 42
博客园 - 三生石上(FineUI控件)
博客园 - 聂微东
The GitHub Blog
The GitHub Blog
I
InfoQ
WordPress大学
WordPress大学
H
Help Net Security
D
Docker
B
Blog
腾讯CDC
A
About on SuperTechFans
Recent Announcements
Recent Announcements
雷峰网
雷峰网
有赞技术团队
有赞技术团队
C
Check Point Blog
Y
Y Combinator Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC

博客园 - 马建康

liunx修改字体为宋体 OpenERP|odoo Web开发 PostgreSQL源码分析之shared buffer与磁盘文件 如何更改postgresql的最大连接数 [Ubuntu]明明白白安装中文字体 Ubuntu 所需要的中文字体美化操作步骤 Ubuntu 字体设置:使用Windows 字体 Ubuntu下中文完美解决方案 fonts.conf 中文手册 PostgreSql 合并多行记录 Ubuntu 12.04 LTS安装Windows字体 Postgresql死锁的处理 彻底解决Odoo8.0单时区应用中的时区问题 PostgreSQL中COUNT的各条件下(1亿条数据)例子 Git详解之三 Git分支 ubuntu下修改文件夹权限 Ubuntu中Nginx的安装与配置 Linux下解决 id_rsa 权限不够 Ubuntu Server 13.10 安装配置图解教程
Ubuntu 字体设置:使用Windows 字体
马建康 · 2015-08-01 · via 博客园 - 马建康

基础知识

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