LinuxSir.cn,穿越时空的Linuxsir!

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

添加windows下的字体simsun.ttc,没有gb2312和gb18030编码

[复制链接]
发表于 2007-2-28 21:08:43 | 显示全部楼层 |阅读模式
我对于linux下的字体系统是怎么回事不是很清楚,看了些帖子,但是都没有合适我的情况的,所以放上来让大家看看.
按照一些帖子所写的,拷贝了windows下的字体simsun到/usr/share/fonts/truetype/simsun下,然后使用ttmkdir,生成的fonts.scale中没有gb2312编码.不知道是不是因为我的locale的原因?
以下是我生成的fonts.dir,里面从windows拷贝来的simsun.ttc和simhe.ttf都没有中文字符集的字体生成.
  1. :1:simsun.ttc -misc-NSimSun-medium-r-normal--0-0-0-0-m-0-ascii-0
  2. :1:simsun.ttc -misc-NSimSun-medium-r-normal--0-0-0-0-m-0-ibm-cp850
  3. :1:simsun.ttc -misc-NSimSun-medium-r-normal--0-0-0-0-m-0-iso10646-1
  4. :1:simsun.ttc -misc-NSimSun-medium-r-normal--0-0-0-0-m-0-iso8859-1
  5. :1:simsun.ttc -misc-NSimSun-medium-r-normal--0-0-0-0-m-0-iso8859-15
  6. :1:simsun.ttc -misc-NSimSun-medium-r-normal--0-0-0-0-m-0-koi8-r
  7. simsun.ttc -misc-SimSun-medium-r-normal--0-0-0-0-c-0-ascii-0
  8. simsun.ttc -misc-SimSun-medium-r-normal--0-0-0-0-c-0-ibm-cp850
  9. simsun.ttc -misc-SimSun-medium-r-normal--0-0-0-0-c-0-iso10646-1
  10. simsun.ttc -misc-SimSun-medium-r-normal--0-0-0-0-c-0-iso8859-1
  11. simsun.ttc -misc-SimSun-medium-r-normal--0-0-0-0-c-0-iso8859-15
  12. simsun.ttc -misc-SimSun-medium-r-normal--0-0-0-0-c-0-koi8-r
  13. .....................
  14. .....................
  15. simhei.ttf -misc-SimHei-medium-r-normal--0-0-0-0-c-0-ascii-0
  16. simhei.ttf -misc-SimHei-medium-r-normal--0-0-0-0-c-0-iso10646-1
  17. simkai.ttf -misc-KaiTi_GB2312-medium-r-normal--0-0-0-0-c-0-ascii-0
  18. simkai.ttf -misc-KaiTi_GB2312-medium-r-normal--0-0-0-0-c-0-iso10646-1

复制代码

我的locale默认选择的是en_US.utf8,不过我换了几次gbk和zh_CN.UTF-8,好像对那个没有影响.locale 输出:
  1. LANG=en_US.UTF-8
  2. LANGUAGE=en_CN:en_US:en_GB:en
  3. LC_CTYPE=zh_CN.UTF-8
  4. LC_NUMERIC="en_US.UTF-8"
  5. LC_TIME="en_US.UTF-8"
  6. LC_COLLATE="en_US.UTF-8"
  7. LC_MONETARY="en_US.UTF-8"
  8. LC_MESSAGES="en_US.UTF-8"
  9. LC_PAPER="en_US.UTF-8"
  10. LC_NAME="en_US.UTF-8"
  11. LC_ADDRESS="en_US.UTF-8"
  12. LC_TELEPHONE="en_US.UTF-8"
  13. LC_MEASUREMENT="en_US.UTF-8"
  14. LC_IDENTIFICATION="en_US.UTF-8"
  15. LC_ALL=
复制代码

