Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#7105 closed defect (fixed)

DXF: Don't output dx and dy values in MTEXT style strings

Reported by: Alan Thomas Owned by: warmerdam
Priority: normal Milestone:
Component: OGR_SF Version: svn-trunk
Severity: normal Keywords: dxf
Cc:

Description

According to the OGR feature style spec, dx and dy values in LABEL style strings relate to offsets from the insertion point. They are used correctly in TEXT entities, but in MTEXT the X and Y components of the unit vector that indicates the text direction are emitted as dx and dy values, which makes no sense.

Patch is to remove lines 633-643 of ogrdxflayer.cpp.

Unfortunately there is no way to derive two alignment points for MTEXT entities in the same way that we do for TEXT - the DXF format just doesn't contain enough information. Users will have to make do with the insertion point combined with the alignment (p) value.

Attachments (2)

mtext-dx-dy.dxf (310.2 KB ) - added by Alan Thomas 6 years ago.
Test case
mtext-dx-dy.png (25.1 KB ) - added by Alan Thomas 6 years ago.
Screenshot of test case in AutoCAD (note I turned on "text frames" to aid visualisation of the MTEXT entities)

Download all attachments as: .zip

Change History (6)

comment:1 by Even Rouault, 6 years ago

This is a recent addition per : https://trac.osgeo.org/gdal/changeset/39335 / https://github.com/OSGeo/gdal/pull/225 . I don't have myself an informed opinion on what is appropriate

by Alan Thomas, 6 years ago

Attachment: mtext-dx-dy.dxf added

Test case

by Alan Thomas, 6 years ago

Attachment: mtext-dx-dy.png added

Screenshot of test case in AutoCAD (note I turned on "text frames" to aid visualisation of the MTEXT entities)

comment:2 by Alan Thomas, 6 years ago

The two MTEXT entities in this case are differently sized, one being single-line and the other being multiline, but their 11/21/31 direction vectors are the same (and they are also a unit vector - I don't think this is a coincidence).

We don't need to store this direction vector information in the style string for MTEXTs, because we compute the angle from these components, and the angle is already in the style string.

comment:3 by Alan Thomas, 6 years ago

Resolution: fixed
Status: newclosed

In 40952:

DXF: Don't output dx and dy in MTEXT style strings (fixes #7105)

comment:4 by Alan Thomas, 6 years ago

For posterity I will note that there was additional discussion in the pull request https://github.com/OSGeo/gdal/pull/225.

Note: See TracTickets for help on using tickets.