Font display problem

If you are having problems with QCAD, post here. Please report bugs through our Bug Tracker instead.

Always attach your original DXF or DWG file and mentions your QCAD version and the platform you are on.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
WildWolfCJ
Full Member
Posts: 89
Joined: Fri Oct 20, 2023 7:21 am

Font display problem

Post by WildWolfCJ » Sat Oct 28, 2023 12:22 pm

QCAD3.28.2 WINDOWS10
The attachment is the original DXF file, which is displayed in AUTOCAD2020 and displayed in QCAD. Why does the red mark go out of bounds in QCAD? Why does the first line using the Microsoft Yahei font display normally, but the second line using the "SONGTI" font display incorrectly? "SONGTI" is a very commonly used font in Chinese, and the ZIT file is the "SONGTI" font
Attachments
simsun.zip
(9.35 MiB) Downloaded 384 times
Drawing1 - 副本 (2).dxf
(415.04 KiB) Downloaded 402 times
VeryCapture_20231028190614.jpg
VeryCapture_20231028190614.jpg (315.57 KiB) Viewed 11134 times
VeryCapture_20231028190708.jpg
VeryCapture_20231028190708.jpg (741.37 KiB) Viewed 11134 times

CVH
Premier Member
Posts: 4879
Joined: Wed Sep 27, 2017 4:17 pm

Re: Font display problem

Post by CVH » Sat Oct 28, 2023 1:47 pm

Not SONGTI but Simsum ... :wink:

Please measure up the height of the first glyph of the bottom text in Simsum with great detail in ACAD.
QCAD reports: 39.545454545454660 with 15-17 significant digits of the floating point double notation.

The last digits not repeating is a sign of a large number of FP operations which are not flawless.
But that won't matter here. :wink:

The bounding box around whole the text is 40.397727272727352 by 716.05391319207126 units long.
First and second Glyph: bbox = 39.715909090909165 by 83.522727272727295 units long
First Glyph: bbox = 39.545454545454660 by 39.886363636363782 units long
Second Glyph: bbox = 39.715909090909165 by 40.056818181818286 units long

Now add a capital 'A' at the end and measure up the height of that.
QCAD reports: 30.00000000... or 30 units exactly.
Font height is per definition the height of the capital 'A' glyph.

Now we have facts and figures that may or may not tell something.

Regards,
CVH

WildWolfCJ
Full Member
Posts: 89
Joined: Fri Oct 20, 2023 7:21 am

Re: Font display problem

Post by WildWolfCJ » Sun Oct 29, 2023 3:22 am

CVH wrote:
Sat Oct 28, 2023 1:47 pm
Not SONGTI but Simsum ... :wink:

Please measure up the height of the first glyph of the bottom text in Simsum with great detail in ACAD.
QCAD reports: 39.545454545454660 with 15-17 significant digits of the floating point double notation.

The last digits not repeating is a sign of a large number of FP operations which are not flawless.
But that won't matter here. :wink:
The bounding box around whole the text is 40.397727272727352 by 716.05391319207126 units long.
First and second Glyph: bbox = 39.715909090909165 by 83.522727272727295 units long
First Glyph: bbox = 39.545454545454660 by 39.886363636363782 units long
Second Glyph: bbox = 39.715909090909165 by 40.056818181818286 units long

Now add a capital 'A' at the end and measure up the height of that.
QCAD reports: 30.00000000... or 30 units exactly.
Font height is per definition the height of the capital 'A' glyph.

Now we have facts and figures that may or may not tell something.

Regards,
CVH
HI CVH
I tested the height of the first text in AUTOCAD 2020 (I don't know if my approach is correct
), the first test height was 38.9732, the second test height was 39.1265, and then added an A, the test height was 29.4142
The bounding box around whole the text is 40.397727272727352 by 716.05391319207126 units long.
How to test the text border using the command line tool ?
Is there a way to make QCAD and AUTOCAD display the same?
Attachments
VeryCapture_20231029100225.jpg
VeryCapture_20231029100225.jpg (218.72 KiB) Viewed 11056 times
VeryCapture_20231029100431.jpg
VeryCapture_20231029100431.jpg (230.76 KiB) Viewed 11056 times
VeryCapture_20231029100715.jpg
VeryCapture_20231029100715.jpg (182.79 KiB) Viewed 11056 times

CVH
Premier Member
Posts: 4879
Joined: Wed Sep 27, 2017 4:17 pm

