LinuxSir.cn,穿越时空的Linuxsir!

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

opera字体很宽,求助

[复制链接]
发表于 2008-11-25 09:32:17 | 显示全部楼层 |阅读模式
gentoo上装了opera

  1. $ eix -I opera
  2. [D] www-client/opera
  3.      Available versions:  [M]*9.27!m 9.60!m {elibc_FreeBSD gnome ia32 linguas_be linguas_bg linguas_cs linguas_da linguas_de linguas_el linguas_en linguas_en_GB linguas_es_ES linguas_es_LA linguas_fi linguas_fr linguas_fr_CA linguas_fy linguas_hi linguas_hr linguas_hu linguas_id linguas_it linguas_ja linguas_ka linguas_ko linguas_lt linguas_mk linguas_nb linguas_nl linguas_nn linguas_pl linguas_pt linguas_pt_BR linguas_ru linguas_sv linguas_tr linguas_uk linguas_zh_CN linguas_zh_TW qt-static qt3-static spell}
  4.      Installed versions:  9.62!m(10\u65f659\u520612\u79d2 2008\u5e7411\u670808\u65e5)(linguas_zh_CN qt-static -elibc_FreeBSD -gnome -ia32 -linguas_be -linguas_bg -linguas_cs -linguas_da -linguas_de -linguas_el -linguas_en -linguas_en_GB -linguas_es_ES -linguas_es_LA -linguas_et -linguas_fi -linguas_fr -linguas_fr_CA -linguas_fy -linguas_hi -linguas_hr -linguas_hu -linguas_id -linguas_it -linguas_ja -linguas_ka -linguas_ko -linguas_lt -linguas_mk -linguas_nb -linguas_nl -linguas_nn -linguas_pl -linguas_pt -linguas_pt_BR -linguas_ru -linguas_sv -linguas_ta -linguas_te -linguas_tr -linguas_uk -linguas_zh_TW -qt3-static -spell)
复制代码




