Freecad語言設定中,中文顯示方框問題請教 [論壇 - 新手村]


正在瀏覽:   1 名遊客


 到底部   前一個主題   下一個主題  [無發表權] 請登錄或者註冊



Freecad語言設定中,中文顯示方框問題請教
會員四級
註冊日期:
2007/11/25 1:18
所屬群組:
已註冊使用者
等級: 16
HP : 0 / 385
MP : 103 / 17509
EXP: 43
離線
安裝FreeCAD後,於Edit > preferences裡,要去改語言為中文,但選項裡,簡體中文與繁體中文字形均顯示為方框。請教應如何處理? (見附圖)
OS:Xubuntu 16.04

附件:



jpg  Preferences_011.jpg (91.31 KB)
8716_589de3870359f.jpg 692X495 px

2017/2/10 23:44
應用擴展 工具箱
回覆: Freecad語言設定中,中文顯示方框問題請教
會員三級
註冊日期:
2016/4/18 12:29
所屬群組:
已註冊使用者
等級: 9
HP : 0 / 221
MP : 39 / 4605
EXP: 84
離線
方框代表連沒字型,我猜你應該沒有中文字型,是的話裝一下應該就解決了
另外是你的程式須使用自訂的resource,但它又沒有中文字型,這就比較麻煩了
以上僅供參考

2017/2/11 3:17
應用擴展 工具箱
回覆: Freecad語言設定中,中文顯示方框問題請教
會員四級
註冊日期:
2007/11/25 1:18
所屬群組:
已註冊使用者
等級: 16
HP : 0 / 385
MP : 103 / 17509
EXP: 43
離線
請教:
「沒有中文字型」指的是要教什麼中文字型呢?
(Xubuntu裝完後,應有基本的中文字型吧。然後我有再裝 王漢宗的中文字型)

2017/2/11 9:17
應用擴展 工具箱
回覆: Freecad語言設定中,中文顯示方框問題請教
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 37
HP : 0 / 901
MP : 671 / 29288
EXP: 6
離線
因為我不確定您提到的問題發生的原因

先提供我目前簡易測試所得到的結果讓您參考。

我測試的平台「Xubuntu 16.04 amd64 英文界面」。

================================================================================

執行下面指令,安裝「freecad


$ sudo apt-get install freecad



會有一些訊息,發現這個程式應該跟「Qt」有關,之前有「一篇」跟這個議題相關的討論。


查詢


$ apt-cache show freecad | grep '^Depends:'



顯示


Depends: libsoqt4-20 (>= 1.6), python-collada, python-matplotlib, python-pivy (>= 0.5.0~v609hg-2), python-ply, python-pyside, pyside-tools, python:any (>= 2.6.6-7~), python2.7, libboost-program-options1.58.0, libboost-regex1.58.0, libboost-signals1.58.0, libboost-system1.58.0, libc6 (>= 2.14), libcoin80v5, libfreetype6 (>= 2.2.1), libgcc1 (>= 1:3.4), libgl1-mesa-glx | libgl1, libglu1-mesa | libglu1, liboce-foundation10, liboce-modeling10, liboce-ocaf-lite10, liboce-ocaf10, liboce-visualization10, libpython2.7 (>= 2.7), libqt4-network (>= 4:4.5.3), libqt4-opengl (>= 4:4.6.1), libqt4-svg (>= 4:4.5.3), libqt4-xml (>= 4:4.5.3), libqtcore4 (>= 4:4.8.0), libqtgui4 (>= 4:4.8.0), libqtwebkit4, libshiboken1.2v5 (>= 1.1.0), libspnav0 (>= 0.2.2), libstdc++6 (>= 5.2), libx11-6, libxerces-c3.1, libzipios++0v5, zlib1g (>= 1:1.1.4)



若要深入探究的話,您也可以執行下面指令,下載「freecad」的「Source Package」來探索。


$ apt-get source freecad




================================================================================

接下來,先執行「freecad」,
我去確認你附圖提到的那個地方,關於中文那部份是正常顯示的。
也就是「freecad」的功能選單,選「Edit / Preferences ...」,出現一個設定視窗,
在第一個頁籤「General」,有一個選項「General / Language / Change language:」。
切換成「中文」,界面也會正常切換成「中文」。


然後執行下面指令,找到「freecad」的「process id」


$ ps aux | grep freecad



顯示


user 5477 6.0 4.7 2424960 193144 ? Sl 10:26 0:21 /usr/bin/freecad
user 5685 0.0 0.0 12884 976 pts/1 S+ 10:32 0:00 grep --color=auto freecad




