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

上传人:沈*** 文档编号:171561422 上传时间:2022-11-27 格式:PPT 页数:32 大小:1.11MB
收藏 版权申诉 举报 下载
作业2趴特逼福利逼ㄟ斯滴中文化_第1页
第1页 / 共32页
作业2趴特逼福利逼ㄟ斯滴中文化_第2页
第2页 / 共32页
作业2趴特逼福利逼ㄟ斯滴中文化_第3页
第3页 / 共32页
资源描述:

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

1、Computer Center,CS,NCTU2Ref:http:/s11643.gov.tw/web/word.jspq ASCII8 bits(理論上有 256 種可能)0 x00 0 x7F 共 128 種字元 0 x00 0 x1F control characters 0 x20 0 x7F printable charactersq Big5使用 2 bytes 來存放中文字(理論上有 65536 種可能)實際上為與 ASCII 相容,只能使用 19782 個 0 x81 0 xFE0 x400 x7E,0 xA1 0 xFE =126*(63+94)=126*157=19782C

2、omputer Center,CS,NCTU3q 標準字(13502)常用字 你我他的媽次常用字 朸旯朿鐰飉q 特殊符號(441)符號、控制碼:!。罕用符號 q 使用者造字(5809)三段Computer Center,CS,NCTU4Computer Center,CS,NCTU5q Goal集結全球通用字符集,成一大聯集UCS Universal multiple-octet coded Character Set4 bytes encoding 128 Groups 256 Planes each groupBMP Basic Multilingual Plane 00 group,00

3、 plane 65536 encoding space UCS-2 UnicodeWhy in BMP 若所有字集都在若所有字集都在 BMP 中中,就可以只使用就可以只使用 2 bytes,否則就要用否則就要用 4 bytes,不能混用不能混用Computer Center,CS,NCTU6q BMPComputer Center,CS,NCTU7q UTF:UCS Transformation Format UTF-16 將一個 32-bit ISO10646 字元轉成多個 16-bit Unicode UTF-8 將一個32-bit ISO10646 字元轉成多個 8-bit Unicod

4、e 將一個16-bit Unicode 字元轉成多個 8-bit UnicodeComputer Center,CS,NCTU8q要做到哪些事情 中文訊息 中文顯示 中文輸入 中文列印 中文處理簡單簡單困難困難Computer Center,CS,NCTU9q 中文化方式 直接修改程式 套件以排山倒海之勢而來 國際化 InternationalizatioN I18N Multi-language architecture 程式設計人員按照該架構的機制與準則寫程式,便可支援各式各樣的語言 Locale(LOCALization Environment database)程式根據使用者選擇的 l

5、ocale 聯繫到不同資料庫,進而提供該語言的支援 中文區域化 LocalizatioN L10N 在 I18N 的大架構下 加入“中文支援”的工作Computer Center,CS,NCTU10q locale地區性語言的資訊 LC_ALL LC_CTYPE 掌管該 locale 中所有字元的處理方式 LC_MESSAGES 掌管程式訊息輸出所用的語言 LC_TIME 時間格式 LC_NUMERIC 數字格式 LC_MONETARY 貨幣格式 LC_COLLATE 字母順序與特殊字元比較 LANG 語言顯示效力優先性:LC_ALL LC_*LANG Computer Center,CS,N

6、CTU11q 設定 locale csh/tcsh shell setenv LC_CTYPE zh_TW.Big5 Bourne Shell export LC_CTYPE=zh_TW.Big5/usr/share/locale/各國的 locale 資訊 命名規則:語言_地區名:字元編碼名稱 zh_TW.Big5 zh_CN.GBKComputer Center,CS,NCTU12q 中文 console (Console Login)big5con-類似倚天的中文 ConsoleRef:http:/netlab.cse.yzu.edu.tw/statue/freebsd/zh-tut/b

7、ig5con.html%b5cq 中文 Terminal(Remote Login)M$Windows:putty,pietty,netterm,multi-term,telnet,etc.X Window:xterm,rxvt,aterm,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 中文輸入程式英文,