我的.xorg.conf如下:

  1. Section "Files"
  2. #       FontPath        "/home/winfont"
  3.         FontPath        "/usr/share/fonts/truetype/simsun"
  4. #above lines are added later, may  cause trouble.
  5.         # path to defoma fonts
  6.     FontPath    "/usr/share/fonts/X11/misc"
  7.     FontPath    "/usr/X11R6/lib/X11/fonts/misc"
  8.     FontPath    "/usr/share/fonts/X11/100dpi:unscaled"
  9.     FontPath    "/usr/X11R6/lib/X11/fonts/100dpi:unscaled"
  10.     FontPath    "/usr/share/fonts/X11/75dpi:unscaled"
  11.     FontPath    "/usr/X11R6/lib/X11/fonts/75dpi:unscaled"
  12.     FontPath    "/usr/share/fonts/X11/Type1"
  13.     FontPath    "/usr/local/share/fonts"
  14. EndSection

  15. Section "Module"
  16.         Load    "bitmap"
  17.         Load    "dbe"
  18.         Load    "ddc"
  19.         Load    "dri"
  20.         Load    "extmod"
  21.         Load    "freetype"
  22.         Load    "glx"
  23.         Load    "int10"
  24.         Load    "record"
  25.         Load    "v4l"
  26.         Load    "vbe"
  27. EndSection

  28. Section "InputDevice"
  29.         Identifier      "Generic Keyboard"
  30.         Driver          "kbd"
  31.         Option          "CoreKeyboard"
  32.         Option          "XkbRules"      "xorg"
  33.         Option          "XkbModel"      "pc104"
  34.         Option          "XkbLayout"     "us"
  35. EndSection

  36. Section "InputDevice"
  37.         Identifier      "Configured Mouse"
  38.         Driver          "mouse"
  39.         Option          "CorePointer"
  40.         Option          "Device"                "/dev/input/mice"
  41.         Option          "Protocol"              "ImPS/2"
  42. EndSection

  43. Section "Device"
  44.         Identifier      "Intel Corporation 82845G/GL[Brookdale-G]/GE Chipset Integrated Graphics Device"
  45.         Driver          "i810"
  46.         BusID           "PCI:0:2:0"
  47. :                                                     
  48. .................................................
复制代码


