[solved] chinese words missing
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
[solved] chinese words missing
Hi,
I'm using dwg2pdf command to convert a drawing file.
But all the Chinese words couldn't be converted correctly.
-font-substitution not working either.
I'm using dwg2pdf command to convert a drawing file.
But all the Chinese words couldn't be converted correctly.
-font-substitution not working either.
- Attachments
-
- chinese-issue.pdf
- (737.91 KiB) Downloaded 386 times
-
- chinese-issue.dwg
- (328.94 KiB) Downloaded 376 times
Last edited by lloydzl on Fri Sep 10, 2021 11:09 am, edited 1 time in total.
Re: chinese words missing
Hi,
I assume that the in the dwg used font isn't installed on your machine.
As you can see it'll work if you have a font installed which can properly interpret the used characters. If not it will display an ? as a placeholder. BTW: I can't read Chinese - please consider my screenshot just as proof of concept.
Work smart, not hard: QCad Pro
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."
Re: chinese words missing
Thank you!
But I don't know which font the users use, how can I determine the font (or font name) the file uses? Then I can find and install it, or replace it with an existing one.
But I don't know which font the users use, how can I determine the font (or font name) the file uses? Then I can find and install it, or replace it with an existing one.
Re: chinese words missing
Good question! In a perfect world you just load the drawing. If you then notice that something went wrong with the text you just select the text and check the Property Editor to figure out which font was used. Then get the font, install it on your system and everything works as expected.
If I do that with your example drawing it will show that the "isocp" font was used. As we see that can't be correct what means this font is already an automatically substituted font during load or somebody who work previously on that drawing substitute the font and saved the drawing before you got it.
What I did to come close to a fix was just a try and error attempt. I know it has to be a font with Chinese characters, so I tried a Chinese font which I had on my system (HanWang KaiBold-Gb 5) and hoped for the best ...
Work smart, not hard: QCad Pro
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."
Re: chinese words missing
Great explanation! Thanks!
Another problem is I'm just using the command line tool on Linux, no GUI, like 'dwg2pdf -platform offscreen ...'
Is there any way to determine the font name so that I can use the option '-font-substitution FONT1 FONT2'?
Another problem is I'm just using the command line tool on Linux, no GUI, like 'dwg2pdf -platform offscreen ...'
Is there any way to determine the font name so that I can use the option '-font-substitution FONT1 FONT2'?
Re: chinese words missing
Hi,
What is the most intriging is that:
- Specific Property Text field
- Specific Property Plain Text field
- Text dialog
All show chinese characters but the text in model space renders as '???'.
The Block List and the Layer List show chinese characters too.
I have ISOCP.ttf installed but the font dropdown field shows 'isocp' as last at the bottom.
Meaning that 'isocp' is not the same as ISOCP.ttf as that sits higher in my font list.
Another test is to alter the font and verify if 'isocp' is still listed at the bottom.
In this case it disappears meaning that the font is not present on the system.
My ISOCP.ttf only includes some 200 characters: about 75% Basic Latin & Latin-1 Supplement
https://en.m.fontke.com/font/10067045/charset/
There are numerous different ISOCP.ttf files out there.
I suppose 'isocp' in the dwg is reffering to isocp.shx, an AutoCAD Compiled Shape File.
That 'isocp' is also associated with TTF by the icon in front is wrong here (known Qt issue).
QCAD doesn't handle shx files.
If I copy a character from the Specific Property Text field and paste it in Notepad I get the same glyph.
The font that Notepad uses is Arial.ttf but I don't get chinese characters using Arial in QCAD.
Same story when I paste it to Notepad++ that uses Courier New.
All rather weird.
Regards,
CVH
What is the most intriging is that:
- Specific Property Text field
- Specific Property Plain Text field
- Text dialog
All show chinese characters but the text in model space renders as '???'.
The Block List and the Layer List show chinese characters too.
I have ISOCP.ttf installed but the font dropdown field shows 'isocp' as last at the bottom.
Meaning that 'isocp' is not the same as ISOCP.ttf as that sits higher in my font list.
Another test is to alter the font and verify if 'isocp' is still listed at the bottom.
In this case it disappears meaning that the font is not present on the system.
My ISOCP.ttf only includes some 200 characters: about 75% Basic Latin & Latin-1 Supplement
https://en.m.fontke.com/font/10067045/charset/
There are numerous different ISOCP.ttf files out there.
I suppose 'isocp' in the dwg is reffering to isocp.shx, an AutoCAD Compiled Shape File.
That 'isocp' is also associated with TTF by the icon in front is wrong here (known Qt issue).
QCAD doesn't handle shx files.
If I copy a character from the Specific Property Text field and paste it in Notepad I get the same glyph.
The font that Notepad uses is Arial.ttf but I don't get chinese characters using Arial in QCAD.
Same story when I paste it to Notepad++ that uses Courier New.
All rather weird.
Regards,
CVH
Re: chinese words missing
Honestly - I don't know. Hopefully Andrew has an answer to your question.
Work smart, not hard: QCad Pro
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."
Re: chinese words missing
You can list the main fonts used in your file with:
Note that this will only list the main font of each text but not fonts that are used as part of the formatting.
For example if a text has its font name property set to "Arial" and the text contents is "ABC\fCourier|b0|i0|c0|p0;DEF", this command will list "Arial" but not "Courier". "Arial" is the font name property for the text whereas "Courier" is only used as part of its formatting.
Code: Select all
dwg2csv -f -t Text -p "Font Name" myfile.dxf
For example if a text has its font name property set to "Arial" and the text contents is "ABC\fCourier|b0|i0|c0|p0;DEF", this command will list "Arial" but not "Courier". "Arial" is the font name property for the text whereas "Courier" is only used as part of its formatting.
Re: chinese words missing
Thank you!
I've tried this method, but it couldn't extract the font name with my attached files, both '.dwg' and '.dxf'...
I've tried this method, but it couldn't extract the font name with my attached files, both '.dwg' and '.dxf'...
Code: Select all
dwg2csv -f -t Text -p "Font Name" chinese-issue.dwg
dwg2csv -f -t Text -p "Font Name" chinese-issue.dxf
andrew wrote: ↑Fri Sep 10, 2021 9:11 amYou can list the main fonts used in your file with:
Note that this will only list the main font of each text but not fonts that are used as part of the formatting.Code: Select all
dwg2csv -f -t Text -p "Font Name" myfile.dxf
For example if a text has its font name property set to "Arial" and the text contents is "ABC\fCourier|b0|i0|c0|p0;DEF", this command will list "Arial" but not "Courier". "Arial" is the font name property for the text whereas "Courier" is only used as part of its formatting.
- Attachments
-
- chinese-issue.dxf
- (1.92 MiB) Downloaded 356 times
-
- chinese-issue.dwg
- (328.94 KiB) Downloaded 367 times
Re: chinese words missing
Can you attach your CSV file that was generated?
Re: chinese words missing
Great! I found the font names in the csv file, thank you!
- Attachments
-
- chinese-issue.csv
- (1.16 KiB) Downloaded 377 times