8、但支援multibyte character Computer Center,CS,NCTU13q安裝中文字形q安裝中文 Terminalq安裝 XCIN 中文輸入程式q其他設定Computer Center,CS,NCTU14q兩大中文字型種類 點陣字型(Bitmapped Font)BDF(Bitmap Distribution Format)點陣分散格式HBF(Hanzi Bitmap Font)漢字點陣字體PCF(Portable Compiled Font)曲線描邊字型(Outline Fonts)True Type Font(TTF)Computer Center,CS,NCTU1

9、5qFont Path%xset q q安裝字型步驟 透過 ports 安裝字型檔案使用 ttfm 安裝該字型使用 fc-cache 建立字型資料庫 修改各軟體設定使用別的字型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 Cent

10、er,CS,NCTU16q 安裝 ttfm TrueType 字型管理工具q ttfmttfinfo 讀取 ttf 字型格式資訊的程式%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_

11、INDEX=0TTFINFO_FONT_NAME=AR PL New SungTTFINFO_FONT_PSNAME=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=Wi

12、ndows,UnicodeTTFINFO_MAPNUM=3TTFINFO_FONTMAP1=-misc-AR PL 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,NCTU17ttfm.shtytsait

13、ybsd:/fonts/TrueType ttfm.shtytsaitybsd:/fonts/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 -remo

14、ve module.remove ttf font from the 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

15、ming font of module to file -setdefault_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,NCTU18q 選一個來裝 Computer Center,CS,NCTU19qfireflyttf

16、%cd/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 linkCompu

17、ter Center,CS,NCTU20q 用 xfd 來看%setenv LC_CTYPE zh_TW.Big5%xfd fa“AR PL New Sung”Computer Center,CS,NCTU21q 增加 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/misc/FontPath /usr/local/lib/X11

18、/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“/usr/local/lib/X11/fonts/TrueType/”EndS

19、ectionComputer Center,CS,NCTU22q rxvt-big5Before /usr/ports/chinese/rxvt-big5Now,it is removed I18N completely/usr/ports/x11/rxvt-develq aterm/usr/ports/chinese/atermq eterm/usr/ports/chinese/etermq mlterm/usr/ports/x11/mltermComputer Center,CS,NCTU23q rxvtEdit/.Xdefaultsrxvt.borderColor:blackrxvt.b

20、orderColor:blackrxvt.background:blackrxvt.background:blackrxvt.backspacekey:Hrxvt.backspacekey:Hrxvt.cursorColor:IndianRedrxvt.cursorColor:IndianRedrxvt.foreground:gray98rxvt.foreground:gray98rxvt.geometry:80 x24rxvt.geometry:80 x24rxvt.inputMethod:xcinrxvt.inputMethod:xcinrxvt.multibyte_cursor:yesr

21、xvt.multibyte_cursor:yesrxvt.multichar_encoding:big5rxvt.multichar_encoding:big5rxvt.preeditType:OverTheSpotrxvt.preeditType:OverTheSpotrxvt.scrollTtyKeypress:Truerxvt.scrollTtyKeypress:Truerxvt.scrollTtyOutput:Falserxvt.scrollTtyOutput:Falserxvt.scrollBar_right:Truerxvt.scrollBar_right:Truerxvt.ter

22、mName:xterm-colorrxvt.termName:xterm-colorrxvt.troughColor:blackrxvt.troughColor:black!您可選擇想要的字體大小您可選擇想要的字體大小!國喬國喬 16pt,16pt,國喬國喬 16pt16ptrxvt.font:8x16rxvt.font:8x16rxvt.mfont:kc15frxvt.mfont:kc15f!End ports/chinese/rxvt configuartion!End ports/chinese/rxvt configuartionrxvt.mfont:-aliasmisc-ar pl

