+ -
当前位置:首页 → 问答吧 → Pls HELP me. i can't input 中文.(已解决,还是模模糊糊的)

Pls HELP me. i can't input 中文.(已解决,还是模模糊糊的)

时间:2009-01-13

来源:互联网

i m install linux OP the first time , and i choose Gentoo , BUT i can't input 中文. i have see the Doc of gentoo, and google ,but find no clue. pls help me .
I install xfce,
my locale:

aat ~ # locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US
LC_CTYPE=zh_CN
LC_NUMERIC="en_US"
LC_TIME="en_US"
LC_COLLATE="en_US"
LC_MONETARY="en_US"
LC_MESSAGES="en_US"
LC_PAPER="en_US"
LC_NAME="en_US"
LC_ADDRESS="en_US"
LC_TELEPHONE="en_US"
LC_MEASUREMENT="en_US"
LC_IDENTIFICATION="en_US"
LC_ALL=

and i have emerged scim ,it has chinese simlpe.

作者: wangl1234   发布时间: 2009-01-13

LANG=en_US.UTF-8

作者: SCys   发布时间: 2009-01-13

引用:
作者: SCys
LANG=en_US.UTF-8
have no effect.

is it necessary to install chinese font ? and how to do it.

作者: wangl1234   发布时间: 2009-01-13

这样可能行,应该有更简单的方法:

1、新建文件/etc/env.d/100i18n
代码:
LANG="en_US.UTF-8"
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="zh_CN.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"
2、/etc/locale.gen 加入
代码:
en_US.UTF-8 UTF-8
en_US ISO-8859-1
zh_CN.UTF-8 UTF-8
zh_CN.GBK GBK
zh_CN GB2312
zh_CN.GB18030 GB18030
3、/etc/locale.nopurge 加入
代码:
en_US.UTF-8 UTF-8
en_US ISO-8859-1
zh_CN.UTF-8 UTF-8
zh_CN.GBK GBK
zh_CN GB2312
zh_CN.GB18030 GB18030
4、确保/etc/make.conf有
代码:
LINGUAS="en en_US zh zh_CN zh_TW"

USE="cairo cjk fontconfi freetype ibus nls truetype unicode userlocales xft"
5、emerge --sync && emerge ibus ibus-pinyin wqy-zenhei && fc-cache -fv && locale-gen

6、如附件中改为文泉驿正黑字体

7、新建/etc/fonts/local.conf ,开启字体渲染
代码:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>

<!-- Generated by SuSEconfig.fonts, don't edit, your changes will get lost. -->
<!-- Edit /etc/sysconfig/fonts-config instead. -->
<!-- Or put rules into your personal config file ~/.fonts.conf. -->

<!-- ************************************************************ -->
<!-- Hinting and antialiasing -->
<!-- ************************************************************ -->

 <match target="pattern" >
 <edit name="dpi" mode="assign" >
 <double>96</double>
 </edit>
 </match>

