• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • Debian的GNOME漢化(美化)簡易教程(轉)

    發表于:2007-05-26來源:作者:點擊數: 標簽:
    Debian的GNOME漢化(美化)簡易教程 Debian的GNOME漢化(美化)簡易教程[fcitx開機啟動,tahoma英文顯示,simsun中文顯示,openoffice字體調整] 這是我自己漢化 GNOME 的心得體會,希望對大家有點啟發。 假設你已經安裝好X以及GNOME,并且以root帳號進行下面的漢化步
    Debian的GNOME漢化(美化)簡易教程

    Debian的GNOME漢化(美化)簡易教程[fcitx開機啟動,tahoma英文顯示,simsun中文顯示,openoffice字體調整]


    這是我自己漢化GNOME的心得體會,希望對大家有點啟發。
    假設你已經安裝好X以及GNOME,并且以root帳號進行下面的漢化步驟。

    X的字體機制:
    目前,有兩種帶有不同特點的子系統:

    - 原始的(已有 15 年以上歷史)子系統被稱為“核心 X 字體子系統”。由這個子系統繪制的字體不是平滑字體,它們由 X 服務器處理,名稱類似:
    -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-1

    - 新的字體子系統被稱為“fontconfig”。它允許應用程序直接使用字體文件。fontconfig 經常與“Xft”庫一起使用,這會允許應用程序在屏幕上繪制平滑字體。fontconfig 顯示的字體更有“人情味兒”。

    隨著時間的推移,fontconfig/Xft 將會取代核心 X 字體子系統。目前,使用 Qt 3 或 GTK 2 工具包(包括 KDE 和 GNOME 應用程序)的應用程序使用fontconfig 和 Xft 字體子系統;其它部分程序(如 xmms 、gimp) 還在使用核心 X 字體。
    Debian(包括 Redhat) 在未來可能會僅支持 fontconfig/Xft 作為默認的本地字體訪問方法來取代傳統的字體服務器。

    注意:以上列出的字體子系統用法有兩個例外。它們是 OpenOffice.org(使用它自己的字體繪制技術)和 Mozilla (使用 fontconfig,但不是GTK2)。


    Debian漢化步驟簡述(11個步驟):

    1.在fontconfig的默認配置路徑/usr/share/fonts/truetype下創建新文件夾如DIY,隨后拷貝字體文件simsun.ttc,tahoma.ttf入內
    注意:為了使普通用戶也能用上字體,應該修改字體文件的屬性
    chmod 444 simsun.ttc
    chmod 444 tahoma.ttf


    2.安裝locales,使用dpkg-reconfigure配置它,選上en_US(iso8859-1)以及zh_CN.GBK

    3.配置locale為zh_CN.GBK──在/etc/environment文件里添加以下兩句
    LANG=zh_CN.GBK
    XMODIFIERS=@im=fcitx

    注意,無須再在任何shell配置文件里設置locale,因為Debian系統最好的配置對象是/etc/environment,以后我會寫一篇關于Debian系統啟動腳本的文章,請留意

    4.dpkg-reconfigure xserver-xfree86配置X,將freetype模塊去除,保留xtt模塊(它比freetype的字體渲染效果要好,比如說支持粗體)

    5.安裝相關的工具
    apt-get install defoma dfontmgr psfontmgr x-ttcidfont-conf fontconfig libxft2 libxft2-dev libpango1.0-0 zh-autoconvert ttf-arphic-bsmi00lp ttf-arphic-bkai00mp ttf-arphic-gbsn00lp ttf-arphic-gkai00mp xfonts-intl-chinese xfonts-intl-chinese-big manpages-zh

    介紹如下:
    Debian的特色字體配置工具:
    defoma - Debian Font Manager -- automatic font configuration framework
    dfontmgr - GUI frontend for defoma, DEbian FOnt MAnager
    psfontmgr - PostScript font manager -- part of Defoma, Debian Font Manager
    x-ttcidfont-conf - Configure TrueType and CID fonts for X
    新一代的字體渲染機制xft2以及它的配置工具fontconfig:
    fontconfig - generic font configuration library
    libxft2 - advanced font drawing library for X
    libxft2-dev - advanced font drawing library for X (development files)
    libpango1.0-0 - Layout and rendering of internationalized text
    自動中文編碼轉換工具:
    zh-autoconvert - Chinese HZ/GB/BIG5/UNI/UTF7/UTF8 encodings auto-converter
    GPL字體:
    ttf-arphic-bsmi00lp :文鼎PL細上海宋(Big5 碼)
    ttf-arphic-bkai00mp :文鼎PL中楷(Big5 碼)
    ttf-arphic-gbsn00lp :文鼎PL簡報宋(GB 碼)
    ttf-arphic-gkai00mp :文鼎PL簡中楷(GB 碼)
    其他字體:
    xfonts-intl-chinese - International fonts for X -- Chinese
    xfonts-intl-chinese-big - International fonts for X -- Chinese big
    部分中文man手冊:
    manpages-zh

    6.使用dfontmgr注冊字體文件(xtt以及xft的配置一次搞定)
    有了這個強大的前端,我們可以省卻手工或者使用defoma-hints工具創建hints文件的煩瑣步驟,而只需按幾下鼠標即可注冊字體,比如說要注冊simsun字體,我們按下"Register Font"按鈕,按"next",隨后選擇/usr/share/fonts/truetype/DIY這個路徑下的simsun.ttc字體文件,按下"ok";接著dfontmgr會用一系列的對話框給出該字體文件的所有信息,仔細確認一路按下"ok"即可,最后字體被注冊到所有可能的字體子系統包括xfonts以及fontconfig。
    隨后把下面兩句添加到/etc/X11/XF86Config-4文件,使xtt能使用dfontmgr注冊的字體集(dfontmgr自動更新fontconfig)
    FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
    FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/CID"


    7.安裝firefly補丁(在sources.list中添加源后,dist-upgrade即可升級相關軟件為firefly版本)
    補充:使用debian.cn99.com的sarge源,添上ustc(中國科技大學)源即可:
    # Unofficial packages
    # Avaliable components: marillat rareware ustc java misc firefly
    deb http://debian.ustc.edu.cn/debian-uo/ sid misc marillat rareware ustc java firefly

    8.修改/etc/fonts/fonts.conf文件,使中英文獨立顯示(估計是調整了替代規則以及優先級)以及firefly補丁生效
    這里給出參考的fonts.conf文件:
    引用:
    <?xml version="1.0"?>
    <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
    <!-- /etc/fonts/fonts.conf file to configure system font aclearcase/" target="_blank" >ccess -->
    <fontconfig>

    <!--
    DO NOT EDIT THIS FILE.
    IT WILL BE REPLACED WHEN FONTCONFIG IS UPDATED.
    LOCAL CHANGES BELONG IN 'local.conf'.

    The intent of this standard configuration file is to be adequate for
    most environments. If you have a reasonably normal environment and
    have found problems with this configuration, they are probably
    things that others will also want fixed. Please submit any
    problems to the fontconfig bugzilla system located at fontconfig.org

    Note that the normal 'make install' procedure for fontconfig is to
    replace any existing fonts.conf file with the new version. Place
    any local customizations in local.conf which this file references.

    Keith Packard
    -->

    <!-- Font directory list configured on Tue Apr 22 16:09:12 EDT 2003 -->

    <dir>/usr/share/fonts</dir>
    <dir>/usr/X11R6/lib/X11/fonts/TTF</dir>
    <dir>/usr/X11R6/lib/X11/fonts/Type1</dir>
    <dir>~/.fonts</dir>

    <!--
    *Set alias start*
    -->

    <!--
    Accept deprecated 'mono' alias, replacing it with 'monospace'
    -->
    <match target="pattern">
    <test qual="any" name="family">
    <string>mono</string>
    </test>
    <edit name="family" mode="assign">
    <string>monospace</string>
    </edit>
    </match>

    <!--
    Accept alternate 'sans serif' spelling, replacing it with 'sans-serif'
    -->
    <match target="pattern">
    <test qual="any" name="family">
    <string>sans serif</string>
    </test>
    <edit name="family" mode="assign">
    <string>sans-serif</string>
    </edit>
    </match>

    <!--
    Accept deprecated 'sans' alias, replacing it with 'sans-serif'
    -->
    <match target="pattern">
    <test qual="any" name="family">
    <string>sans</string>
    </test>
    <edit name="family" mode="assign">
    <string>sans-serif</string>
    </edit>
    </match>

    <!--
    Mark common families with their generics so we'll get
    something reasonable
    -->

    <!--
    * Set alias END*
    -->

    <!--
    *Define three font-sets: Sans-serif,Sans,Monospace*
    -->
    <!--
    Serif faces
    -->
    <alias>
    <family>Bitstream Vera Serif</family>
    <family>Times</family>
    <family>Times New Roman</family>
    <family>Nimbus Roman No9 L</family>
    <family>Luxi Serif</family>
    <family>Mingliu</family>
    <family>Kochi Mincho</family>
    <family>AR PL SungtiL GB</family>
    <family>AR PL Mingti2L Big5</family>
    <family>Baekmuk Batang</family>
    <default><family>serif</family></default>
    </alias>
    <!--
    Sans-serif faces
    -->
    <alias>
    <family>Bitstream Vera Sans</family>
    <family>Helvetica</family>
    <family>Arial</family>
    <family>Verdana</family>
    <family>Nimbus Sans L</family>
    <family>Luxi Sans</family>
    <family>Tahoma</family>
    <family>Simsun</family>
    <family>Mingliu</family>
    <family>Kochi Gothic</family>
    <family>AR PL KaitiM GB</family>
    <family>AR PL KaitiM Big5</family>
    <family>Baekmuk Dotum</family>
    <default><family>sans-serif</family></default>
    </alias>
    <!--
    Monospace faces
    -->
    <alias>
    <family>Bitstream Vera Sans Mono</family>
    <family>Courier</family>
    <family>Courier New</family>
    <family>Andale Mono</family>
    <family>Luxi Mono</family>
    <family>Nimbus Mono L</family>
    <family>NSimSun</family>
    <family>PMingLiu</family>
    <default><family>monospace</family></default>
    </alias>

    <!--
    If the font still has no generic name, add sans-serif
    -->
    <match target="pattern">
    <test qual="all" name="family" compare="not_eq">
    <string>sans-serif</string>
    </test>
    <test qual="all" name="family" compare="not_eq">
    <string>serif</string>
    </test>
    <test qual="all" name="family" compare="not_eq">
    <string>monospace</string>
    </test>
    <edit name="family" mode="append_last">
    <string>sans-serif</string>
    </edit>
    </match>

    <!--
    Some Asian fonts misadvertise themselves as monospaced when
    in fact they are dual-spaced (half and full). This makes
    FreeType very confused as it forces all widths to match.
    Undo this magic by disabling the width forcing code -->
    <match target="font">
    <test name="family"><string>GulimChe</string></test>
    <edit name="globaladvance"><bool>false</bool></edit>
    </match>

    <match target="font">
    <test name="family"><string>DotumChe</string></test>
    <edit name="globaladvance"><bool>false</bool></edit>
    </match>

    <match target="font">
    <test name="family"><string>BatangChe</string></test>
    <edit name="globaladvance"><bool>false</bool></edit>
    </match>

    <match target="font">
    <test name="family"><string>GungsuhChe</string></test>
    <edit name="globaladvance"><bool>false</bool></edit>
    </match>

    <!--
    The Bitstream Vera fonts have GASP entries suggesting that hinting be
    disabled below 8 ppem, but FreeType ignores those, preferring to use
    the data found in the instructed hints. The initial Vera release
    didn't include the right instructions in the 'prep' table. Fix this
    by disabling hinting manually at smaller sizes (< 8ppem)
    -->

    <match target="font">
    <test name="family">
    <string>Bitstream Vera Sans</string>
    </test>
    <test name="pixelsize" compare="less">
    <double>7.5</double>
    </test>
    <edit name="hinting">
    <bool>false</bool>
    </edit>
    </match>

    <match target="font">
    <test name="family">
    <string>Bitstream Vera Serif</string>
    </test>
    <test name="pixelsize" compare="less">
    <double>7.5</double>
    </test>
    <edit name="hinting">
    <bool>false</bool>
    </edit>
    </match>

    <match target="font">
    <test name="family">
    <string>Bitstream Vera Sans Mono</string>
    </test>
    <test name="pixelsize" compare="less">
    <double>7.5</double>
    </test>
    <edit name="hinting">
    <bool>false</bool>
    </edit>
    </match>

    <!--
    Load per-user customization file
    -->
    <include ignore_missing="yes">~/.fonts.conf</include>

    <!--
    Load local system customization file
    -->
    <include ignore_missing="yes">local.conf</include>

    <!--
    Alias well known font names to available TrueType fonts
    -->
    <alias>
    <family>Times</family>
    <accept><family>Times New Roman</family></accept>
    </alias>
    <alias>
    <family>Helvetica</family>
    <accept><family>Verdana</family></accept>
    </alias>
    <alias>
    <family>Arial</family>
    <accept><family>Verdana</family></accept>
    </alias>
    <alias>
    <family>Courier</family>
    <accept><family>Courier New</family></accept>
    </alias>

    <!--
    Check user preference to avoid bitmap fonts and replace
    bitmap face names with equivalent scalable fonts
    -->

    <match target="pattern">
    <test name="prefer_outline">
    <bool>true</bool>
    </test>
    <test name="family">
    <string>Helvetica</string>
    </test>
    <edit name="family" mode="prepend" binding="same">
    <string>Arial</string>
    </edit>
    </match>

    <match target="pattern">
    <test name="prefer_outline">
    <bool>true</bool>
    </test>
    <test name="family">
    <string>Times</string>
    </test>
    <edit name="family" mode="prepend" binding="same">
    <string>Times New Roman</string>
    </edit>
    </match>
    <!--
    Provide required aliases for standard names
    -->
    <alias>
    <family>serif</family>
    <prefer>
    <family>Bitstream Vera Serif</family>
    <family>Times New Roman</family>
    <family>Nimbus Roman No9 L</family>
    <family>Luxi Serif</family>
    <family>Times</family>
    <family>Simsun</family>
    <family>Mingliu</family>
    <family>Kochi Mincho</family>
    <family>AR PL SungtiL GB</family>
    <family>AR PL Mingti2L Big5</family>
    <family>Baekmuk Batang</family>
    </prefer>
    </alias>
    <alias>
    <family>sans-serif</family>
    <prefer>
    <family>Bitstream Vera Sans</family>
    <family>Verdana</family>
    <family>Nimbus Sans L</family>
    <family>Luxi Sans</family>
    <family>Tahoma</family>
    <family>Simsun</family>
    <family>Mingliu</family>
    <family>Arial</family>
    <family>Helvetica</family>
    <family>Kochi Gothic</family>
    <family>AR PL KaitiM GB</family>
    <family>AR PL KaitiM Big5</family>
    <family>Baekmuk Dotum</family>
    </prefer>
    </alias>
    <alias>
    <family>monospace</family>
    <prefer>
    <family>Bitstream Vera Sans Mono</family>
    <family>Andale Mono</family>
    <family>Courier New</family>
    <family>Luxi Mono</family>
    <family>Nimbus Mono L</family>
    <family>SimSun</family>
    <family>NSimSun</family>
    <family>PMingLiu</family>
    <family>Kochi Gothic</family>
    <family>AR PL KaitiM GB</family>
    <family>Baekmuk Dotum</family>
    </prefer>
    </alias>

    <!--
    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>
    <!--
    This expression is added by Akito Hirai<akito@kde.gr.jp> for convenience.
    It can be used to make artificial bold versions in client libraries/applications.
    -->
    <match target="font">
    <test name="weight">
    <const>medium</const>
    </test>
    <test target="pattern" name="weight" compare="more">
    <const>medium</const>
    </test>
    <edit name="weight" mode="assign">
    <if>
    <more>
    <name>spacing</name>
    <const>proportional</const>
    </more>
    <const>demibold</const> <!-- for monospace -->
    <const>bold</const> <!-- for proportional -->
    </if>
    </edit>
    </match>

    <match target="font">
    <test name="pixelsize" compare="less_eq">
    <double>16</double>
    </test>
    <test name="pixelsize" compare="more_eq">
    <double>8</double>
    </test>
    <edit name="antialias" mode="assign">
    <bool>f</bool>
    </edit>
    </match>
    <match target="font">
    <test name="size" compare="less_eq">
    <double>16</double>
    </test>
    <test name="size" compare="more_eq">
    <double>8</double>
    </test>

    <edit name="antialias" mode="assign">
    <bool>f</bool>
    </edit>
    </match>

    <config>
    <!--
    These are the default Unicode chars that are expected to be blank
    in fonts. All other blank chars are assumed to be broken and
    won't appear in the resulting charsets
    -->
    <blank>
    <int>0x0020</int> <!-- SPACE -->
    <int>0x00a0</int> <!-- NO-BREAK SPACE -->
    <int>0x00ad</int> <!-- SOFT HYPHEN -->
    <int>0x115f</int> <!-- HANGUL CHOSEONG FILLER -->
    <int>0x1160</int> <!-- HANGUL JUNGSEONG FILLER -->
    <int>0x1680</int> <!-- OGHAM SPACE MARK -->
    <int>0x2000</int> <!-- EN QUAD -->
    <int>0x2001</int> <!-- EM QUAD -->
    <int>0x2002</int> <!-- EN SPACE -->
    <int>0x2003</int> <!-- EM SPACE -->
    <int>0x2004</int> <!-- THREE-PER-EM SPACE -->
    <int>0x2005</int> <!-- FOUR-PER-EM SPACE -->
    <int>0x2006</int> <!-- SIX-PER-EM SPACE -->
    <int>0x2007</int> <!-- FIGURE SPACE -->
    <int>0x2008</int> <!-- PUNCTUATION SPACE -->
    <int>0x2009</int> <!-- THIN SPACE -->
    <int>0x200a</int> <!-- HAIR SPACE -->
    <int>0x200b</int> <!-- ZERO WIDTH SPACE -->
    <int>0x200c</int> <!-- ZERO WIDTH NON-JOINER -->
    <int>0x200d</int> <!-- ZERO WIDTH JOINER -->
    <int>0x200e</int> <!-- LEFT-TO-RIGHT MARK -->
    <int>0x200f</int> <!-- RIGHT-TO-LEFT MARK -->
    <int>0x2028</int> <!-- LINE SEPARATOR -->
    <int>0x2029</int> <!-- PARAGRAPH SEPARATOR -->
    <int>0x202a</int> <!-- LEFT-TO-RIGHT EMBEDDING -->
    <int>0x202b</int> <!-- RIGHT-TO-LEFT EMBEDDING -->
    <int>0x202c</int> <!-- POP DIRECTIONAL FORMATTING -->
    <int>0x202d</int> <!-- LEFT-TO-RIGHT OVERRIDE -->
    <int>0x202e</int> <!-- RIGHT-TO-LEFT OVERRIDE -->
    <int>0x202f</int> <!-- NARROW NO-BREAK SPACE -->
    <int>0x205f</int> <!-- MEDIUM MATHEMATICAL SPACE -->
    <int>0x2060</int> <!-- WORD JOINER -->
    <int>0x2061</int> <!-- FUNCTION APPLICATION -->
    <int>0x2062</int> <!-- INVISIBLE TIMES -->
    <int>0x2063</int> <!-- INVISIBLE SEPARATOR -->
    <int>0x206A</int> <!-- INHIBIT SYMMETRIC SWAPPING -->
    <int>0x206B</int> <!-- ACTIVATE SYMMETRIC SWAPPING -->
    <int>0x206C</int> <!-- INHIBIT ARABIC FORM SHAPING -->
    <int>0x206D</int> <!-- ACTIVATE ARABIC FORM SHAPING -->
    <int>0x206E</int> <!-- NATIONAL DIGIT SHAPES -->
    <int>0x206F</int> <!-- NOMINAL DIGIT SHAPES -->
    <int>0x3000</int> <!-- IDEOGRAPHIC SPACE -->
    <int>0x3164</int> <!-- HANGUL FILLER -->
    <int>0xfeff</int> <!-- ZERO WIDTH NO-BREAK SPACE -->
    <int>0xffa0</int> <!-- HALFWIDTH HANGUL FILLER -->
    <int>0xfff9</int> <!-- INTERLINEAR ANNOTATION ANCHOR -->
    <int>0xfffa</int> <!-- INTERLINEAR ANNOTATION SEPARATOR -->
    <int>0xfffb</int> <!-- INTERLINEAR ANNOTATION TERMINATOR -->
    </blank>
    <!--
    Rescan configuration every 30 seconds when FcFontSetList is called
    -->
    <rescan>
    <int>30</int>
    </rescan>
    </config>

    </fontconfig>


    9.安裝fcitx,并在GNOME創建啟動條目使fcitx開機啟動:
    cat > ~/.gnomerc << EOF
    fcitx &

    重啟X

    10.修改gnome的字體為tahoma,漢化GNOME系統
    桌面首選項-->字體

    11.修改gtk的配置文件,漢化gtk1,gtk2的應用程序
    /etc/gtk-2.0/gtkrc:
    #英文用tahoma顯示,中文用simsun顯示
    style "user-font"
    {
    font_name="Tahoma,Simsun 9"
    }

    widget_class "*" style "default"

    /etc/gtk/gtkrc.zh_CN:
    style "gtk-default-zh-cn" {
    fontset = "-adobe-helvetica-medium-r-normal--14-*-*-*-*-*-iso8859-1,\
    -dynalab-simsun-medium-r-normal--14-*-*-*-*-*-gbk-0,fixed"
    }
    class "GtkWidget" style "gtk-default-zh-cn"




    心得:
    1. Sans-serif字體集優先級別最高
    2. fcitx的字體顯示使用與xft最高優先級別的字體集
    3. 為了有最好的網頁瀏覽顯示,請安裝firefox
    4. 由于調整好了fontconfig,于是以后系統所有gtk以及依賴xft的程序如firefox都可以使用自動使用tahoma顯示英文,simsun顯示中文了,只要把這些程序的中英文都選上tahoma即可

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>