gutsy 下雅黑字体美化
- dogfox
- 论坛版主
- 帖子: 5311
- 注册时间: 2006-09-02 14:18
- 来自: 汉桑城
- 联系:
gutsy 下雅黑字体美化
基本技巧
字体安装的方法是通用的,不仅可以使用它来安装雅黑,也可以安装其他字体
下载相关字体引擎(现在官方源里已经有了,可以直接安装)
sudo apt-get install libxft2 libxft-dev libfreetype6 libfreetype6-dev libcairo2-dev
建立文件夹,移动字体到该文件夹下
sudo mkdir /usr/share/fonts/truetype/ttf-yahei # 当然你也可以直接在/usr/share/fonts下建立
sudo cp *.ttf /usr/share/fonts/truetype/ttf-yahei #*.ttf为你想安装的任意字体
刷新缓存
sudo chmod 755 /usr/share/fonts/truetype/ttf-yahei/*
cd /usr/share/fonts/truetype/ttf-yahei
sudo mkfontscale && sudo mkfontdir && sudo fc-cache -fv
经过以上几步就可以在你的任一应用程序字体选项里找到该字体了
进一步的微调
修改/etc/fonts/language-selector.conf
具体修改方法参见以上2个ubuntu版本
修改/etc/fonts/fonts.conf
将字体路径修改为(也即将雅黑字体路径提前)
<!-- Font directory list -->
<dir>/usr/share/fonts/yahei</dir>
<dir>/usr/share/fonts</dir>
<dir>/usr/share/X11/fonts</dir> <dir>/usr/local/share/fonts</dir>
<dir>~/.fonts</dir>
说明:如果你只是将字体放在~/.fonts下,那么就应相应的提升~/.fonts的位置。这样做的目的是让fontconfig优先从该字体文件夹路径提取字体
修改系统默认字体
系统默认字体是文鼎字体
sudo gedit /etc/fonts/conf.d/ttf-arphic-ukai
分别把AR PL ZenKai Uni和AR PL ShanHeiSun Uni替换为sans和sans-serif
sudo gedit /etc/fonts/conf.d/ttf-arphic-uming
分别把AR PL ZenKai Uni和AR PL ShanHeiSun Uni替换为sans和sans-serif
这样做的目的是
在/etc/fonts/language-selector.conf具有优先权的字体替换sans等字体
那么在这里,直接打上sans,就是间接引用/etc/fonts/language-selector.conf里优先权字体,从而达到替换的目的
在7.10的/etc/fonts/conf.d/里比上一个版本7.04多了一个CJK_aliases文件
修改此文件sudo gedit /etc/fonts/conf.d/CJK_aliases
在此文件的
<!-- Aliases for Simplified Chinese Windows fonts -->
<alias>
下添加 <family>你安装的雅黑字体</family>
例如
<family>Microsoft YaHei</family>
保存并关闭
很明显在/etc/fonts/conf.d/下CJK_aliases是“主管”中日韩字体的“首领”
而language-selector.conf直接引用的优先字体美化方式就是它了
至于浏览器字体美化可参考forum里更多方法
字体安装的方法是通用的,不仅可以使用它来安装雅黑,也可以安装其他字体
下载相关字体引擎(现在官方源里已经有了,可以直接安装)
sudo apt-get install libxft2 libxft-dev libfreetype6 libfreetype6-dev libcairo2-dev
建立文件夹,移动字体到该文件夹下
sudo mkdir /usr/share/fonts/truetype/ttf-yahei # 当然你也可以直接在/usr/share/fonts下建立
sudo cp *.ttf /usr/share/fonts/truetype/ttf-yahei #*.ttf为你想安装的任意字体
刷新缓存
sudo chmod 755 /usr/share/fonts/truetype/ttf-yahei/*
cd /usr/share/fonts/truetype/ttf-yahei
sudo mkfontscale && sudo mkfontdir && sudo fc-cache -fv
经过以上几步就可以在你的任一应用程序字体选项里找到该字体了
进一步的微调
修改/etc/fonts/language-selector.conf
具体修改方法参见以上2个ubuntu版本
修改/etc/fonts/fonts.conf
将字体路径修改为(也即将雅黑字体路径提前)
<!-- Font directory list -->
<dir>/usr/share/fonts/yahei</dir>
<dir>/usr/share/fonts</dir>
<dir>/usr/share/X11/fonts</dir> <dir>/usr/local/share/fonts</dir>
<dir>~/.fonts</dir>
说明:如果你只是将字体放在~/.fonts下,那么就应相应的提升~/.fonts的位置。这样做的目的是让fontconfig优先从该字体文件夹路径提取字体
修改系统默认字体
系统默认字体是文鼎字体
sudo gedit /etc/fonts/conf.d/ttf-arphic-ukai
分别把AR PL ZenKai Uni和AR PL ShanHeiSun Uni替换为sans和sans-serif
sudo gedit /etc/fonts/conf.d/ttf-arphic-uming
分别把AR PL ZenKai Uni和AR PL ShanHeiSun Uni替换为sans和sans-serif
这样做的目的是
在/etc/fonts/language-selector.conf具有优先权的字体替换sans等字体
那么在这里,直接打上sans,就是间接引用/etc/fonts/language-selector.conf里优先权字体,从而达到替换的目的
在7.10的/etc/fonts/conf.d/里比上一个版本7.04多了一个CJK_aliases文件
修改此文件sudo gedit /etc/fonts/conf.d/CJK_aliases
在此文件的
<!-- Aliases for Simplified Chinese Windows fonts -->
<alias>
下添加 <family>你安装的雅黑字体</family>
例如
<family>Microsoft YaHei</family>
保存并关闭
很明显在/etc/fonts/conf.d/下CJK_aliases是“主管”中日韩字体的“首领”
而language-selector.conf直接引用的优先字体美化方式就是它了
至于浏览器字体美化可参考forum里更多方法
全世界linux爱好者联合起来 !
- dogfox
- 论坛版主
- 帖子: 5311
- 注册时间: 2006-09-02 14:18
- 来自: 汉桑城
- 联系:
- dogfox
- 论坛版主
- 帖子: 5311
- 注册时间: 2006-09-02 14:18
- 来自: 汉桑城
- 联系:
-
- 帖子: 115
- 注册时间: 2006-11-26 15:18
- 来自: 诗山
- dogfox
- 论坛版主
- 帖子: 5311
- 注册时间: 2006-09-02 14:18
- 来自: 汉桑城
- 联系:
- dogfox
- 论坛版主
- 帖子: 5311
- 注册时间: 2006-09-02 14:18
- 来自: 汉桑城
- 联系:
例如,默认情况是这样的kwindva 写了:关于/etc/fonts/fonts.conf的配置,有没有内容给copy一下?
代码: 全选
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/fonts.conf file to configure system font access -->
<fontconfig>
<!--
DO NOT EDIT THIS FILE.
IT WILL BE REPLACED WHEN FONTCONFIG IS UPDATED.
LOCAL CHANGES BELONG IN 'local.conf'.
The intent of this standard configuration file is to be adequate for
most environments. If you have a reasonably normal environment and
have found problems with this configuration, they are probably
things that others will also want fixed. Please submit any
problems to the fontconfig bugzilla system located at fontconfig.org
Note that the normal 'make install' procedure for fontconfig is to
replace any existing fonts.conf file with the new version. Place
any local customizations in local.conf which this file references.
Keith Packard
-->
<!-- Font directory list -->
<dir>/usr/share/fonts</dir>
<dir>/usr/share/X11/fonts</dir> <dir>/usr/local/share/fonts</dir>
<dir>~/.fonts</dir>
<!-- Font cache directory list -->
<cachedir>/var/cache/fontconfig</cachedir>
<cachedir>~/.fontconfig</cachedir>
那么就应这样调整
代码: 全选
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/fonts.conf file to configure system font access -->
<fontconfig>
<!--
DO NOT EDIT THIS FILE.
IT WILL BE REPLACED WHEN FONTCONFIG IS UPDATED.
LOCAL CHANGES BELONG IN 'local.conf'.
The intent of this standard configuration file is to be adequate for
most environments. If you have a reasonably normal environment and
have found problems with this configuration, they are probably
things that others will also want fixed. Please submit any
problems to the fontconfig bugzilla system located at fontconfig.org
Note that the normal 'make install' procedure for fontconfig is to
replace any existing fonts.conf file with the new version. Place
any local customizations in local.conf which this file references.
Keith Packard
-->
<!-- Font directory list -->
<dir> /usr/share/fonts/truetype/ttf-yahei</dir>
<dir>/usr/share/fonts</dir>
<dir>/usr/share/X11/fonts</dir> <dir>/usr/local/share/fonts</dir>
<dir>~/.fonts</dir>
<!-- Font cache directory list -->
<cachedir>/var/cache/fontconfig</cachedir>
<cachedir>~/.fontconfig</cachedir>
全世界linux爱好者联合起来 !
- dogfox
- 论坛版主
- 帖子: 5311
- 注册时间: 2006-09-02 14:18
- 来自: 汉桑城
- 联系:
- dogfox
- 论坛版主
- 帖子: 5311
- 注册时间: 2006-09-02 14:18
- 来自: 汉桑城
- 联系:
- TheThirdGhost
- 帖子: 1592
- 注册时间: 2006-07-23 16:25
- 来自: 南京
- kwindva
- 帖子: 562
- 注册时间: 2007-05-05 23:30
Re: gutsy 下雅黑字体美化
[quote]修改/etc/fonts/language-selector.conf
具体修改方法参见以上2个ubuntu版本
[/quote]
这个在哪儿能找到?
具体修改方法参见以上2个ubuntu版本
[/quote]
这个在哪儿能找到?