#3392 closed defect (fixed)
DGN Driver does not preserve font name in text features
Reported by: | manelclos | Owned by: | chaitanya |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | OGR_SF | Version: | unspecified |
Severity: | normal | Keywords: | dgn |
Cc: | warmerdam |
Description (last modified by )
While reading a DGN, the font name is missing in the style, which results in information loss.
Font name "INTL_WORKING" is not shown and discarded when writing the feature to another DGN file.
Running version 1.5.2, so perhaps this is solved in SVN -> font_id? http://trac.osgeo.org/gdal/browser/trunk/gdal/ogr/ogrsf_frmts/dgn/dgnread.cpp
$ ogrinfo font_name.dgn elements INFO: Open of `font_name.dgn' using driver `DGN' successful. Layer name: elements Geometry: Unknown (any) Feature Count: 1 Extent: (485373.153000, 4647774.904000) - (485417.999000, 4647782.905000) Layer SRS WKT: (unknown) Type: Integer (2.0) Level: Integer (2.0) GraphicGroup: Integer (4.0) ColorIndex: Integer (3.0) Weight: Integer (2.0) Style: Integer (1.0) EntityNum: Integer (0.0) MSLink: Integer (0.0) Text: String (0.0) OGRFeature(elements):17 Type (Integer) = 17 Level (Integer) = 62 GraphicGroup (Integer) = 0 ColorIndex (Integer) = 21 Weight (Integer) = 1 Style (Integer) = 0 EntityNum (Integer) = (null) MSLink (Integer) = (null) Text (String) = Font Name Test Style = LABEL(t:"Font Name Test",c:#f000f0,s:4.000g) POINT (485373.152999999991152 4647776.904000000096858)
Attachments (1)
Change History (11)
by , 14 years ago
Attachment: | font_name.dgn added |
---|
comment:1 by , 14 years ago
Cc: | added |
---|---|
Component: | default → OGR_SF |
Description: | modified (diff) |
Keywords: | dgn added |
Owner: | changed from | to
Chaitanya,
Could you look into this?
comment:2 by , 14 years ago
Status: | new → assigned |
---|
Frank,
The font in DGN format is stored as a single byte pointing to the font name in a Microstation resource file, which I couldn't get a hold of. As of now, the only font id I could find is for 'INTL_WORKING', 33.
For now I want to represent the fonts as MstnFont<byte value>. This doesn't help in translations from or to other formats but will work well for editing DGN files.
comment:3 by , 14 years ago
Agreed, please go ahead.
You might also consider emailing the dgnlib mailing list and ask if anyone is aware of a way to turns these codes into more normal font names.
comment:4 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Added the support for font and a test to read and write the font name in the trunk(r24137).
follow-up: 6 comment:5 by , 12 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
r24137 makes compiler to warn loudly. Seems to be const related
ogrdgnlayer.cpp: In member function ‘DGNElemCore** OGRDGNLayer::TranslateLabel(OGRFeature*)’: ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’ ogrdgnlayer.cpp:948: warning: deprecated conversion from string constant to ‘char*’
comment:6 by , 12 years ago
Replying to rouault: Even, I couldn't find an easy workaround to avoid this warning. Can you suggest something?
follow-up: 8 comment:7 by , 12 years ago
I haven't looked in detail. But it must be a matter of changing char* to const char*, or something like that.
For reference, my env is Ubuntu 10.04 with gcc (Ubuntu 4.4.3-4ubuntu5.1) 4.4.3
comment:8 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
comment:9 by , 12 years ago
I have taken the liberty to revert the last change and just do a single cast to (char ). The cast is (unfortunately) necessary since most of the CSL functions were not create with an appropriate constness.
But I found dynamically creating the list quite unfortunate.
Thanks for addressing the core problem!
DGN v7 with a text feature