zjf
2023-03-06 392b76515f40376b6d36f40a114850ef63650384
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
/////////////////////////////////////////////////////////////////////////////// 
// Copyright (C) 2002-2016, Open Design Alliance (the "Alliance"). 
// All rights reserved. 
// 
// This software and its documentation and related materials are owned by 
// the Alliance. The software may only be incorporated into application 
// programs owned by members of the Alliance, subject to a signed 
// Membership Agreement and Supplemental Software License Agreement with the
// Alliance. The structure and organization of this software are the valuable  
// trade secrets of the Alliance and its suppliers. The software is also 
// protected by copyright law and international treaty provisions. Application  
// programs incorporating this software must include the following statement 
// with their copyright notices:
//   
//   This application incorporates Teigha(R) software pursuant to a license 
//   agreement with Open Design Alliance.
//   Teigha(R) Copyright (C) 2002-2016 by Open Design Alliance. 
//   All rights reserved.
//
// By use of this software, its documentation or related materials, you 
// acknowledge and accept the above terms.
///////////////////////////////////////////////////////////////////////////////
 
 
 
 
#ifndef _ODDBTEXTSTYLETABLERECORD_INCLUDED
#define _ODDBTEXTSTYLETABLERECORD_INCLUDED
 
#include "TD_PackPush.h"
 
#include "DbSymbolTableRecord.h"
 
/** \details
  <group OdDb_Classes>
 
  This class implements the /text style record/ object, which represents a text style in 
  the database. This class inherits the base functionality of named records. 
 
  \sa
  TD_Db
    
  \sa
  <link db_textstyle_sample_table.html, Example of Working with the Text Style Table Object>
 
  <link db_textstyle_sample_record.html, Example of Working with the Text Style Record Object>
 
  \sa
  <link db_textstyle.html, Working with Text Styles>
 
  OdDbTextStyleTable class
*/
class TOOLKIT_EXPORT OdDbTextStyleTableRecord : public OdDbSymbolTableRecord
{
public:
  ODDB_DECLARE_MEMBERS(OdDbTextStyleTableRecord);
 