.font.conf


  1. <fontconfig>
  2. <!--
  3. # \u8bbe\u7f6e serif \u886c\u7ebf\u5b57\u4f53\u7684\u8bfb\u53d6\u987a\u5e8f
  4. -->
  5. <alias>
  6. <family>serif</family>
  7. <prefer>
  8. <family>Bitstream Vera Serif</family>
  9. <family>Microsoft YaHei</family>
  10. </prefer>
  11. </alias>
  12. <!--
  13. # \u8bbe\u7f6e sans-serif \u65e0\u886c\u7ebf\u5b57\u4f53\u7684\u8bfb\u53d6\u987a\u5e8f
  14. -->
  15. <alias>
  16. <family>sans-serif</family>
  17. <prefer>
  18. <family>Bitstream Vera Sans</family>
  19. <family>Microsoft YaHei</family>
  20. </prefer>
  21. </alias>
  22. <!--
  23. # \u8bbe\u7f6e monospace \u7b49\u5bbd\u5b57\u4f53\u7684\u8bfb\u53d6\u987a\u5e8f
  24. -->
  25. <alias>
  26. <family>monospace</family>
  27. <prefer>
  28. <family>Bitstream Vera Sans Mono</family>
  29. <family>Microsoft YaHei</family>
  30. </prefer>
  31. </alias>

  32. <!-- songti ?  -->
  33. <alias>
  34. <family>songti</family>
  35. <prefer>
  36. <family>Bitstream Vera Serif</family>
  37. <family>Microsoft YaHei</family>
  38. </prefer>
  39. </alias>
  40. <alias>
  41. <family>\u5b8b\u4f53</family>
  42. <prefer>
  43. <family>Bitstream Vera Serif</family>
  44. <family>Microsoft YaHei</family>
  45. </prefer>
  46. </alias>


  47. <!--
  48. # \u5168\u5c40\u5b57\u4f53\u7684\u8bbe\u7f6e
  49. -->
  50. <match target="font">
  51. <test name="family" compare="contains">
  52. <string>Tahoma</string>
  53. <string>verdana</string>
  54. <string>Arial</string>
  55. <string>Times New Roman</string>
  56. </test>
  57. <edit name="globaladvance">
  58. <bool>false</bool>
  59. </edit>
  60. <edit name="spacing">
  61. <int>0</int>
  62. </edit>
  63. <edit name="hinting" mode="assign">
  64. <bool>true</bool>
  65. </edit>
  66. <edit name="autohint" mode="assign">
  67. <bool>false</bool>
  68. </edit>
  69. <edit name="antialias" mode="assign">
  70. <bool>true</bool>
  71. </edit>
  72. <edit name="hintstyle" mode="assign" >
  73. <const>hintfull</const>
  74. </edit>
  75. </match>

  76. <!--
  77. # \u5355\u72ec\u8bbe\u7f6e\u5fae\u8f6f\u96c5\u9ed1\u5b57\u4f53\u7684\u663e\u793a
  78. -->
  79. <match target="font">
  80. <test name="family" compare="contains">
  81. <string>Microsoft YaHei</string>
  82. <string>\u5fae\u8f6f\u96c5\u9ed1</string>
  83. </test>
  84. <edit name="hinting" mode="assign">
  85. <bool>true</bool>
  86. </edit>
  87. <edit name="autohint" mode="assign">
  88. <bool>false</bool>
  89. </edit>
  90. <edit name="antialias" mode="assign">
  91. <bool>true</bool>
  92. </edit>
  93. <edit name="hintstyle" mode="assign" >
  94. <const>hintfull</const>
  95. </edit>
  96. <edit name="rgba" mode="assign">
  97. <const>rgb</const>
  98. </edit>
  99. </match>

  100. <!--
  101. # \u5355\u72ec\u8bbe\u7f6e Bitstream Vera Sans \u5b57\u4f53\u7684\u663e\u793a
  102. -->
  103. <match target="font">
  104. <test name="family" compare="contains">
  105. <string>Bitstream Vera Sans</string>
  106. </test>
  107. <edit name="hinting" mode="assign">
  108. <bool>false</bool>
  109. </edit>
  110. <edit name="autohint" mode="assign">
  111. <bool>false</bool>
  112. </edit>
  113. <edit name="antialias" mode="assign">
  114. <bool>true</bool>
  115. </edit>
  116. <edit name="hintstyle" mode="assign" >
  117. <const>hintfull</const>
  118. </edit>
  119. <edit name="rgba" mode="assign">
  120. <const>none</const>
  121. </edit>
  122. </match>

  123. <!--
  124. # \u5355\u72ec\u8bbe\u7f6e Bitstream Vera Sans Mono \u5b57\u4f53\u7684\u663e\u793a
  125. -->
  126. <match target="font">
  127. <test name="family" compare="contains">
  128. <string>Bitstream Vera Sans Mono</string>
  129. </test>
  130. <edit name="hinting" mode="assign">
  131. <bool>false</bool>
  132. </edit>
  133. <edit name="autohint" mode="assign">
  134. <bool>false</bool>
  135. </edit>
  136. <edit name="antialias" mode="assign">
  137. <bool>true</bool>
  138. </edit>
  139. <edit name="hintstyle" mode="assign" >
  140. <const>hintfull</const>
  141. </edit>
  142. <edit name="rgba" mode="assign">
  143. <const>none</const>
  144. </edit>
  145. </match>
  146. </fontconfig>
复制代码



但是CU和sir的字体都显示的很难看,sir还勉强,cu的太宽了, 我用的是雅黑, 没有simsun之类的字体



求解 :help

本帖子中包含更多资源

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

x
 楼主| 发表于 2008-11-25 09:34:16 | 显示全部楼层
另外utf8的locale,我刚才从xfce4的terminal里用鼠标选择的内容里的中文怎么变成了'\u5355\u72ec\u8bbe\u7f6e\u5fae\u8f6f\u96c5\u9ed1\u5b57\u4f53\u7684\u663e\u793a' 之类的代码?
回复 支持 反对

使用道具 举报

发表于 2008-11-25 20:12:20 | 显示全部楼层
回复 支持 反对

使用道具 举报

