[gdal-dev] ogr2ogr dxf font

andrew terry andrew.terry at centremaps.co.uk
Tue Sep 15 07:58:52 PDT 2020


I'm trying to use a specific font required by a client and i've created a
header file including "Romans" as a font but despite doing so, the font
always seems to be created in a new AutoTextStyle type.

For some fonts, this comes in as AutoTextStyle1 (or 2, 3, 4 etc to avoid
duplicating anything in the header) and the font assigned (e.g. Arial) works
but i was having problems with Romans in AutoDesk AutoCAD and it would end
up using simple.shx

ogr2ogr -f "DXF" test.dxf -dsco HEADER=.\header_romans.dxf
PG:"host=localhost port=5432 dbname=database user=username" -sql "SELECT
'LABEL(f:\"Romans\",s:\"1600\",t:\"Example label\",a:\"0\",p:\"10\")' AS
OGR_STYLE, 'SRID=27700;POINT(100 100)'::geometry geometry"

I've found that i can get this to work by using f:\"romans.shx\"

However, i suspect this could conflict if a user brings the data alongside
another drawing already using AutoTextStyle1 etc.

I'm using GDAL 3.0.4

I did come across the section "Store the text style in the map" on
which seems to be running some logic to decide whether to assign a new
AutoTextStyle-%d . I'm not able to confirm whether that logic all makes

I appreciate DXF is somewhat of a legacy format but any help appreciated.


Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html

More information about the gdal-dev mailing list