作业2趴特逼福利逼ㄟ斯滴中文化

上传人:汽*** 文档编号:586745619 上传时间:2024-09-05 格式:PPT 页数:32 大小:1.11MB
返回 下载 相关 举报
作业2趴特逼福利逼ㄟ斯滴中文化_第1页
第1页 / 共32页
作业2趴特逼福利逼ㄟ斯滴中文化_第2页
第2页 / 共32页
作业2趴特逼福利逼ㄟ斯滴中文化_第3页
第3页 / 共32页
作业2趴特逼福利逼ㄟ斯滴中文化_第4页
第4页 / 共32页
作业2趴特逼福利逼ㄟ斯滴中文化_第5页
第5页 / 共32页
点击查看更多>>
资源描述

《作业2趴特逼福利逼ㄟ斯滴中文化》由会员分享,可在线阅读,更多相关《作业2趴特逼福利逼ㄟ斯滴中文化(32页珍藏版)》请在金锄头文库上搜索。

1、作業 2, 趴特(逼)福利逼斯滴 中文化Computer Center, CS, NCTU2編碼標準Ref: http:/s11643.gov.tw/web/word.jspqASCII8 bits (理論上有 256 種可能)0x00 0x7F 共 128 種字元0x00 0x1F control characters0x20 0x7F printable charactersqBig5使用 2 bytes 來存放中文字 (理論上有 65536 種可能)實際上為與 ASCII 相容, 只能使用 19782 個0x81 0xFE0x400x7E, 0xA1 0xFE = 126 * (63 +

2、 94) = 126 * 157 = 19782Computer Center, CS, NCTU3編碼標準 Big5q標準字 (13502)常用字你我他的媽次常用字朸旯朿鐰飉q特殊符號 (441)符號、控制碼: ! 。 罕用符號 q使用者造字 (5809)三段Computer Center, CS, NCTU4編碼標準 Microsoft Windows Codepage 950Computer Center, CS, NCTU5編碼標準 ISO10646 and Unicode (1)qGoal集結全球通用字符集,成一大聯集UCSUniversal multiple-octet coded

3、 Character Set4 bytes encoding128 Groups256 Planes each groupBMPBasic Multilingual Plane00 group, 00 plane65536 encoding spaceUCS-2UnicodeWhy in BMP若所有字集都在若所有字集都在 BMP 中中, 就可以只使用就可以只使用 2 bytes, 否則就要用否則就要用 4 bytes, 不能混用不能混用Computer Center, CS, NCTU6編碼標準 ISO10646 and Unicode (2)qBMPComputer Center, CS,

4、 NCTU7編碼標準 ISO10646 and Unicode (3)qUTF: UCS Transformation FormatUTF-16將一個 32-bit ISO10646 字元轉成多個 16-bit UnicodeUTF-8將一個32-bit ISO10646 字元轉成多個 8-bit Unicode將一個16-bit Unicode 字元轉成多個 8-bit UnicodeComputer Center, CS, NCTU8中文環境 (1)q要做到哪些事情中文訊息中文顯示中文輸入中文列印中文處理簡單簡單困難困難Computer Center, CS, NCTU9中文環境 (2)q

5、中文化方式直接修改程式套件以排山倒海之勢而來 國際化InternationalizatioNI18NMulti-language architecture程式設計人員按照該架構的機制與準則寫程式, 便可支援各式各樣的語言Locale (LOCALization Environment database)程式根據使用者選擇的 locale 聯繫到不同資料庫, 進而提供該語言的支援中文區域化LocalizatioNL10N在 I18N 的大架構下 加入 “中文支援” 的工作Computer Center, CS, NCTU10中文環境 (3)qlocale地區性語言的資訊LC_ALLLC_CTYP

6、E掌管該 locale 中所有字元的處理方式LC_MESSAGES掌管程式訊息輸出所用的語言LC_TIME時間格式LC_NUMERIC數字格式LC_MONETARY貨幣格式LC_COLLATE字母順序與特殊字元比較LANG語言顯示效力優先性:LC_ALL LC_* LANG Computer Center, CS, NCTU11中文環境 (4)q設定 localecsh/tcsh shellsetenv LC_CTYPE zh_TW.Big5Bourne Shellexport LC_CTYPE=zh_TW.Big5/usr/share/locale/各國的 locale 資訊命名規則: 語言