Re: Font display problem

Post by CVH » Sun Oct 29, 2023 7:29 am

WildWolfCJ wrote:
Sun Oct 29, 2023 3:22 am
and then added an A, the test height was 29.4142
ACAD breaks with the rule that the Text Height property is the height of the glyph of a capital 'A'.
So sorry, the height is only about 98% (f=0,98047138047 given it is point 414141...)

This scale affects the length of whole the text too :(

Very similar as this apart from that I needed to work with the crude JPG pixel data:
CVH wrote:
Sat Oct 28, 2023 7:32 am
When I merge VeryCapture_20231028132736.jpg with the dxf and scale the image for matching bounding boxes ...
The lower one is a fairly good match when setting X-Scale to about 0.97 and Line Spacing to 1.18
Although the numbers don't really add up:
38.9732 / 39.5454545454 => 0.98552919653509103 +/-1.26e-6
38.9732 / 39.7159090909 => 0.98129945636646210 +/-1.26e-6
39.1265 / 39.7159090909 => 0.98515937052955311 +/-1.26e-6
29.4142 / 30.0000000000 => 0.98047333333333333 +/-1.67e-6


Please use something similar as a bounding box in ACAD to figure out the correct factor.
The more precise the values are the better the factors will match.
Also verify the width data that I provided.

Does everything has a different height after adding the capital 'A'?
... =Dynamic scaling

Regards
CVH

WildWolfCJ
Full Member
Posts: 89
Joined: Fri Oct 20, 2023 7:21 am

Re: Font display problem

Post by WildWolfCJ » Sun Oct 29, 2023 12:07 pm

CVH wrote:
Sun Oct 29, 2023 7:29 am
WildWolfCJ wrote:
Sun Oct 29, 2023 3:22 am
and then added an A, the test height was 29.4142
ACAD breaks with the rule that the Text Height property is the height of the glyph of a capital 'A'.
So sorry, the height is only about 98% (f=0,98047138047 given it is point 414141...)

This scale affects the length of whole the text too :(

Very similar as this apart from that I needed to work with the crude JPG pixel data:
CVH wrote:
Sat Oct 28, 2023 7:32 am
When I merge VeryCapture_20231028132736.jpg with the dxf and scale the image for matching bounding boxes ...
The lower one is a fairly good match when setting X-Scale to about 0.97 and Line Spacing to 1.18
Although the numbers don't really add up:
38.9732 / 39.5454545454 => 0.98552919653509103 +/-1.26e-6
38.9732 / 39.7159090909 => 0.98129945636646210 +/-1.26e-6
39.1265 / 39.7159090909 => 0.98515937052955311 +/-1.26e-6
29.4142 / 30.0000000000 => 0.98047333333333333 +/-1.67e-6


Please use something similar as a bounding box in ACAD to figure out the correct factor.
The more precise the values are the better the factors will match.
Also verify the width data that I provided.

Does everything has a different height after adding the capital 'A'?
... =Dynamic scaling

Regards
CVH

HICVH
So is this problem a QCAD bug? I tested different fonts using three different software. Two of them were normal. Only QCAD displayed some fonts incorrectly. Can QCAD update a new version to solve this problem? Attached are three software display effects
Attachments
VeryCapture_20231029190023.jpg
VeryCapture_20231029190023.jpg (957.45 KiB) Viewed 10988 times
VeryCapture_20231029190110.jpg
VeryCapture_20231029190110.jpg (510.56 KiB) Viewed 10988 times
VeryCapture_20231029190142.jpg
VeryCapture_20231029190142.jpg (382.42 KiB) Viewed 10988 times

CVH
Premier Member
Posts: 4879
Joined: Wed Sep 27, 2017 4:17 pm

Re: Font display problem

Post by CVH » Sun Oct 29, 2023 7:42 pm

WildWolfCJ wrote:
Sun Oct 29, 2023 12:07 pm
Only QCAD displayed some fonts incorrectly.
If the height of the glyph of the capital 'A' matches the Text Height property there is nothing wrong with how QCAD renders text.
I don't think that text rendering under QCAD will be altered.

Just because thousands of people drive through red lights every day doesn't mean we need to change the rules.

For me, simply another user, the cause has been determined, the problem is known and I consider the matter closed.

Regards,
CVH

Post Reply

Return to “QCAD Troubleshooting and Problems”