还有我的fonts.conf内容如下:

  1. <!-- Font directory list
  2.         <dir>/home/winfont</dir>
  3.         -->
  4.         <dir>/usr/share/fonts</dir>
  5.         <dir>/usr/X11R6/lib/X11/fonts</dir>
  6.         <dir>/usr/local/share/fonts</dir>
  7.         <dir>~/.fonts</dir>

  8. <!-- Font cache directory list -->

  9.         <cachedir>/var/cache/fontconfig</cachedir>
  10.         <cachedir>~/.fontconfig</cachedir>

  11. <!--
  12.   Accept deprecated 'mono' alias, replacing it with 'monospace'
  13. -->
  14.         <match target="pattern">
  15.                 <test qual="any" name="family">
  16.                         <string>mono</string>
  17.                 </test>
  18.                 <edit name="family" mode="assign">
  19.                         <string>monospace</string>
  20.                 </edit>
  21.         </match>

  22. <!--
  23.   Accept alternate 'sans serif' spelling, replacing it with 'sans-serif'
  24. -->
  25.         <match target="pattern">
  26.                 <test qual="any" name="family">
  27.                         <string>sans serif</string>
  28.                </edit>
  29.         </match>

  30. <!--
  31.   Accept deprecated 'sans' alias, replacing it with 'sans-serif'
  32. -->
  33.         <match target="pattern">
  34.                 <test qual="any" name="family">
  35.                         <string>sans</string>
  36.                 </test>
  37.                 <edit name="family" mode="assign">
  38.                         <string>sans-serif</string>
  39.                 </edit>
  40.         </match>

  41. <!--
  42.   Load local system customization file
  43. -->
  44.         <include ignore_missing="yes">conf.d</include>

  45.         <config>
  46. <!--
  47.   These are the default Unicode chars that are expected to be blank
  48.   in fonts.  All other blank chars are assumed to be broken and
  49.   won't appear in the resulting charsets
  50. -->
  51.                 <blank>
  52.                         <int>0x0020</int>       <!-- SPACE -->
  53.                         <int>0x00A0</int>       <!-- NO-BREAK SPACE -->
  54.                         <int>0x00AD</int>       <!-- SOFT HYPHEN -->
  55.                         <int>0x034F</int>       <!-- COMBINING GRAPHEME JOINER -->
  56.                         <int>0x0600</int>       <!-- ARABIC NUMBER SIGN -->
  57.                         <int>0x0601</int>       <!-- ARABIC SIGN SANAH -->
  58. :                                                                                                   <int>0x0602</int>       <!-- ARABIC FOOTNOTE MARKER -->
  59.                         <int>0x0603</int>       <!-- ARABIC SIGN SAFHA -->
  60.                         <int>0x06DD</int>       <!-- ARABIC END OF AYAH -->
  61.                         <int>0x070F</int>       <!-- SYRIAC ABBREVIATION MARK -->
  62.                         <int>0x115F</int>       <!-- HANGUL CHOSEONG FILLER -->
  63.                         <int>0x1160</int>       <!-- HANGUL JUNGSEONG FILLER -->
  64.                         <int>0x1680</int>       <!-- OGHAM SPACE MARK -->
  65.                         <int>0x17B4</int>       <!-- KHMER VOWEL INHERENT AQ -->
  66.                         <int>0x17B5</int>       <!-- KHMER VOWEL INHERENT AA -->
  67.                         <int>0x180E</int>       <!-- MONGOLIAN VOWEL SEPARATOR -->
  68.                         <int>0x2000</int>       <!-- EN QUAD -->
  69.                         <int>0x2001</int>       <!-- EM QUAD -->
  70.                         <int>0x2002</int>       <!-- EN SPACE -->
  71.                         <int>0x2003</int>       <!-- EM SPACE -->
  72.                         <int>0x2004</int>       <!-- THREE-PER-EM SPACE -->
  73.                         <int>0x2005</int>       <!-- FOUR-PER-EM SPACE -->
  74.                         <int>0x2006</int>       <!-- SIX-PER-EM SPACE -->
  75.                         <int>0x2007</int>       <!-- FIGURE SPACE -->
  76.                         <int>0x2008</int>       <!-- PUNCTUATION SPACE -->
  77.                         <int>0x2009</int>       <!-- THIN SPACE -->
  78.                         <int>0x200A</int>       <!-- HAIR SPACE -->
  79.                         <int>0x200B</int>       <!-- ZERO WIDTH SPACE -->
  80.                         <int>0x200C</int>       <!-- ZERO WIDTH NON-JOINER -->
  81.                         <int>0x200D</int>       <!-- ZERO WIDTH JOINER -->
  82.                         <int>0x200E</int>       <!-- LEFT-TO-RIGHT MARK -->
  83.                         <int>0x200F</int>       <!-- RIGHT-TO-LEFT MARK -->
  84.                         <int>0x2028</int>       <!-- LINE SEPARATOR -->
  85.                         <int>0x2029</int>       <!-- PARAGRAPH SEPARATOR -->
  86.                         <int>0x202A</int>       <!-- LEFT-TO-RIGHT EMBEDDING -->
  87.                         <int>0x202B</int>       <!-- RIGHT-TO-LEFT EMBEDDING -->
  88.                         <int>0x202C</int>       <!-- POP DIRECTIONAL FORMATTING -->
  89.                        <int>0x202B</int>       <!-- RIGHT-TO-LEFT EMBEDDING -->
  90.                         <int>0x202C</int>       <!-- POP DIRECTIONAL FORMATTING -->
  91.                         <int>0x202D</int>       <!-- LEFT-TO-RIGHT OVERRIDE -->
  92.                         <int>0x202E</int>       <!-- RIGHT-TO-LEFT OVERRIDE -->
  93.                         <int>0x202F</int>       <!-- NARROW NO-BREAK SPACE -->
  94.                         <int>0x205F</int>       <!-- MEDIUM MATHEMATICAL SPACE -->
  95.                         <int>0x2060</int>       <!-- WORD JOINER -->
  96.                         <int>0x2061</int>       <!-- FUNCTION APPLICATION -->
  97.                         <int>0x2062</int>       <!-- INVISIBLE TIMES -->
  98.                         <int>0x2063</int>       <!-- INVISIBLE SEPARATOR -->
  99.                         <int>0x206A</int>       <!-- INHIBIT SYMMETRIC SWAPPING -->
  100.                         <int>0x206B</int>       <!-- ACTIVATE SYMMETRIC SWAPPING -->
  101.                         <int>0x206C</int>       <!-- INHIBIT ARABIC FORM SHAPING -->
  102.                         <int>0x206D</int>       <!-- ACTIVATE ARABIC FORM SHAPING -->
  103.                         <int>0x206E</int>       <!-- NATIONAL DIGIT SHAPES -->
  104.                         <int>0x206F</int>       <!-- NOMINAL DIGIT SHAPES -->
  105.                         <int>0x3000</int>       <!-- IDEOGRAPHIC SPACE -->
  106.                         <int>0x3164</int>       <!-- HANGUL FILLER -->
  107.                         <int>0xFEFF</int>       <!-- ZERO WIDTH NO-BREAK SPACE -->
  108.                         <int>0xFFA0</int>       <!-- HALFWIDTH HANGUL FILLER -->
  109.                         <int>0xFFF9</int>       <!-- INTERLINEAR ANNOTATION ANCHOR -->
  110.                         <int>0xFFFA</int>       <!-- INTERLINEAR ANNOTATION SEPARATOR -->
  111.                         <int>0xFFFB</int>       <!-- INTERLINEAR ANNOTATION TERMINATOR -->
  112.                 </blank>
  113. <!--
  114.   Rescan configuration every 30 seconds when FcFontSetList is called
  115. -->
  116.                 <rescan>
  117.                         <int>30</int>
  118.                 </rescan>
  119.         </config>

  120. </fontconfig>

