LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1593|回复: 13

如果用特定英文字体替代中文字体中的内嵌英文字体?

[复制链接]
发表于 2009-5-3 15:39:17 | 显示全部楼层 |阅读模式
系统中用的是雅黑,但是不知道为什么,中文字体还好,雅黑自带的英文字体常常显示得有些问题,比如图里的N W x等等,不知道能不能用特定的英文字体替换掉?

另外我很奇怪的是,有的时候这些字母显示正常,有时候不正常!比如第一张图里的标题里的N就正常,而正文里的N却不正常!

这个问题我查过,写了点东西在~/.fonts.conf里面,但是不知道为什么好像不管用,我把它复制到/etc/fonts/conf.d/也不管用

下面是~/.fonts.conf

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
        <match target="pattern">
                <test qual="any" name="family" compare="eq">
                        <string>Microsoft YaHei</string>
                </test>
                <edit name="family" mode="prepend" binding="strong">
                        <string>Arial</string>
                </edit>

<!--上面这几句似乎就是说字体替换的吧,但是似乎没有起作用,下面是对雅黑的微调吧-->

               <edit name="rgba" mode="assign">
                        <const>none</const>
                </edit>
                <edit name="antialias" mode="assign" >
                        <bool>true</bool>
                </edit>
                <edit name="autohint" mode="assign" >
                        <bool>false</bool>
                </edit>
                <edit name="hinting" mode="assign" >
                        <bool>true</bool>
                </edit>
                <edit name="hintstyle" mode="assign" >
                        <const>hintfull</const>
                </edit>
        </match>
</fontconfig>

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
发表于 2009-5-3 15:39:59 | 显示全部楼层
<match target="pattern">
<test name="lang" compare="eq">
<string>zh</string>
<string>zh-cn</string>
</test>
<edit name="family" mode="append" binding="strong">
<string>Luxi Sans</string>
<string>...</string>
</edit>
</match>
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-5-3 15:58:43 | 显示全部楼层
果然ok了,不过第三个图里的 N M 还是没变,不过也无所谓了
不过为什么我之前的做法不行?问题出在prepend和append上吗?
回复 支持 反对

使用道具 举报

发表于 2009-5-3 16:05:04 | 显示全部楼层
"prepend"               Insert before matching  Insert at head of list
         "prepend_first"         Insert at head of list  Insert at head of list
         "append"                Append after matching   Append at end of list
         "append_last"           Append at end of list   Append at end of list
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-5-3 16:11:41 | 显示全部楼层
Post by veryxp;1982733
"prepend"               Insert before matching  Insert at head of list
         "prepend_first"         Insert at head of list  Insert at head of list
         "append"                Append after matching   Append at end of list
         "append_last"           Append at end of list   Append at end of list


没看明白,不过反复试过之后发现似乎不是prepend和append的问题,必须要像你写的对lang判断才行,像我之前对family判断怎么都不行,不明白为什么……

这样一来,岂不是我所有的中文字体的英文都被换成Arial了?
回复 支持 反对

使用道具 举报

发表于 2009-5-3 17:19:15 | 显示全部楼层
append 替换一个当然可以,比如我就这样替换宋体英文。

<match target="pattern">
<string>SimSun</string></edit>       
<edit name="family" mode="append" binding="strong">
<string>Tahoma</string>
</edit>
</match>
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-5-3 17:31:57 | 显示全部楼层
那是不是lang那一部分也不能省掉的?
我试着把这部分省掉,而只写下面这一部分,发现还是不行,另外现在虽然在firefox里这样可以搞定,但是在mousepad里,如果字体选为微软雅黑,还是会出现这种问题……

<match target="pattern">
<test name="family" compare="eq">
<string>Microsoft YaHei</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Arial</string>
回复 支持 反对

使用道具 举报

发表于 2009-5-3 17:52:53 | 显示全部楼层
append 和 prepend ,还没看出来?
回复 支持 反对

使用道具 举报

发表于 2009-5-26 00:43:30 | 显示全部楼层
<match target="pattern">
        <test name="family" compare="eq">
            <string>WenQuanYi Zen Hei Mono</string>
        </test>
        <edit name="family" mode="append" binding="strong">
            <string>DejaVu Sans Mono</string>
        </edit>
    </match>

想用DejaVu Sans Mono中的英文替换WenQuanYi Zen Hei Mono中的英文,这样写一直失败...
回复 支持 反对

使用道具 举报

发表于 2009-5-26 01:43:27 | 显示全部楼层
直接合并不就一劳永逸了?
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表