7、_地區名:字元編碼名稱zh_TW.Big5zh_CN.GBKComputer Center, CS, NCTU12中文環境 (5)q中文 console (Console Login)big5con - 類似倚天的中文 ConsoleRef: http:/netlab.cse.yzu.edu.tw/statue/freebsd/zh-tut/big5con.html% b5cq中文 Terminal (Remote Login)M$ Windows: putty, pietty, netterm, multi-term, telnet, etc.X Window: xterm, rxvt, a

8、term, mterm,etc.設定好中文支援,登入後setenv LC_CTYPE en_US.ISO8859-1(csh/tcsh)export LC_CTYPE=en_US.ISO8859-1(sh/bash)即可看到中文q中文中文 Xwindow建立 L10N 中文環境安裝中文字形設定 Shell locale 環境安裝 xcin 中文輸入程式英文,但支援multibyte character Computer Center, CS, NCTU13Steps of Exerciseq安裝中文字形q安裝中文 Terminalq安裝 XCIN 中文輸入程式q其他設定Computer Cen

9、ter, CS, NCTU14安裝中文字型 (1)q兩大中文字型種類點陣字型 (Bitmapped Font)BDF (Bitmap Distribution Format) 點陣分散格式HBF (Hanzi Bitmap Font) 漢字點陣字體PCF (Portable Compiled Font) 曲線描邊字型 (Outline Fonts)True Type Font (TTF)Computer Center, CS, NCTU15安裝中文字型 (2)qFont Path% xset q q安裝字型步驟透過 ports 安裝字型檔案使用 ttfm 安裝該字型使用 fc-cache 建立

10、字型資料庫修改各軟體設定使用別的字型Font Path:/usr/local/lib/X11/fonts/misc/,/usr/local/lib/X11/fonts/TTF/,/usr/local/lib/X11/fonts/Type1/,/usr/local/lib/X11/fonts/75dpi/,/usr/local/lib/X11/fonts/100dpi/,/usr/local/lib/X11/fonts/local/Computer Center, CS, NCTU16安裝中文字型 (3)q安裝 ttfm TrueType 字型管理工具qttfmttfinfo 讀取 ttf 字型

11、格式資訊的程式% ttfinfo /usr/local/share/fonts/TrueType/fireflysung.ttfchwongchbsd:/fonts/TrueType ttfinfo /usr/local/share/fonts/TrueType/fireflysung.ttfTTFINFO_FONT_FILE=/usr/local/share/fonts/TrueType/fireflysung.ttfTTFINFO_FACE_NUM=1TTFINFO_FACE_INDEX=0TTFINFO_FONT_NAME=AR PL New SungTTFINFO_FONT_PSNAM

12、E=AR-PL-New-SungTTFINFO_FOUNDRY_NAME=miscTTFINFO_WEIGHT_NAME=mediumTTFINFO_WIDTH=normalTTFINFO_NUMCMAP=3TTFINFO_CMAP0=0,3TTFINFO_CMAPNAME0=Apple Unicode,(v.2.0)TTFINFO_CMAP1=1,0TTFINFO_CMAPNAME1=Apple,RomanTTFINFO_CMAP2=3,1TTFINFO_CMAPNAME2=Windows,UnicodeTTFINFO_MAPNUM=3TTFINFO_FONTMAP1=-misc-AR PL

13、 New Sung-medium-r-normal-0-0-0-0-p-0-big5-0TTFINFO_FONTMAP2=-misc-AR PL New Sung-medium-r-normal-0-0-0-0-p-0-gb2312.1980-0TTFINFO_FONTMAP3=-misc-AR PL New Sung-medium-r-normal-0-0-0-0-p-0-jisx0208.1983-0Computer Center, CS, NCTU17安裝中文字型 (4)ttfm.shtytsaitybsd:/fonts/TrueType ttfm.shtytsaitybsd:/font

14、s/TrueType ttfm.shTrue-Type Font Manager 0.9.3True-Type Font Manager 0.9.3Usage: /usr/local/bin/ttfm.sh optionUsage: /usr/local/bin/ttfm.sh option -add module . install ttf font -add module . install ttf font -remove module . remove ttf font from the system -remove module . remove ttf font from the

15、system -list . list all ttf fonts on the system -list . list all ttf fonts on the system -modules list all ttf manager modules on the system -modules list all ttf manager modules on the system -setdefault -setdefault set default ming font of module to file set default ming font of module to file -se