23、new sung-medium-r-normal-rxvt.mfont:-aliasmisc-ar pl new sung-medium-r-normal-*-*-160-160-*-*-p-p-*-big5-0-big5-0To use AR PL New Sung Computer Center,CS,NCTU24q atermEdit/.Xdefaultsaterm.borderColor:blackaterm.background:blackaterm.backspacekey:Haterm.cursorColor:IndianRedaterm.foreground:gray98ate

24、rm.geometry:80 x24aterm.inputMethod:xcinaterm.multichar_encoding:big5aterm.preeditType:OverTheSpotaterm.scrollTtyKeypress:Trueaterm.scrollTtyOutput:Falseaterm.scrollBar_right:Trueaterm.shading:30aterm.termName:xterm-coloraterm.transparent:Trueaterm.transpscrollbar:Trueaterm.troughColor:black!您可選擇想要的

25、字體大小!國喬 16pt,國喬 16ptaterm.font:8x16aterm.mfont:kc15f!End ports/chinese/aterm configuartionaterm.mfont:-aliasmisc-ar pl new sung-medium-r-normal-aterm.mfont:-aliasmisc-ar pl new sung-medium-r-normal-*-*-160-160-*-*-p-p-*-big5-0-big5-0To use AR PL New Sung Computer Center,CS,NCTU25q Choices xcin(chine

26、se/iiimf-le-xcin)gcin(chinese/gcin)scim(textproc/scim,chinese/scim-chewing,fcitx,pinyin,tables)Computer Center,CS,NCTU26qgcinGtk 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

27、/autoexecexec gcinexec gcin&exec afterstepexec afterstepFunction InitFunctionFunction 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 W

28、harf Wait Wait I WharfI Wharf Module Module I Pager 0 0I Pager 0 0 Module Module I BannerI Banner Exec Exec I gcinI gcin&Function Function I WorkspaceStateI WorkspaceStateEndFunctionEndFunctionComputer Center,CS,NCTU274.Switch to chinese input:Ctrl-SpaceComputer Center,CS,NCTU28q 調成自己要的樣子Ref:http:/w

29、ww.csie.nctu.edu.tw/cp76/gcin/Ref:http:/ Hint:讓各種軟體使用 gcin 作為輸入法%man gcin,看 ENVIRONMENT VARIABLESComputer Center,CS,NCTU29q 顯示所有可用字型 xlsfontq 選擇字型程式 xfontsel X font selectorComputer Center,CS,NCTU30q 安裝 zh-auto-tw-l10n%cd/usr/ports/chinese/auto-tw-l10n/%make install clean%cd/usr/local/share/skel/zh_

30、TW.Big5/%lschbsd/usr/local/share/skel/zh_TW.Big5-chwong-lschbsd/usr/local/share/skel/zh_TW.Big5-chwong-lsdot.Xdefaults dot.fonts.conf dot.vimrcdot.Xdefaults dot.fonts.conf dot.vimrcdot.bashrc dot.gtkrc dot.xinitrcdot.bashrc dot.gtkrc dot.xinitrcdot.cshrc dot.inputrc make.confdot.cshrc dot.inputrc ma

31、ke.confdot.emacs dot.muttrc outta-port.supfiledot.emacs dot.muttrc outta-port.supfileComputer Center,CS,NCTU31q 設定適合的 Locale en_US.ISO8859-1 v.s zh_TW.Big5 edit/etc/csh.cshrc(or/.cshrc)if($MY_TTY=cons|$MY_TTY=ttyvif($MY_TTY=cons|$MY_TTY=ttyv)then)then setenv LC_CTYPE zh_TW.Big5 setenv LC_CTYPE zh_TW

32、.Big5elseelse setenv LC_CTYPE en_US.ISO8859-1 setenv LC_CTYPE en_US.ISO8859-1endifendifComputer Center,CS,NCTU32q 中文碼介紹中文碼介紹 http:/s11643.gov.tw/web/word.jspq FreeBSD Chinese HOWTOhttp:/netlab.cse.yzu.edu.tw/statue/freebsd/zh-tut/index.htmlq Introduction to i18n http:/www.debian.org/doc/manuals/intro-i18n/

展开阅读全文
温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!