在mozilla下实现字体替换

王朝other·作者佚名  2008-05-18
窄屏简体版  字體: |||超大  

来源:Linuxforum

感觉很不错,可以自己任意组合各种字体,让它们在同一个页面上显示出来:

原文如下

500) {this.resized=true; this.width=500;}" onmouseover="this.style.cursor='hand'" onclick="{window.open('http://www.chinalinuxpub.com/images/501162-photo_small.jpg');}" src="http://www.chinalinuxpub.com/images/501162-photo_small.jpg" onmousewheel="return bbimg(this)" width=100 border=2 xthumbnail-orig-image="http://www.chinalinuxpub.com/images/501162-photo.jpg"

在所贴的Mozilla撷图中,包括了几款字体:

Times New Roman, mingliu.ttc, simhei.ttf ,kaiu.ttf

一般都可在Windows 中找到;

当然亦可用:

Tahoma, simsun.ttc, simhei ,kaiu.ttf.

将字体放到 fonts.conf 指定的字型安装路径。

设定:

先备份fonts.conf及local.conf,

将fonts.conf这段模拟斜体描述移除:

<!--

Artificial oblique for fonts without an italic or oblique version

-->

<match target="font">

<!-- check to see if the font is roman -->

<test name="slant">

<const>roman</const>

</test>

<!-- check to see if the pattern requested non-roman -->

<test target="pattern" name="slant" compare="not_eq">

<const>roman</const>

</test>

<!-- multiply the matrix to slant the font -->

<edit name="matrix" mode="assign">

<times>

<name>matrix</name>

<matrix><double>1</double><double>0.2</double>

<double>0</double><double>1</double>

</matrix>

</times>

</edit>

<!-- pretend the font is oblique now -->

<edit name="slant" mode="assign">

<const>oblique</const>

</edit>

</match>

如你有安装 firefly's patches,

也请将local.conf这段模拟粗体描述移除:

<!--

Add by firefly@firefly.idv.tw

Artificial bold for fonts without a bold version.

-->

<match target="font">

<!-- check to see if the pattern requested > "medium" -->

<test target="pattern" name="weight" compare="more">

<const>medium</const>

</test>

<!-- pretend the font is bold now -->

<edit name="weight" mode="assign">

<const>bold</const>

</edit>

</match>

然后将下面三段加到 local.conf 中:

<match target="pattern">

<test name="family">

<string>Times New Roman</string>

</test>

<edit name="family" mode="append" binding="strong">

<string>PMingLiU</string>

</edit>

</match>

<match target="pattern">

<test name="weight" compare="more">

<const>medium</const>

</test>

<test name="family" compare="eq">

<string>PMingLiU</string>

</test>

<edit name="family" mode="assign">

<string>SimHei</string>

</edit>

</match>

<match target="pattern">

<test name="slant" compare="not_eq">

<const>roman</const>

</test>

<test name="family" compare="eq">

<string>PMingLiU</string>

</test>

<edit name="family" mode="assign">

<string>DFKai-SB</string>

</edit>

<!-- pretend the font is oblique now -->

<edit name="slant" mode="assign">

<const>oblique</const>

</edit>

</match>

笫一段是一般文字替代,Tmes New Roman没有的字型(如中文)会强制以 PMingLiU 来补入;

当然,你可用Tahoma替代Tmes New Roman,SimSun 替代 PMingLiU(mingliu.ttc)。

笫二段是将PMingLiU的粗体,转配给 SimHei(windows黑体);当然,你也可将SimSun 替代 PMingLiU。

笫三段是将PMingLiU的斜体,转配给 DFKai-SB(windows楷体);当然,你也可将SimSun 替代 PMingLiU。

下指令﹕#fc-cache -f

在Mozilla设定字体,全选Times New Roman或Tahoma,在乎你安装的是甚么字体。

补充一点,假如你发觉Tahoma的粗体不见了,不用粗心,

只要将windows下的 tahomabd.ttf 也安装进去吧!

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航