发表于 2008-11-25 22:03:23 | 显示全部楼层
  1. <!--
  2.       The dual-width Asian fonts (spacing=dual) are not rendered correctly,
  3.       apparently FreeType forces all widths to match. Trying to disable the
  4.       width forcing code by setting globaladvance=false alone doesn't  help.
  5.       As a brute force workaround, also set spacing=proportional, i.e. handle
  6.       them as proportional fonts:
  7. -->
  8.         <match target="font" >
  9.                 <test target="pattern" name="lang" compare="contains" >
  10.                         <string>zh</string>
  11.                         <string>ja</string>
  12.                         <string>ko</string>
  13.                 </test>
  14.                 <test name="spacing" compare="eq" >
  15.                         <const>dual</const>
  16.                 </test>
  17.                 <edit name="spacing" mode="assign" >
  18.                         <const>proportional</const>
  19.                 </edit>
  20.                 <edit name="globaladvance" mode="assign" >
  21.                         <bool>false</bool>
  22.                 </edit>
  23.         </match>

  24. <!--
  25.      There is a similar problem with dual width bitmap fonts. They don't
  26.      have spacing=dual, therefore they are not handled by the above rule
  27.      and still display as charcell fonts. For example "Efont Biwidth"
  28.      has spacing=mono and "Misc Fixed Wide" has spacing=charcell.
  29.      Force handling of these fonts as proportional fonts as well:
  30. -->
  31.         <match target="font">
  32.                 <test name="lang" compare="contains" >
  33.                         <string>zh</string>
  34.                         <string>ja</string>
  35.                         <string>ko</string>
  36.                 </test>
  37.                 <test name="outline" compare="eq" >
  38.                         <bool>false</bool>
  39.                 </test>
  40.                 <test name="spacing" compare="eq" >
  41.                         <const>mono</const>
  42.                         <const>charcell</const>
  43.                 </test>
  44.                 <edit name="spacing">
  45.                         <const>proportional</const>
  46.                 </edit>
  47.                 <edit name="globaladvance" binding="strong" >
  48.                         <bool>false</bool>
  49.                 </edit>
  50.         </match>
复制代码


不知道是不是需要修正中文字体的宽度,还有为没有粗体的中文字体设置中文字体

  1. <!--
  2.   Synthetic emboldening for fonts that do not have bold face available
  3. -->
  4.     <match target="font" >
  5.         <!-- check to see if the font is just regular -->
  6.         <test name="weight" compare="less_eq"><const>medium</const></test>
  7.         <!-- check to see if the pattern requests bold -->
  8.         <test target="pattern" name="weight" compare="more"><const>medium</const></test>
  9.         <!--
  10.             set the embolden flag
  11.             needed for applications using cairo, e.g. gucharmap, gedit, ...
  12.         -->
  13.         <edit name="embolden" mode="assign" ><bool>true</bool></edit>
  14.         <!--
  15.            set weight to bold
  16.            needed for applications using Xft directly, e.g. Firefox, ...
  17.         -->
  18.         <edit name="weight" mode="assign"><const>bold</const></edit>
  19.     </match>
复制代码


opera粘贴不出中文是因为qt4.2的原因,如果可能的话你还是用qt3share版本把。

如果想使用qt4版本的就找9.60 beta build 2436版本,这个版本是qt4 share版本的。没有如上问题。只有i386平台有。

PS:2436版本我觉得是最好的了,漂亮,特别是字体,qt3版本的字体不如qt4的好看。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-11-28 15:46:16 | 显示全部楼层
我把你的那两个代码都copy到了我的font.conf里
替换了我的<match target="font" >

但是还是老样子

但是我发现直接手动startxfce4后的字体还不错, 让xdm(slim)直接启动的就不好
可是两种情况下有什么区别吗?

env.2 是好的情况下的env, 1是不好的情况下的
diff env.1 env.2
> XDG_SESSION_COOKIE=
> HUSHLOGIN=FALSE
< SHLVL=2
> SHLVL=3
< LC_CTYPE=zh_CN.UTF-8
> WINDOWPATH=7
< XAUTHORITY=/home/user/.Xauthority


我unset一些像lc-ctype这类的变量在从命令行启动opera还是不好,
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-11-28 15:51:49 | 显示全部楼层
but when I manually startxfce4, can not see chinese fonts in terminal, even after set lang lc_type...
回复 支持 反对

使用道具 举报

发表于 2008-11-28 21:13:13 | 显示全部楼层
你得设置全局变量,startxfce不知道有没有读.xinitrc的设置。

如果是en_US.UTF8的locale,opera字体会好看一点,不过这仅仅是针对utf8网页,以及界面字体的选择。

opera字体还是需要多种调整一起使用。调整好字体的font.conf,然后设置opera的font.ini。
回复 支持 反对

使用道具 举报

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

本版积分规则

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