<!--
 Using hinting=true, hintstyle=hintfull and antialias=true
 is a good default for most fonts.

 Match on "pattern" for the default, not on "font" to make
 it easier to override the default using FcPatternDel()
 and FcPatternAdd...() (see bugzilla #104365).
-->

 <match target="pattern">
 <edit name="hinting">
 <bool>true</bool>
 </edit>
 <edit name="hintstyle">
 <const>hintfull</const>
 </edit>
 <edit name="antialias">
 <bool>true</bool>
 </edit>
 </match>

<!--
 Set autohinter=true as the default, then add exceptions for certain fonts.

 Match on "font" here, not on "pattern" because of bug #118131 comment #93.
 (If an autohint value is set in pattern, OpenOffice 2.1 will use that even
 if there are fontconfig rules matching on "font" which should override it
 again). This doesn't cause any problems for Cairo/Gnome (see bug #104365)
 because Cairo/Gnome don't try to change the autohint value anyway. 
-->
        
 <match target="font">
 <edit name="autohint">
 <bool>true</bool>
 </edit>
 </match>

        <!--
 Switch off the autohinter for PostScript fonts (Type 1 and OpenType CFF)
 because using the PostScript hinting usually looks better than using
 the autohinter.
        -->

        <match target="font">
 <test name="fontformat">
 <string>Type 1</string>
 <string>CFF</string>
 </test>
 <edit name="autohint">
 <bool>true</bool>
 </edit>
        </match>

<!--
 TrueType Fonts which have high quality byte code interpreter
 instructions can look very good in even in small sizes when using
 the byte code interpreter (autohint=false). This is true
 both with and without anti-aliasing. 
 In black and white (antialias=false) the results when rendering
 with the byte code interpreter may even look as good as high quality
 bitmap fonts.

 On the other hand, some low quality TrueType Fonts do not have
 byte code interpreter instructions at all or only very bad byte
 code and may look better when the autohinter is used.
 (See "FreeSans" for example, it looks better with the
 autohinter which is especially obvious if anti-aliasing is off).
-->

        <!--
 Switch off the autohinter for TrueType fonts in order
 to use the byte code interpreter.
        -->
 
        <match target="font">
 <test name="fontformat">
 <string>TrueType</string>
 </test>
 <edit name="autohint">
 <bool>true</bool>
 </edit>
        </match>

        <!--
 Switch on the autohinter for a few TrueType fonts which
 have no byte code or very bad byte code and look better
 with the autohinter:

 But see also bug #215602 for many fonts the autohinter
 seriously distorts the metrics so badly that
 even the digits which should be monospaced are not
 monospaced at all anymore.

 Because of this problem, better don't switch on
 the autohinter for

 Sazanami
 IPA
 DejaVu Sans Light
 DejaVu Sans Condensed
 DejaVu Serif Condensed
 FreeSans
 FreeSerif
 FreeMono

 and other fonts with similar problems until this is solved
 in the autohinter.
        -->

        <match target="font">
 <test name="fontformat">
 <string>TrueType</string>
 </test>
 <test name="family">
 <string>Microsoft YaHei</string>
 <string>Vera Sans YuanTi</string>
 <string>Vera Sans YuanTi Mono</string>
 <string>MS PGothic</string>
 <string>MS UI Gothic</string>
 <string>MS Mincho</string>
 <string>MS PMincho</string>
 <string>HGPSoeiKakupoptai</string>
 <string>HGSGothicE</string>
 <string>HGSGothicM</string>
 <string>HGKyokashotai</string>
 <string>HGSSoeiKakugothicUB</string>
 <string>HGPGothicB</string>
 <string>HGPGothicE</string>
 <string>HGPGothicM</string>
 <string>HGSKyokashotai</string>
 <string>HGMaruGothicMPRO</string>
 <string>HGPSoeiKakugothicUB</string>
 <string>HGMinchoL</string>
 <string>HGPMinchoL</string>
 <string>HGMinchoB</string>
 <string>HGPMinchoB</string>
 <string>HGSMinchoB</string>
 <string>HGMinchoE</string>
 <string>HGPMinchoE</string>
 <string>HGSMinchoE</string>
 <string>HGSoeiKakugothicUB</string>
 <string>HGGyoshotai</string>
 <string>HGPGyoshotai</string>
 <string>HGSGyoshotai</string>
 <string>HGSoeiKakupoptai</string>
 <string>HGSSoeiPresenceEB</string>
 <string>HGPSoeiPresenceEB</string>
 <string>HGGothicB</string>
 <string>HGGothicE</string>
 <string>HGGothicM</string>
 <string>HGSoeiPresenceEB</string>
 <string>HGPKyokashotai</string>
 <string>HGSSoeiKakupoptai</string>
 <string>HGSeikaishotaiPRO</string>
 <string>TLKyokashotai</string>
 <string>TLMincho</string>
 <string>TLPMincho</string>
 <string>TLPGothic</string>
 <string>TLPKyokashotai</string>
 <string>TLMarugothicM</string>
 <string>TLGyoshotai</string>
 <string>TLPGyoshotai</string>
 <string>TLSGyoshotai</string>
 <string>TLPMarugothicM</string>
 <string>TLSMarugothicM</string>
 <string>TLSKyokashotai</string>
 <string>TLGothic</string>
 </test>
 <edit name="autohint">
 <bool>true</bool>
 </edit>
        </match>


 <!--
 The following rule sets up black and white rendering with
 the byte code interpreter for a small list of fonts which
 are known to have good byte code and give bitmap quality
 results at small sizes.
 The pixelsize limit is set to '0' though, which effectively
 disables this rule by default because most users don't like
 that bitmap look and feel.
 If you like a bitmap look and feel of your desktop,
 copy this rule into your ~/.fonts.conf file and replace the '0'
 with non-zero pixelsize limit. Using '18' as the pixelsize
 limit is a good choice if you have the fonts in this list installed
 and like a bitmap look and feel. 
 -->
 <match target="font">
 <test name="family">
 <string>Microsoft YaHei</string>
 <string>Vera Sans YuanTi</string>
 <string>Vera Sans YuanTi Mono</string>
 <string>Andale Mono</string>
 <string>Arial</string>
 <string>Comic Sans MS</string>
 <string>Georgia</string>
 <string>Impact</string>
 <string>Trebuchet MS</string>
 <string>Verdana</string>
 <string>Courier New</string>
 <string>Times New Roman</string>
 <string>Tahoma</string>
 <string>Webdings</string>
 <string>Albany AMT</string>
 <string>Thorndale AMT</string>
 <string>Cumberland AMT</string>
 <string>Andale Sans</string>
 <string>Andy MT</string>
 <string>Bell MT</string>
 <string>Monotype Sorts</string>
 </test>
 <test name="pixelsize" compare="less_eq">
 <double>0</double>
 </test>
 <edit name="autohint">
 <bool>true</bool>
 </edit>
 <edit name="antialias">
 <bool>true</bool>
 </edit>
 </match>


<!--
 Some CJK fonts require the byte code interpreter to be rendered correctly.

 These are composite fonts which store components and composing information
 and compose the glyphs on the fly using the hinting instructions.

 For all such fonts we switch off the autohinter here.
 When "autohint" is set to "false", the byte code interpreter will
 be used if it has been enabled at all when compiling freetype2.

 The Chinese fonts "MingLiu" and "PMingLiU" used to belong to the fonts
 which absolutely require the byte code interpreter to be rendered
 correctly. 
 But apparently the new versions of "MingLiU" and "PMingLiU" from Windows
 Vista are rendered correctly without the byte code interpreter.

-->

 <match target="font">
 <test name="family">
 <string>Microsoft YaHei</string>
 <string>MingLiU</string>
 <string>Vera Sans YuanTi</string>
 <string>Vera Sans YuanTi Mono</string>
 <string>PMingLiU</string>
 </test>
 <edit name="autohint">
 <bool>true</bool>
 </edit>
 </match>

<!-- 
Hinting for CJK fonts in freetype doesn't yet work as well as for Latin fonts.

Recently the autohinter in in freetype has been improved for CJK fonts
a lot but it is still not perfect. Therefore one might want to switch
off the autohinter for CJK fonts. 

This can be achieved by using the following rule:

 <match target="font">
 <test name="lang" compare="contains">
 <string>ja</string>
 <string>zh</string>
 <string>ko</string>
 </test>
 <edit name="autohint">
 <bool>true</bool>
 </edit>
 </match>
-->

<!--
for some Bengali fonts (e.g. "Mukti Narrow"), the autohinter works well
with the patch from http://www.kde.gr.jp/~akito/patch/freetype2/2.1.7
applied. But for "Likhan" it still doesn't work that well
(look how the "matra" lines at the top line up). Therefore, switch
off the autohinter for the "Likhan" font:
-->

 <match target="font">
 <test name="family">
 <string>Likhan</string>
 <string>Microsoft YaHei</string>
 <string>Vera Sans YuanTi</string>
 <string>Vera Sans YuanTi Mono</string>
 </test>
 <edit name="autohint">
 <bool>true</bool>
 </edit>
 </match>


</fontconfig>
8、gnome -> system -> preferences -> sessions 加入 ibus 启动项

9、 emerge -uDN world -q , 然后重启




.
上传的图像
Screenshot-Appearance Preferences.png (46.6 KB, 21 次查看)

作者: yourfriend   发布时间: 2009-01-13

sorry i m a newer , don't know your point. i just want to input chinese.

作者: wangl1234   发布时间: 2009-01-13

看看你的进程里面有没有scim,scim启动了么?

作者: telekroc   发布时间: 2009-01-13

i have do # scim -d .

作者: wangl1234   发布时间: 2009-01-13

你用桌面环境还是桌面管理器?

作者: telekroc   发布时间: 2009-01-13

把这行加到/etc/portage/package.use里面. 然后重装scim-tables就可以用五笔了.如果用拼音的话只要装scim-pinyin.

app-i18n/scim-tables linguas_zh

PS:我用的也是全英文环境加中文输入支持.

作者: cliffordli   发布时间: 2009-01-13

解决了!把zh_CN改成zh_CN.UTF-8就可以了!!

可是其他编码(GB18030等)怎么办?

作者: wangl1234   发布时间: 2009-01-13

引用:
作者: telekroc
你用桌面环境还是桌面管理器?
我用的xfce,还分“桌面环境”和“桌面管理器”吗?

作者: wangl1234   发布时间: 2009-01-13

http://www.shuge.org/lee/posts/locale-note.html

运气好的话,直接以root运行下面的脚本应该就行了
http://www.shuge.org/project/enjoy_g...nfig_locale.sh

作者: flyinflash   发布时间: 2009-01-14