LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
楼主: whiz

[求问]汉字小字体歪斜 (solved)

[复制链接]
 楼主| 发表于 2006-4-27 00:31:39 | 显示全部楼层
Post by zerolin
MingLiu 必须要用hinting才能正确的显示.


MingLiU和SimSun我都是用BCI,下面是相关部分。

        <match target="font">
            <test name="family"><string>MingLiU</string></test>
            <test name="family"><string>SimSun</string></test>
            <edit name="hinting"><bool>true</bool></edit>
            <edit name="antialias"><bool>true</bool></edit>
            <edit name="autohint"><bool>false</bool></edit>
        </match>
        <match target="font">
            <test name="family"><string>MingLiU</string></test>
            <test name="family"><string>SimSun</string></test>
            <test name="size" compare="less_eq"><int>12</int></test>
            <edit name="antialias" mode="assign"><bool>false</bool></edit>
            <edit name="hinting" mode="assign"><bool>true</bool></edit>
        </match>
回复 支持 反对

使用道具 举报

发表于 2006-4-27 13:53:17 | 显示全部楼层
这样才对 :)
  1.         <match target="font">
  2.                 <test name="family">
  3.                         <string>MingLiU</string>
  4.                         <string>PMingLiU</string>
  5.                 </test>
  6.                 <edit name="autohint">
  7.                         <bool>false</bool>
  8.                 </edit>
  9.                 <edit name="hinting">
  10.                         <bool>true</bool>
  11.                 </edit>
  12.         </match>
复制代码
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-4-27 15:19:55 | 显示全部楼层
谢谢zerolin。

我改了,但没有作用。.font.conf中还有这样段,是不是有影响?


  1.         <match target="font">
  2.                        <edit name="autohint" mode="assign"><bool>true</bool></edit>
  3.         </match>
复制代码


这段我不论放在前面,还是后面,显示的效果都一样,我猜前后顺序没有影响。
回复 支持 反对

使用道具 举报

发表于 2006-4-27 16:02:39 | 显示全部楼层
我的经验是

  1.         <match target="font">
  2.                        <edit name="autohint" mode="assign"><bool>true</bool></edit>
  3.         </match>
复制代码


放在


  1.         <match target="font">
  2.                 <test name="family">
  3.                         <string>MingLiU</string>
  4.                         <string>PMingLiU</string>
  5.                 </test>
  6.                 <edit name="autohint">
  7.                         <bool>false</bool>
  8.                 </edit>
  9.                 <edit name="hinting">
  10.                         <bool>true</bool>
  11.                 </edit>
  12.         </match>
复制代码


的前后,是有区别的。正确是放在前面,放在后面的话,所有字体都会只使用autohinter .


另外,你不会写成这样吧?

  1.         <match target="font">
  2.                 <test name="family">
  3.                         <string>MingLiU</string>
  4.                         <string>PMingLiU</string>
  5.                 </test>
  6.                 <test name="family">
  7.                         <string>SimSun</string>
  8.                 </test>
  9.                 <edit name="autohint">
  10.                         <bool>false</bool>
  11.                 </edit>
  12.                 <edit name="hinting">
  13.                         <bool>true</bool>
  14.                 </edit>
  15.         </match>
复制代码
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-4-27 16:15:09 | 显示全部楼层
我写成这样了:

  1.         <match target="font">
  2.                 <test name="family">
  3.                         <string>SimSun</string>
  4.                         <string>MingLiU</string>
  5.                 </test>
  6.                 <edit name="autohint">
  7.                         <bool>false</bool>
  8.                 </edit>
  9.                 <edit name="hinting">
  10.                         <bool>true</bool>
  11.                 </edit>
  12.         </match>
复制代码
回复 支持 反对

使用道具 举报

发表于 2006-4-27 16:24:44 | 显示全部楼层
加上

  1.                         <string>PMingLiU</string>
复制代码


看看

mingliu.ttc包含MingLiU 和PMingLiU 两个字体,(等宽与不等宽)
或许你需要显示的那些字是用PMingLiU的。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-4-27 16:33:29 | 显示全部楼层
改了,还是一样的。
回复 支持 反对

使用道具 举报

发表于 2006-4-27 16:57:47 | 显示全部楼层
那把其它地方所有Autohint的设置都删了试试 -_-!。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-4-27 17:29:03 | 显示全部楼层
呵呵,改了,其他有关hinting的设置都删掉,设置全局autohint为false。结果还是一样。
还试着将autohint全设为true,结果也一样。

另外,刚才发现,如果把字体减小两个字号,看起来就比较正常,根据字的大小判断,大概是12号。
回复 支持 反对

使用道具 举报

发表于 2006-4-27 17:51:17 | 显示全部楼层
那全局hinting为 true 呢?

“字体减小两个字号,看起来就比较正常”因为MingLiU也是内嵌了点阵,小字号时的是点阵字,
而不是矢量字,出问题的是矢量字部分,一定要用hinting才可以正常显示。

我开始怀疑是不是编译Freetype的时候漏了加BCI的patch。
回复 支持 反对

使用道具 举报

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

本版积分规则

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