16、tdefault_kai -setdefault_kai set default kai font of module to file set default kai font of module to file -initm . initialize modules -initm . initialize modules -help show this info -help show this infoComputer Center, CS, NCTU18安裝中文字型 (5)q選一個來裝 Computer Center, CS, NCTU19安裝中文字型 (6)qfireflyttf% cd

17、 /usr/ports/chinese/fireflyttf % make install clean透過 ports 安裝的都會自己跑% ttfm.sh -add xttfm /usr/local/share/fonts/TrueType/fireflysung.ttf% fc-cache f v /usr/local/lib/X11/fonts/TrueType/File:/usr/local/share/fonts/TrueType/fireflysung.ttf/usr/local/lib/X11/fonts/TrueType/fireflysung.ttfsymbolic linkC

18、omputer Center, CS, NCTU20安裝中文字型 (7)q用 xfd 來看%setenv LC_CTYPE zh_TW.Big5% xfd fa “AR PL New Sung”Computer Center, CS, NCTU21安裝中文字型 (8)q增加 Font PathEdit /etc/X11/xorg.confRestart xwindowSection Files RgbPath /usr/local/lib/X11/rgb ModulePath /usr/local/lib/modules FontPath /usr/local/lib/X11/fonts/mi

19、sc/ FontPath /usr/local/lib/X11/fonts/TTF/ FontPath /usr/local/lib/X11/fonts/Speedo/ FontPath /usr/local/lib/X11/fonts/Type1/ FontPath /usr/local/lib/X11/fonts/CID/ FontPath /usr/local/lib/X11/fonts/75dpi/ FontPath /usr/local/lib/X11/fonts/100dpi/ FontPath /usr/local/lib/X11/fonts/local/“ FontPath“/

20、usr/local/lib/X11/fonts/TrueType/”EndSectionComputer Center, CS, NCTU22安裝中文 Terminal (1)qrxvt-big5Before /usr/ports/chinese/rxvt-big5Now, it is removedI18N completely/usr/ports/x11/rxvt-develqaterm/usr/ports/chinese/atermqeterm/usr/ports/chinese/etermqmlterm/usr/ports/x11/mltermComputer Center, CS,

21、NCTU23安裝中文 Terminal (2)qrxvtEdit /.Xdefaultsrxvt.borderColor: blackrxvt.borderColor: blackrxvt.background: blackrxvt.background: blackrxvt.backspacekey: Hrxvt.backspacekey: Hrxvt.cursorColor: IndianRedrxvt.cursorColor: IndianRedrxvt.foreground: gray98rxvt.foreground: gray98rxvt.geometry: 80x24rxvt.g

22、eometry: 80x24rxvt.inputMethod: xcinrxvt.inputMethod: xcinrxvt.multibyte_cursor: yesrxvt.multibyte_cursor: yesrxvt.multichar_encoding: big5rxvt.multichar_encoding: big5rxvt.preeditType: OverTheSpotrxvt.preeditType: OverTheSpotrxvt.scrollTtyKeypress: Truerxvt.scrollTtyKeypress: Truerxvt.scrollTtyOutp

23、ut: Falserxvt.scrollTtyOutput: Falserxvt.scrollBar_right: Truerxvt.scrollBar_right: Truerxvt.termName: xterm-colorrxvt.termName: xterm-colorrxvt.troughColor: blackrxvt.troughColor: black! !您可選擇想要的字體大小您可選擇想要的字體大小! ! 國喬國喬 16pt, 16pt, 國喬國喬 16pt16ptrxvt.font: 8x16rxvt.font: 8x16rxvt.mfont: kc15frxvt.mfo

24、nt: kc15f! End ports/chinese/rxvt configuartion! End ports/chinese/rxvt configuartionrxvt.mfont: -aliasmisc-ar pl new sung-medium-r-normal-*-*-160-*-*-p-*-big5-0rxvt.mfont: -aliasmisc-ar pl new sung-medium-r-normal-*-*-160-*-*-p-*-big5-0To use AR PL New Sung Computer Center, CS, NCTU24安裝中文 Terminal

25、(3)qatermEdit /.Xdefaultsaterm.borderColor: blackaterm.background: blackaterm.backspacekey: Haterm.cursorColor: IndianRedaterm.foreground: gray98aterm.geometry: 80x24aterm.inputMethod: xcinaterm.multichar_encoding: big5aterm.preeditType: OverTheSpotaterm.scrollTtyKeypress: Trueaterm.scrollTtyOutput:

