- Status Closed
- Percent Complete
- Task Type Bug Report
- Category QCAD (main)
-
Assigned To
andrew - Operating System All
- Severity Low
- Priority Very Low
- Reported Version 3.29.6
- Due in Version Undecided
-
Due Date
Undecided
- Votes
- Private
FS#2462 - \A..{} tag not handled or ignored in files imported from other software
I’ve opened an existing, old dwg file in the Professional Trial edition, file(1) says it’s “DWG AutoDesk AutoCAD 2004/2005/2006”.
It contains (among other stuff) a floor plan with areas in m^2. A PDF export (from the original software used at the time, probably autocad) shows that this was displayed correctly.
However, in QCAD, I get a “\A1” and a very small number 2 instead. I’ll attach screenshots.
Loading...
Available keyboard shortcuts
- Alt + ⇧ Shift + l Login Dialog / Logout
- Alt + ⇧ Shift + a Add new task
- Alt + ⇧ Shift + m My searches
- Alt + ⇧ Shift + t focus taskid search
Tasklist
- o open selected task
- j move cursor down
- k move cursor up
Task Details
- n Next task
- p Previous task
- Alt + ⇧ Shift + e ↵ Enter Edit this task
- Alt + ⇧ Shift + w watch task
- Alt + ⇧ Shift + y Close Task
Task Editing
- Alt + ⇧ Shift + s save task
Hi,
So far I used the squared symbol U+00b2 with TTF fonts what is also on my keyboard.
Or the rich text variant \S2^; what is supported by the QCAD Text Editor.
Regards,
CVH
Please attach the DXF file in question.
Note that QCAD does not support all text codes of the DXF/DWG format.
Thanks for looking at this. Is there a way to send this to you privately? I don't want to distribute this file publicly.
Perhaps this helps a bit - I saved as DXF and looked inside the file, and this is the corresponding text, I think:
{21,88 m\A1{\H0.7x;\S2^ ;}}
Copy/paste the text in question into a new dxf, save it and attache that new file to your post
Thomas,
21,88 m\A1{\H0.7x;\S2^ ;}
with or without the extra curly brackets
does indeed display as 'from QCAD.png'
The solution I used is menu Edit .. Find/Replace (RP)
Find = m\A1{
Replace = m{
Not a regular expression .. OK
It is indeed a small 2 because it is scaled times 0.7 and in uppercase ...
If the font supports it then you could replace m\A1{\H0.7x;\S2^ ;} with m²
Regards,
CVH
I copy'n'pasted the text to a new file as Husky suggested.
Thomas,
I think there is an uncaught syntax here.
Height reduction is supported: \H0.7x; ...
... Changes the text height to a multiple of the current text height from this point of.
Stacked text is also supported: \S2^ ; ... a 2 over a space.
But QCAD already reduces the individual text height to 40% to fit it on the text line.
You then get a 70% height of the stacked text or glyph's that are reduced to 28%.
I think that \A1; is not supported: Center Alignment
We expect something as \A1;{...} ... Center Align what is inside the curly brackets.
\A1 itself is not caught of as syntax in RTextRenderer.cpp and thus simply displayed as such.
Add a semicolon to it and it will not be rendered.
Regards,
CVH
Indeed - looks like that is an unsupported syntax in QCAD
@Thomas
A ACAD product will render this correctly. According to the www many other application struggle with that format.
Playing around convinced me that the QCAD "Find and Replace" tool can't cover that format adequate. I had more luck with a text editor editing the dxf file directly. The benefits of that could be that you can run a batch command on all files in a directory within a few seconds. Of course - it makes only sense if you have a bunch of those drawings!
Attached a screenshot after editing the file directly. Note: The curled bracket at the beginning of the line is difficult to mask - I left it alone because most likely you will destroy other things in the drawing what made me accept it as a "Leftover". It has no effect on the text line rendering!
This is only a workaround! However - If you like me to test it on a whole file send a drawing via PM to me. I'll keep it confidential!
If you test it by yourself make sure you only use backed up files until you are certain that it will work as expected!
Thank you, Husky and CVH, for the detailed explanations.
I've edited the DXF file manually to replace \A1{...} with ² and it looks ok now.
There are other \A1; in the file with a ";" and those are not shown, so the main problem seems to be that the conversion of DWG→DXF created "\A1" instead of "\A1;".
Would be good to get that fixed.
Is there documentation where I can look up what \A1; and \S2 etc mean?
Thanks again!
I looked at:
https://help.autodesk.com/view/ACDLT/2019/ENU/?guid=GUID-7D8BB40F-5C4E-4AE5-BD75-9ED7112E5967 https://adndevblog.typepad.com/autocad/2017/09/dissecting-mtext-format-codes.html
@Husky: Why is there still an opening curly bracket in {21,88 m² ?
@Thomas: I don't think this is DWG→DXF conversion related.
We can look up things textual in a DXF ...
... A DWG is binary and a textual comparison is out of the question.
QCAD simply doesn't align text vertical inside a text line.
And it supports stacked text in its own way.
This conversation is rather something for the forum ...
Regards,
CVH
Thanks for the links, CVH!
I think it is conversion related because in other places in the converted file, there are also "\A1" but with a semicolon right afterwards, i.e. "\A1;". Perhaps they are not supported in QCAD, but they are not displayed either, so they are ignored silently.
But there are places (in particular my example) where the DXF has "\A1" without a semicolon, and this is not recognized as a command (rightly so, if I understand the command set correctly) and thus displayed.
That these (without the semicolon) appear in the DXF is what I see as the bug.
Thomas,
Meaning that you see a difference between a DWG and a DXF of the same drawing.
Then you need to attach both versions.
Regards,
CVH
Thomas:
"That these (without the semicolon) appear in the DXF is what I see as the bug."
All depends if the semicolon is missing in the original DWG or not.
Qcad will only catch of the correct syntax.
It looks for the backslash + A + a number digit in a capture group + a semicolon:
https://github.com/qcad/qcad/blob/2215d3239612de944f465c0dc49dcd7d99d76b2a/src/core/RTextRenderer.cpp#L96
Without a match it considers it as plain text being '\A1' literal.
Regards,
CVH