  /** \details
    Builds an instance of the /text style record/ object.
    
    \remarks
    Use the static pseudo-constructor instead it.
    See: <link db_textstyle_add_name.html, Adding and Naming Text Styles>
  */
  OdDbTextStyleTableRecord();
 
 
  /** \details
    Determines whether the font file associated with this text style should be interpreted as  
    a set of shapes or letters (DXF 70, bit 0x01) and returns True if the font file is a set 
    of shapes or False if the font file is a set of letters. 
 
    \sa
    <link db_textstyle_sample_record.html, Example of Working with the Text Style Record Object>
 
    \sa
    <link db_textstyle_font.html, Fonts of Text Styles>
 
    OdDbTextStyleTableRecord::setIsShapeFile() method
  */
  bool isShapeFile() const;
 
 
  /** \details
    Sets the interpretation of the associated font file as a Boolean value (DXF 70, bit 0x01). 
    The initial value is False (Letters) by default.
 
    \param bShapeFile [in]  True - to determine the font file as a set of shapes, or
                   False - to determine the font file as a set of letters.
 
    \sa
    <link db_textstyle_sample_record.html, Example of Working with the Text Style Record Object>
 
    \sa
    <link db_textstyle_font.html, Fonts of Text Styles>
 
    OdDbTextStyleTableRecord::isShapeFile() method
  */
  void setIsShapeFile( bool bShapeFile );
 
 
  /** \details
    Determines whether text is drawn vertically or horizontally from the start position 
    (DXF 70, bit 0x04) and returns True if text is vertical or False if text is horizontal.
    
    \sa
    <link db_textstyle_sample_record.html, Example of Working with the Text Style Record Object>
 
    \sa
    <link db_textstyle_properties.html, Specific Properties of Text Styles>
 
    OdDbTextStyleTableRecord::setIsVertical() method
  */
  bool isVertical() const;
 
 
  /** \details
    Sets the orientation typeface as a Boolean value (DXF 70, bit 0x04). The initial value is False 
    (Horizontal) by default.
 
    \param bVertical [in]  True - to make the vertical text, or False - to make the horizontal text.
 
    \sa
    <link db_textstyle_sample_record.html, Example of Working with the Text Style Record Object>
 
    \sa
    <link db_textstyle_properties.html, Specific Properties of Text Styles>
 
    OdDbTextStyleTableRecord::isVertical() method
  */
  void setIsVertical( bool bVertical );
 
 
  /** \details
    Determines whether text is drawn backward or forward from the start position 
    (DXF 71, bit 0x02) and returns True if text is backward or False if text is forward.
 
    \sa
    <link db_textstyle_sample_record.html, Example of Working with the Text Style Record Object>
 
    \sa
    <link db_textstyle_properties.html, Specific Properties of Text Styles>
 
    OdDbTextStyleTableRecord::setIsBackwards() method
  */
  bool isBackwards() const;
 
 
  /** \details
    Sets the direction typeface as a Boolean value (DXF 71, bit 0x02). The initial value is False 
    (Forward) by default.
    
    \param bBackwards [in]  True - to draw the text backward, or False - to draw the text forward.
 
    \sa
    <link db_textstyle_sample_record.html, Example of Working with the Text Style Record Object>
 
    \sa
    <link db_textstyle_properties.html, Specific Properties of Text Styles>
 
    OdDbTextStyleTableRecord::isBackwards() method
  */
  void setIsBackwards( bool bBackwards );
 
 
  /** \details
    Determines whether letters are placed up or down relative to the baseline when text is drawn 
    (DXF 71, bit 0x04) and returns True if letters are placed up or False if letters are placed 
    upside down.
 
    \sa
    <link db_textstyle_sample_record.html, Example of Working with the Text Style Record Object>
 
    \sa
    <link db_textstyle_properties.html, Specific Properties of Text Styles>
 
    OdDbTextStyleTableRecord::setIsUpsideDown() method
  */
  bool isUpsideDown() const;
 
 
  /** \details
    Sets the letter side typeface as a Boolean value (DXF 71, bit 0x04). The initial value is False 
    (Upside) by default.
    
    \param bUpsideDown [in]  True - to draw the text downside, or False - to draw the text upside.
 
    \sa
    <link db_textstyle_sample_record.html, Example of Working with the Text Style Record Object>
 
    \sa
    <link db_textstyle_properties.html, Specific Properties of Text Styles>
 
    OdDbTextStyleTableRecord::isUpsideDown() method
  */
  void setIsUpsideDown( bool bUpsideDown );
 
 
  /** \details
    Returns the height scale factor of the text boundary (DXF 40). This factor influences on the width 
    and height together and is used for proportional scaling of letters, spaces, and the text boundary.
 
    \sa
    <link db_textstyle_sample_record.html, Example of Working with the Text Style Record Object>
 
    \sa
    <link db_textstyle_properties.html, Specific Properties of Text Styles>
 
    OdDbTextStyleTableRecord::setTextSize() method
  */
  double textSize() const;
 
 
  /** \details
    Sets the text size which is the height scale factor of the text boundary (DXF 40). This factor 
    influences on the text width and text height together and is used for proportional scaling of 
    letters, spaces, and the text boundary. A value less than 1.0 decreases the text. A value 
    greater than 1.0 increases the text. The initial value is 0.0 by default.
 
    \param vSize [in]  Text size as a positive Double value.
 
    \sa
    <link db_textstyle_sample_record.html, Example of Working with the Text Style Record Object>
 
    \sa
    <link db_textstyle_properties.html, Specific Properties of Text Styles>
 
    OdDbTextStyleTableRecord::textSize() method
  */
  void setTextSize( double vSize );
 
 
  /** \details
    Returns the width scale factor of the text boundary (DXF 41). This factor influences only on the 
    width and is used for scaling of letters and spaces when the height is constant.
 
    \sa
    <link db_textstyle_sample_record.html, Example of Working with the Text Style Record Object>
 
    \sa
    <link db_textstyle_properties.html, Specific Properties of Text Styles>
 
    OdDbTextStyleTableRecord::setXScale() method
  */
  double xScale() const;
 
 
  /** \details
    Sets the width scale factor of the text boundary (DXF 41). This factor influences only on the  
    text width and is used for scaling of letters and spaces when the height is constant. A value 
    less than 1.0 condenses the text. A value greater than 1.0 expandes the text. The initial value 
    is 1.0 by default.
 
    \param xFactor [in]  X-scale factor as a positive non-zero Double value.
 
    \sa
    <link db_textstyle_sample_record.html, Example of Working with the Text Style Record Object>
 
    \sa
    <link db_textstyle_properties.html, Specific Properties of Text Styles>
 
    OdDbTextStyleTableRecord::xScale() method
  */
  void setXScale( double xFactor );
 
 
  /** \details
    Returns the obliquing angle in range ±1.48335 radians (±85°) (DXF 50). This angle influences on
    the lean of letters. Negative angles will have Oda2PI added to them.
 
    \sa
    <link db_textstyle_sample_record.html, Example of Working with the Text Style Record Object>
 
    \sa
    <link db_textstyle_properties.html, Specific Properties of Text Styles>
 
    OdDbTextStyleTableRecord::setObliquingAngle() method
  */
  double obliquingAngle() const;
 
 
  /** \details
    Sets the obliquing angle of letters in range ±1.48335 radians (±85°) (DXF 50). A positive angle 
    leans the letters clockwise (to the right). A negative value leans the letters counterclockwise 
    (to the left). A negative value is converted to its positive equivalent by adding the value 2*PI. 
    The initial value is 0.0 by default.
    
    \param vAngle [in]  Obliquing angle in radians as a Double value in range ±1.48335.
 
    \sa
    <link db_textstyle_sample_record.html, Example of Working with the Text Style Record Object>
 
    \sa
    <link db_textstyle_properties.html, Specific Properties of Text Styles>
 
    OdDbTextStyleTableRecord::obliquingAngle() method
  */
  void setObliquingAngle( double vAngle );
 
 
  /** \details
    Returns the prior size of the text most recently created with this text style (DXF 42). This value  
    is automatically updated after creating any text object that refers to this text style. This value 
    is also used as a default value when the height scale factor is set to zero.
 
    \sa
    <link db_textstyle_sample_record.html, Example of Working with the Text Style Record Object>
 
    \sa
    <link db_textstyle_properties.html, Specific Properties of Text Styles>
 
    OdDbTextStyleTableRecord::setPriorSize() method
  */
  double priorSize() const;
 
 
  /** \details
    Sets the prior size of the text most recently created with this text style (DXF 42). This value  
    is automatically updated after creating any text object that refers to this text style.
    
    \param vSize [in]  Prior size as a positive non-zero Double value.
 
    \sa
    <link db_textstyle_sample_record.html, Example of Working with the Text Style Record Object>
 
    \sa
    <link db_textstyle_properties.html, Specific Properties of Text Styles>
 
    OdDbTextStyleTableRecord::priorSize() method
  */
  void setPriorSize( double vSize );
 
 
  /** \details
    Returns the name of the /uni-font/ file associated with this text style (DXF 3).
 
    \sa
    <link db_textstyle_sample_record.html, Example of Working with the Text Style Record Object>
 
    \sa
    <link db_textstyle_font.html, Fonts of Text Styles>
 
    OdDbTextStyleTableRecord::setFileName(), OdDbTextStyleTableRecord::bigFontFileName() methods
  */
  OdString fileName() const;
 
 
  /** \details
    Sets the name of the /uni-font/ file and associates this uni-font with the text style (DXF 3). 
    This /uni-font/ defines the shape of typical letters for text.
 
    \param sUniFont [in]  Uni-font filename without path to be associated with the text style as a String value.
 
    \sa
    <link db_textstyle_sample_record.html, Example of Working with the Text Style Record Object>
 
    \sa
    <link db_textstyle_font.html, Fonts of Text Styles>
 
    OdDbTextStyleTableRecord::fileName(), OdDbTextStyleTableRecord::setBigFontFileName() methods
  */
  void setFileName( const OdString& sUniFont );
 
 
  /** \details
    Returns the name of the /big-font/ file associated with this text style (DXF 4).
 
    \sa
    <link db_textstyle_sample_record.html, Example of Working with the Text Style Record Object>
 
    \sa
    <link db_textstyle_font.html, Fonts of Text Styles>
 
    OdDbTextStyleTableRecord::setBigFontFileName(), OdDbTextStyleTableRecord::fileName() methods
  */
  OdString bigFontFileName() const;
 
 
  /** \details
    Sets the name of the /big-font/ file and associates this big-font with the text style (DXF 4). 
    This /big-font/ defines the shape of Asian-language letters and special characters for text.
 
    \param sBigFont [in]  Big-font filename without path to be associated with the text style as a String value.
 
    \sa
    <link db_textstyle_sample_record.html, Example of Working with the Text Style Record Object>
 
    \sa
    <link db_textstyle_font.html, Fonts of Text Styles>
 
    OdDbTextStyleTableRecord::bigFontFileName(), OdDbTextStyleTableRecord::setFileName() methods
  */
  void setBigFontFileName( const OdString& sBigFont );
 
 
  /** \details
    Gets the characteristics of the Windows-font associated with the text style.
 
    \param typeface [out]  Typeface name of the /Windows-font/.
    \param bold [out]  True if and only if Bold font.
    \param italic [out]  True if and only if Italic font.
    \param charset [out]  Windows character set identitier.
    \param pitchAndFamily [out]  Windows pitch and character family identifier.
 
    \sa
    <link db_textstyle_font.html, Fonts of Text Styles>
 
    OdDbTextStyleTableRecord::setFont() method
  */
  void font( OdString& typeface,
         bool& bold,
         bool& italic,
         int& charset,
         int& pitchAndFamily) const;
 
 
  /** \details
    Associates the /Windows-font/ with the text style and sets its characteristics.
 
    \param typeface [in]  Typeface name of the /Windows-font/.
    \param bold [in]  True - to set the Bold font.
    \param italic [in]  True - to set the Italic font.
    \param charset [in]  Windows character set identitier.
    \param pitchAndFamily [in]  Windows pitch and character family identifier.
    
    \remarks
    If typeface is an empty string, this method disassociates the /Windows-font/ with this text style
    and removes information about it.
 
    \sa
    <link db_textstyle_font.html, Fonts of Text Styles>
 
    OdDbTextStyleTableRecord::font() method
  */
  void setFont( const OdString& typeface,
        bool bold,
        bool italic,
        int charset,
        int pitchAndFamily);
 
 
  virtual OdResult subGetClassID( void* pClsid ) const;
 
