File: style_table.rst

package info (click to toggle)
ezdxf 1.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 104,528 kB
  • sloc: python: 182,341; makefile: 116; lisp: 20; ansic: 4
file content (152 lines) | stat: -rw-r--r-- 3,784 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
.. _style_table_internals:

STYLE Table
===========

The `STYLE`_ table stores all text styles and shape-file definitions. The "STANDARD"
entry must always exist.

Shape-files are also defined by a STYLE table entry, the bit 0 of the flags-tag is
set to 1 and the name-tag is an empty string, the only important data is the font-tag
with group code 3 which stores the associated SHX font file.

.. seealso::

    - DXF Reference: `TABLES Section`_
    - DXF Reference: `STYLE`_ Table
    - :class:`~ezdxf.entities.Textstyle` class


Table Structure DXF R12
-----------------------

.. code-block:: none

    0           <<< start of table
    TABLE
    2           <<< table type
    STYLE
    70           <<< count of table entries, AutoCAD ignores this value
    1
    0           <<< first table entry
    STYLE
    2           <<< text style name
    Standard
    70          <<< flags, see `STYLE`_ reference
    0
    40          <<< fixed text height; 0 if not fixed
    0.0
    41          <<< width factor
    1.0
    50          <<< oblique angle
    0.0
    71          <<< text generation flags; 2=backwards (mirror-x), 4=upside down (mirror-y)
    0
    42          <<< last height used
    2.5
    3           <<< font file name; SHX or TTF file name
    txt
    4           <<< big font name; SHX file with unicode symbols; empty if none

    0           <<< next text style
    STYLE
    ...
    0           <<< end of STYLE table
    ENDTAB


Table Structure DXF R2000+
--------------------------

.. code-block:: none

    0           <<< start of table
    TABLE
    2           <<< table type
    STYLE
    5           <<< table handle
    5
    330         <<< owner tag, tables have no owner
    0
    100         <<< subclass marker
    AcDbSymbolTable
    70           <<< count of table entries, AutoCAD ignores this value
    1
    0           <<< first table entry
    STYLE
    5           <<< handle of text style
    29
    330         <<< owner handle, handle of STYLE table
    5
    100         <<< subclass marker
    AcDbSymbolTableRecord
    100         <<< subclass marker
    AcDbTextStyleTableRecord
    2           <<< text style name
    Standard
    70          <<< flags, see `STYLE`_ reference
    0
    40          <<< fixed text height; 0 if not fixed
    0.0
    41          <<< width factor
    1.0
    50          <<< oblique angle
    0.0
    71          <<< text generation flags; 2=backwards (mirror-x), 4=upside down (mirror-y)
    0
    42          <<< last height used
    2.5
    3           <<< font file name; SHX or TTF file name
    txt
    4           <<< big font name; SHX file with unicode symbols; empty if none

    0           <<< next text style
    STYLE
    ...
    0           <<< end of STYLE table
    ENDTAB

Extended Font Data
------------------

Additional information of the font-family, italic and bold style flags are stored in the
XDATA section of the STYLE entity by the APPID "ACAD":

.. code-block:: none

    0
    STYLE
    ...
    3
    Arial.ttf
    4

    1001        <<< start of the XDATA section
    ACAD        <<< APPID
    1000        <<< font family name
    Arial
    1071        <<< style flags, see table below
    50331682

======= =========== =========
Flag    dec         hex
======= =========== =========
ITALIC  16777216    0x1000000
BOLD    33554432    0x2000000
======= =========== =========

Name References
---------------

STYLE table entries are referenced by name:

    - TEXT entity
    - MTEXT entity
    - DIMSTYLE table entry
    - DIMSTYLE override



.. _STYLE: https://help.autodesk.com/view/OARX/2018/ENU/?guid=GUID-EF68AF7C-13EF-45A1-8175-ED6CE66C8FC9

.. _TABLES Section: http://help.autodesk.com/view/OARX/2018/ENU/?guid=GUID-A9FD9590-C97B-4E41-9F26-BD82C34A4F9F