[ReOpened] Problem with Draft Text display
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
[ReOpened] Problem with Draft Text display
Hello, Chinese Text can't be displayed correctly, can any one help me? thanks.
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.19510 (Git)
Build type: Release
Branch: master
Hash: c3eb6d9001c4d60ff7f7cae89f50bd3c965a9940
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Chinese/China (zh_CN)
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.19510 (Git)
Build type: Release
Branch: master
Hash: c3eb6d9001c4d60ff7f7cae89f50bd3c965a9940
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Chinese/China (zh_CN)
Last edited by Kunda1 on Fri Mar 13, 2020 11:44 am, edited 2 times in total.
Reason: ReOpened issue
Reason: ReOpened issue
Re: Problem with Draft Text display
Moved to Draft subforum
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: Problem with Draft Text display
Maybe you can also try asking guys in 中文论坛 / 中文論壇(简体 / 繁體)rock wrote: ↑Sat Feb 08, 2020 1:57 pm Hello, Chinese Text can't be displayed correctly, can any one help me? thanks.
draft.PNG
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.19510 (Git)
Build type: Release
Branch: master
Hash: c3eb6d9001c4d60ff7f7cae89f50bd3c965a9940
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Chinese/China (zh_CN)
Re: Problem with Draft Text display
This seems to be related to fonts.
Apparently very few fonts on my system are able to display all chinese characters. I found this one that does it partially: Would be interesting if you can post here a font that is known to display it all?
Apparently very few fonts on my system are able to display all chinese characters. I found this one that does it partially: Would be interesting if you can post here a font that is known to display it all?
Re: Problem with Draft Text display
Some DBCS-related issues, I found in FreeCAD. (0.18.4/ 0.19pre, Win10x64)
2. DraftWB, Dimension>Overide, doesnot print Chinese text on viewport.
[SOLVED] 3. DraftWB, ShapeString donnot apply Chinese font filename (not font family name).
4. DraftWB, dAnno save Chinese text as messy code, and print nothing on viewport.
ps. workaround: edit dAnnot text property, and input Chineset text again. This time dAnno can save Chinese text correcty, and print UTF-16 code on viewport. While dLable has no this issue. 5. On Windows10x64, only Arial (arial.ttf) and Courier (cour.ttf) can be apply to DraftWB's dAnnno/dLabel/Dimension. Fallback font is FreeCAD's internal font. All these fonts (arial/courier/internal) donnot support DBCS/CJK.
https://forum.freecadweb.org/viewtopic.php?f=23&t=38305
6. Preferences> Genereral> Editor> Family, donnot save Chinese font family name in "user.cfg" file.
https://forum.freecadweb.org/viewtopic.php?f=34&t=42803
https://bbs.csdn.net/topics/390094759
1. DraftWB, dAnno and dLabel print Chinese characer in UTF-16 code (not as Chinese font glyph).2. DraftWB, Dimension>Overide, doesnot print Chinese text on viewport.
[SOLVED] 3. DraftWB, ShapeString donnot apply Chinese font filename (not font family name).
4. DraftWB, dAnno save Chinese text as messy code, and print nothing on viewport.
ps. workaround: edit dAnnot text property, and input Chineset text again. This time dAnno can save Chinese text correcty, and print UTF-16 code on viewport. While dLable has no this issue. 5. On Windows10x64, only Arial (arial.ttf) and Courier (cour.ttf) can be apply to DraftWB's dAnnno/dLabel/Dimension. Fallback font is FreeCAD's internal font. All these fonts (arial/courier/internal) donnot support DBCS/CJK.
https://forum.freecadweb.org/viewtopic.php?f=23&t=38305
6. Preferences> Genereral> Editor> Family, donnot save Chinese font family name in "user.cfg" file.
https://forum.freecadweb.org/viewtopic.php?f=34&t=42803
https://bbs.csdn.net/topics/390094759
- Attachments
-
- fc019pre_font-test.FCStd
- (241.07 KiB) Downloaded 155 times
Last edited by fc_tofu on Fri Mar 13, 2020 10:42 am, edited 13 times in total.
- wandererfan
- Veteran
- Posts: 6326
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: Problem with Draft Text display
In the python console, can you try the following for me please?
Code: Select all
>>> import Part
>>> myCJKString = "something in CJK chars"
>>> myCJKFont = "CJKName.ttf" #real CJK font file please!
>>> ws = Part.makeWireString(myCJKString, myCJK, 100.0, 0.0)
Thanks,
wf
Re: Problem with Draft Text display
@yorik, some Chinese fonts download.
1. Google DroidSansFallback (developed for Android, opensource)
https://packages.debian.org/sid/all/fon ... k/download
2. Google Noto Sans/Serif CJK (successor of DroidSansFallback, opensource)
https://www.google.com/get/noto/
3. HYSWLongFangSong (suitable for Chinese CAD drawing, unkown copyright)
http://gd.ddooo.com:8081/uuauth/hycfst_ ... df9717.rar
1. Google DroidSansFallback (developed for Android, opensource)
https://packages.debian.org/sid/all/fon ... k/download
2. Google Noto Sans/Serif CJK (successor of DroidSansFallback, opensource)
https://www.google.com/get/noto/
3. HYSWLongFangSong (suitable for Chinese CAD drawing, unkown copyright)
http://gd.ddooo.com:8081/uuauth/hycfst_ ... df9717.rar
Last edited by fc_tofu on Thu Feb 13, 2020 1:52 pm, edited 2 times in total.
Re: Problem with Draft Text display
Thank you, wandererfan.wandererfan wrote: ↑Thu Feb 13, 2020 12:34 am In the python console, can you try the following for me please?Code: Select all
>>> import Part >>> myCJKString = "something in CJK chars" >>> myCJKFont = "CJKName.ttf" #real CJK font file please! >>> ws = Part.makeWireString(myCJKString, myCJK, 100.0, 0.0)
There is a typo in your code, in line 3, "myCJK" should be "myCJKFont". I fixed it and made 3 test.
Test 1, English font with English filename
(before test, get fontfile full path "C:\Windows\Fonts\cour.ttf")
Code: Select all
import Part
myCJKString = "ShapeString test on English font filename."
myCJKFont = "C:\Windows\Fonts\cour.ttf"
ws = Part.makeWireString(myCJKString, myCJKFont, 100.0, 0.0)
Test 2, Chinese font with Chinese filename
(before test, get fontfile full path "C:\Windows\Fonts\汉仪长仿宋体.ttf")
Code: Select all
import Part
myCJKString = "ShapeString的测试:字体文件的中文名。"
myCJKFont = "C:\Windows\Fonts\汉仪长仿宋体.ttf"
ws = Part.makeWireString(myCJKString, myCJKFont, 100.0, 10.0)
Code: Select all
Traceback (most recent call last):
File "<input>", line 1, in <module>
Part.OCCError: Font file not found: C:\Windows\Fonts\汉仪长仿宋体.ttf
(before test, rename "C:\Windows\Fonts\汉仪长仿宋体.ttf" to "C:\Windows\Fonts\HYSWLongFangSong.ttf")
Code: Select all
import Part
myCJKString = "ShapeString的测试:字体文件的中文名。"
myCJKFont = "C:\Windows\Fonts\HYSWLongFangSong.ttf"
ws = Part.makeWireString(myCJKString, myCJKFont, 100.0, 10.0)
ps.
Chinese font file, named "汉仪长仿宋体.ttf" (same as my above post to @yorik).
http://gd.ddooo.com:8081/uuauth/hycfst_ ... df9717.rar
- wandererfan
- Veteran
- Posts: 6326
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: Problem with Draft Text display
Great, thanks. This means we need some changes to makeWireString and the C++ routines that support it.fc_tofu wrote: ↑Thu Feb 13, 2020 11:25 am result: nothing happend to viewport, but error msg in consoleCode: Select all
Traceback (most recent call last): File "<input>", line 1, in <module> Part.OCCError: Font file not found: C:\Windows\Fonts\汉仪长仿宋体.ttf
To see the result of ws = Part.makeWireString, add "Part.show(ws)" .
- wandererfan
- Veteran
- Posts: 6326
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: Problem with Draft Text display
Is everybody experiencing this problem running Windows and version18?
I thought I'd just run some checks before making code changes, and on freecad-daily CJK in the filename doesn't seem to be an issue for ShapeString or makeWireString.
OS: Linux Mint 19 (X-Cinnamon/cinnamon)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Python version: 3.6.9
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Canada (en_CA)