或是也可以執行下面指令,找到「freecad」的「process id」


$ pidof freecad



顯示


5477



然後執行下面指令,找到「freecad」開啟了那些跟font有關的檔案。
這個用法,我在「這篇」,「這篇」,「這篇」有提到。


$ lsof -p 5477 | grep font



顯示


freecad 5477 user mem REG 8,18 18748872 5121401 /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc
...略...



上面是有很多行,我只列出第一行,其他的就省略了

執行下面的指令,找到「/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc」是屬於那個套件。


$ dpkg -S /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc



顯示


fonts-noto-cjk: /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc



表示「/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc」是屬於「fonts-noto-cjk」這個套件。


================================================================================

另外,我個人的習慣,我會設定「sans-serif」「serif」「monospace」的查找順序,
這部份可以參考「這篇討論」。

以前我是習慣設定在「~/.config/fontconfig/fonts.conf」(個人區域),
現在我就直接設定在「/etc/fonts/local.conf」(系統全域)。
關於這個路徑,可以參考這篇「討論」,或是我之前的一些「探索紀錄」。


至於內容,
我個人的習慣是先透過「fcdesigner」產生「XML」,然後在純文字編輯器,編輯「XML」,設定字型查找順序。
當然也可以直接在「fcdesigner」調整順序,再產生最終的「XML」。

設定檔基本的內容架構如下(可以閱讀「$ man fonts.conf / CONFIGURATION FILE FORMAT)


<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>

</fontconfig>



由「fcdesigner」產生「XML」內容架構如下


<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- created by WenQuanYi FcDesigner v0.5 -->
<!-- http://wenq.org/cloud/fcdesigner_local.html -->
<match>
	<test name="family"><string>sans-serif</string></test>
	<edit name="family" mode="prepend" binding="strong">

		<string>DejaVu Sans</string>
		<string>Noto Sans CJK TC Regular</string>

		<!-- ...略... //-->

	</edit>
</match>
<match>
	<test name="family"><string>serif</string></test>
	<edit name="family" mode="prepend" binding="strong">

		<string>DejaVu Serif</string>
		<!-- Please install DejaVu Serif first -->

		<!-- ...略... //-->

	</edit>
</match>
<match>
	<test name="family"><string>monospace</string></test>
	<edit name="family" mode="prepend" binding="strong">

		<string>Liberation Mono</string>
		<string>Liberation Sans Mono</string>
		<!-- Please install Liberation Sans Mono first -->

		<!-- ...略... //-->

	</edit>
</match>
</fontconfig>



可以閱讀「$ man fonts.conf」或是「Ubuntu TW Wiki / HowtoCustomFontswithFontconfig」。

設定完後,可以使用「fc-match」來做測試,相關可以參考「這篇討論」,或是之前寫的這篇「fc-match的使用」。

================================================================================

一些字型的套件,我之前有列在下面這個網址,不過撰寫那時候的環境是在「Xubuntu 14.04」。

* http://samwhelp.github.io/book-ubuntu-basic-skill/book/content/font/font-package.html
* http://samwhelp.github.io/blog/read/linux/ubuntu/font/font-package/

或是可以執行下面指令,來查找


$ apt-cache search fonts



可以搭配「less」來分頁觀看


$ apt-cache search fonts | less



或是搭配「grep」來過濾觀看

例如


$ apt-cache search fonts | grep noto



顯示


fonts-noto-cjk - "No Tofu" font families with large Unicode coverage (CJK)
fonts-noto - metapackage to pull in all Noto fonts
fonts-noto-hinted - "No Tofu" font families with large Unicode coverage (hinted)
fonts-noto-mono - "No Tofu" monospaced font family with large Unicode coverage
fonts-noto-unhinted - "No Tofu" font families with large Unicode coverage (unhinted)



例如


$ apt-cache search fonts | grep arphic



顯示


fonts-arphic-bkai00mp - "AR PL KaitiM Big5" Chinese TrueType font by Arphic Technology
fonts-arphic-bsmi00lp - "AR PL Mingti2L Big5" Chinese TrueType font by Arphic Technology
fonts-arphic-gbsn00lp - "AR PL SungtiL GB" Chinese TrueType font by Arphic Technology
fonts-arphic-gkai00mp - "AR PL KaitiM GB" Chinese TrueType font by Arphic Technology
fonts-arphic-ukai - "AR PL UKai" Chinese Unicode TrueType font collection Kaiti style
fonts-arphic-uming - "AR PL UMing" Chinese Unicode TrueType font collection Mingti style
latex-cjk-chinese-arphic-bkai00mp - AR PL KaitiM Big5 fonts for CJK
latex-cjk-chinese-arphic-bsmi00lp - AR PL Mingti2L Big5 fonts for CJK
latex-cjk-chinese-arphic-gbsn00lp - AR PL SungtiL GB fonts for CJK
latex-cjk-chinese-arphic-gkai00mp - AR PL KaitiM GB fonts for CJK