26、 Falseaterm.scrollBar_right: Trueaterm.shading: 30aterm.termName: xterm-coloraterm.transparent: Trueaterm.transpscrollbar: Trueaterm.troughColor: black!您可選擇想要的字體大小! 國喬 16pt, 國喬 16ptaterm.font: 8x16aterm.mfont: kc15f! End ports/chinese/aterm configuartionaterm.mfont: -aliasmisc-ar pl new sung-medium-

27、r-normal-*-*-160-*-*-p-*-big5-0aterm.mfont: -aliasmisc-ar pl new sung-medium-r-normal-*-*-160-*-*-p-*-big5-0To use AR PL New Sung Computer Center, CS, NCTU25安裝中文輸入程式qChoicesxcin (chinese/iiimf-le-xcin)gcin (chinese/gcin)scim (textproc/scim, chinese/scim-chewing,fcitx,pinyin,tables)Computer Center, C

28、S, NCTU26安裝 gcin 中文輸入程式 (1)qgcinGtk Chinese INput application1.% cd /usr/ports/chinese/gcin ; make install clean2.setenv LC_CTYPE zh_TW.Big5(csh/tcsh)export LC_CTYPE=zh_TW.Big5(sh/bash)3.Edit xinitrc orafterstep/autoexecexec exec gcingcin & &exec afterstepexec afterstepFunction InitFunctionFunction

29、InitFunction# Module# Module I AnimateI Animate Module Module I WinListI WinList Wait Wait I WinListI WinList Module Module I MonitorWharfI MonitorWharf Wait Wait I MonitorWharfI MonitorWharf Module Module I WharfI Wharf Wait Wait I WharfI Wharf Module Module I Pager 0 0I Pager 0 0 Module Module I B

30、annerI Banner Exec Exec I I gcingcin & & Function Function I WorkspaceStateI WorkspaceStateEndFunctionEndFunctionComputer Center, CS, NCTU27安裝 gcin 中文輸入程式 (2)4.Switch to chinese input: Ctrl - SpaceComputer Center, CS, NCTU28安裝 gcin 中文輸入程式 (3)q調成自己要的樣子Ref: http:/www.csie.nctu.edu.tw/cp76/gcin/Ref: ht

31、tp:/ gcin-setup Hint: 讓各種軟體使用 gcin 作為輸入法%man gcin, 看 ENVIRONMENT VARIABLESComputer Center, CS, NCTU29其他設定 (1)q顯示所有可用字型xlsfontq選擇字型程式xfontsel X font selectorComputer Center, CS, NCTU30其他設定 (2)q安裝 zh-auto-tw-l10n%cd /usr/ports/chinese/auto-tw-l10n/%make install clean%cd /usr/local/share/skel/zh_TW.Big

32、5/%lschbsdchbsd /usr/local/share/skel/zh_TW.Big5 - /usr/local/share/skel/zh_TW.Big5 -chwongchwong- - lslsdot.Xdefaultsdot.Xdefaults dot.fonts.confdot.fonts.conf dot.vimrcdot.vimrcdot.bashrcdot.bashrc dot.gtkrcdot.gtkrc dot.xinitrcdot.xinitrcdot.cshrcdot.cshrc dot.inputrcdot.inputrc make.confmake.con

33、fdot.emacsdot.emacs dot.muttrcdot.muttrc outta-port.supfileoutta-port.supfileComputer Center, CS, NCTU31其他設定 (3)q設定適合的 Localeen_US.ISO8859-1 v.s zh_TW.Big5edit /etc/csh.cshrc (or /.cshrc)if ( $MY_TTY = cons | $MY_TTY = if ( $MY_TTY = cons | $MY_TTY = ttyvttyv ) then ) then setenv LC_CTYPE zh_TW.Big5

34、 setenv LC_CTYPE zh_TW.Big5elseelse setenv LC_CTYPE en_US.ISO8859-1 setenv LC_CTYPE en_US.ISO8859-1endifendifComputer Center, CS, NCTU32Referencesq中文碼介紹中文碼介紹http:/s11643.gov.tw/web/word.jspqFreeBSD Chinese HOWTOhttp:/netlab.cse.yzu.edu.tw/statue/freebsd/zh-tut/index.htmlqIntroduction to i18nhttp:/www.debian.org/doc/manuals/intro-i18n/

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 办公文档 > 工作计划

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号