[PATCH sk1libs] import/dxf: Use style's primaty font name in TEXT
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
sK1 |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
In my DXF I have lots of TEXT entries which reference ST style as
attribute 7. And ST style itself looks like this:
0
STYLE
5
FF
330
3
100
100
2
ST
70
0
40
0.0
41
1.0
50
15.0
71
0
42
3.0
3
geniso.shx
4
So when load_text() tries to extract font_name from style['1000'] there
is nothing, and oops, I get lot's of crashes on TEXT nodes, e.g. like
this:
DXFLoader: error
Traceback (most recent call last):
File "/home/
return_code = method()
File "/home/
File "/home/
if fontname.
AttributeError: 'NoneType' object has no attribute 'count'
According to DXF specification (I've checked R14 and 2011) "Primary font
file name" for a STYLE is attribute 3, so I think we should always try
to get font_name from there.
I don't know where attribute 1000 comes from (can't find a reference to it in
dxf spec), but if it is needed, let's leave a check for style['1000'] first so
that old behaviour is preserved, and we only use style['3'] when style['1000']
fails.
Doing so, resolves crashes and also makes text appear in destination SVG!
(tested with unioconvertor)
Please apply and thanks,
Kirill
Changed in sk1: | |
status: | New → Confirmed |
This is not enough.
shx fonts are not supported anyway, the need to create an alias for ttf fonts.
For ttf font style['1000 '] contains information about the font family name.
In style['3'] contains the name of the font file.
To correct the error must be improved ft2engine.
Thanks.