  virtual OdResult dwgInFields( OdDbDwgFiler* pFiler );
 
  virtual void dwgOutFields( OdDbDwgFiler* pFiler ) const;
 
  virtual OdResult dxfInFields( OdDbDxfFiler* pFiler );
 
  virtual void dxfOutFields( OdDbDxfFiler* pFiler ) const;
 
  virtual OdResult dxfInFields_R12( OdDbDxfFiler* pFiler );
 
  virtual void dxfOutFields_R12( OdDbDxfFiler* pFiler ) const;
  
  OdResult dxfIn( OdDbDxfFiler* pFiler );
 
  virtual void subClose();
 
  virtual OdResult subErase( bool erasing );
 
  virtual void subHandOverTo( OdDbObject* pNewObject );
 
  virtual OdUInt32 subSetAttributes( OdGiDrawableTraits* pTraits ) const;
};
 
/** \details
  The typified smart pointer for the /text style record/ object. This template class is 
  specialization of the OdSmartPtr class for the OdDbTextStyleTableRecord object.
 
  \sa
  <link smart_pointers.html, Working with Smart Pointers>
*/
typedef OdSmartPtr<OdDbTextStyleTableRecord> OdDbTextStyleTableRecordPtr;
 
class OdGiTextStyle;
TOOLKIT_EXPORT void giFromDbTextStyle(const OdDbTextStyleTableRecord* pTStyle, OdGiTextStyle& giStyle);
TOOLKIT_EXPORT void giFromDbTextStyle(OdDbObjectId styleId, OdGiTextStyle& giStyle);
 
#include "TD_PackPop.h"
 
#endif // _ODDBTEXTSTYLETABLERECORD_INCLUDED