例如


$ apt-cache search fonts | grep cns11643



顯示


fonts-cns11643-kai - Chinese TrueType font, TW-Kai
fonts-cns11643-sung - Chinese TrueType font, TW-Sung



然後執行下面指令,來觀看套件資訊


$ apt-cache show fonts-cns11643-kai



顯示


Package: fonts-cns11643-kai
Priority: extra
Section: multiverse/fonts
Installed-Size: 148411
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian Fonts Task Force <pkg-fonts-devel@lists.alioth.debian.org>
Architecture: all
Source: fonts-cns11643
Version: 98.1+20150923-2
Filename: pool/multiverse/f/fonts-cns11643/fonts-cns11643-kai_98.1+20150923-2_all.deb
Size: 59175924
MD5sum: c923d4d8cf062255919931e17a9dd98c
SHA1: 419ae9671cf57919fd90f46e08ff5e49bb900b8d
SHA256: 7076e02b43cea4adacd5bd949717994526613922afea1fbf4f578e95dd921af5
Description-en: Chinese TrueType font, TW-Kai
 The CNS 11643 character set (Chinese National Standard 11643),
 also officially known as the "Chinese Standard Interchange Code",
 is officially the standard character set of the Republic of China.
 (In practice, variants of Big5 are de facto standard.)
 .
 TW-Kai is released by RDEC, Executive Yuan, ROC.
 It covers the characters plane 1 to 9 defined by CNS11643.
Description-md5: ba10a1118a63ddf6a3e4788e30208e6f
Multi-Arch: foreign
Homepage: http://www.cns11643.gov.tw
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu



套件操作實務,請參這個「索引」。

================================================================================


若是要查詢已經安裝的套件,則要使用「dpkg

例如


$ dpkg -l 'fonts*' | grep ii



或是


$ dpkg -l '*fonts*' | grep ii



或是


$ dpkg -l | grep fonts | grep ii



例如


$ dpkg --get-selections | grep fonts



或是


$ dpkg --get-selections | grep fonts | grep install




================================================================================

若是要查詢已經安裝的字型檔案路徑,可以使用「fc-list」,
相關的執行範例,可以參考我之前寫的「如何使用「fc-list」這個指令

最基本的執行範例就是


$ fc-list



或是


$ fc-list | less



顯示


...略...
/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-BI.ttf: Ubuntu:style=Bold Italic
/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-B.ttf: Ubuntu:style=Bold
/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-C.ttf: Ubuntu Condensed:style=Regular
...略...



================================================================================

一些font相關的討論案例和一些額外參考,我之前有紀錄在下面幾個網址

* https://www.ubuntu-tw.org/modules/newbb/viewtopic.php?topic_id=95370&forum=14
* http://samwhelp.github.io/book-ubuntu-basic-skill/book/content/font/index.html
* http://samwhelp.github.io/book-ubuntu-qna/read/howto/configure-font/

================================================================================

以上提供參考

報告完畢


2017/2/11 11:55
應用擴展 工具箱
回覆: Freecad語言設定中,中文顯示方框問題請教
會員四級
註冊日期:
2007/11/25 1:18
所屬群組:
已註冊使用者
等級: 16
HP : 0 / 385
MP : 103 / 17509
EXP: 43
離線
哇!感謝您為我這問題回覆了這麼多內容!
我功力不足,得慢慢看,一步步來研究。先謝謝您!

2017/2/11 23:50
應用擴展 工具箱
回覆: Freecad語言設定中,中文顯示方框問題請教
會員四級
註冊日期:
2007/11/25 1:18
所屬群組:
已註冊使用者
等級: 16
HP : 0 / 385
MP : 103 / 17509
EXP: 43
離線
重灌系統,改裝 Xubuntu 16.10, 就沒有這個中文框框的問題。

2017/2/12 11:38
應用擴展 工具箱


 [無發表權] 請登錄或者註冊


可以查看帖子.
不可發帖.
不可回覆.
不可編輯自己的帖子.
不可刪除自己的帖子.
不可發起投票調查.
不可在投票調查中投票.
不可上傳附件.
不可不經審核直接發帖.