复制代码
 楼主| 发表于 2007-2-28 21:14:10 | 显示全部楼层
这个问题是由我的xmms引起的, 我现在的xmms里面选择字体的时候是有类似-zyec-simsun-medium-r-normal-*-*-140-*-*-p-*-gb18030.2000-0的字体串,但是实际的字体是-zyec-simsun-medium-r-normal-*-*-140-*-*-p-*-gb18030.2000-0,好像我的系统里面没有gb2312和gb18030字符集似的,不知道这个是什么原因.

望大虾帮忙.
回复 支持 反对

使用道具 举报

发表于 2007-2-28 22:19:39 | 显示全部楼层
重新设置你的locale为zh_CN试一试。
dpkg-reconfigure locales
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-2-28 22:43:56 | 显示全部楼层
我试过了的,还是不行.
生成的fonts.scale/dir里面还是没有gb2312字样.
locale:
  1. LANG=zh_CN
  2. LANGUAGE=en_CN:en_US:en_GB:en
  3. LC_CTYPE=zh_CN.GB2312
  4. LC_NUMERIC="zh_CN"
  5. LC_TIME="zh_CN"
  6. LC_COLLATE="zh_CN"
  7. LC_MONETARY="zh_CN"
  8. LC_MESSAGES="zh_CN"
  9. LC_PAPER="zh_CN"
  10. LC_NAME="zh_CN"
  11. LC_ADDRESS="zh_CN"
  12. LC_TELEPHONE="zh_CN"
  13. LC_MEASUREMENT="zh_CN"
  14. LC_IDENTIFICATION="zh_CN"
  15. LC_ALL=
复制代码
回去了,明天继续来蹲点.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-3-1 08:17:53 | 显示全部楼层
早上到了报个到,同时把贴子顶上去.  
以下是我的xmms输出,貌似没有字符集:
The font "-guobiao-song-medium-r-normal-*-*-160-*-*-c-*-gb2312.80&gb8565.88-0" does not support all the required character sets for the current locale "en_US"
  (Missing character set "ISO8859-1")
  (Missing character set "GB2312.1980-0")
The font "-zyec-simsun-medium-r-normal-*-*-160-*-*-p-*-gbk-0" does not support all the required character sets for the current locale "en_US"
  (Missing character set "GB2312.1980-0")
xmms: ../iconv/loop.c:425: from_euc_cn_single: Assertion `inptr - bytebuf > (state->__count & 7)' failed.
Aborted

还有字符集没有安装的?  

重新装了locales, locale设置为en_US.UTF-8,zh_CN,en_US都试验过了,好像跟这些都没有关系, 还是没有gb2312编码的,实在是搜不出为什么.  望各位指点.
南北北南大大, 看到了帮忙指点一下好吗?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-3-1 16:02:09 | 显示全部楼层
当前locale:
LANG=en_US.UTF-8
LANGUAGE=en_CN:en_US:en_GB:en
LC_CTYPE=zh_CN.UTF-8
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
回复 支持 反对

使用道具 举报

发表于 2007-3-1 19:31:42 | 显示全部楼层
把那个simsun.ttc 改成simsun.ttf 再装.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-3-1 21:43:24 | 显示全部楼层
这个应该没有什么区别吧?
我尝试了在dir文件中直接添加gb2312字样的行, xmms里面显示了出来了,但是列表里面显示的有的字有,有的字没有显示.
回复 支持 反对

使用道具 举报

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

本版积分规则

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