CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
GiTextStyle.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, Open Design Alliance (the "Alliance").
3// All rights reserved.
4//
5// This software and its documentation and related materials are owned by
6// the Alliance. The software may only be incorporated into application
7// programs owned by members of the Alliance, subject to a signed
8// Membership Agreement and Supplemental Software License Agreement with the
9// Alliance. The structure and organization of this software are the valuable
10// trade secrets of the Alliance and its suppliers. The software is also
11// protected by copyright law and international treaty provisions. Application
12// programs incorporating this software must include the following statement
13// with their copyright notices:
14//
15// This application incorporates Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2022 by Open Design Alliance.
18// All rights reserved.
19//
20// By use of this software, its documentation or related materials, you
21// acknowledge and accept the above terms.
23
24#ifndef __ODGITEXTSTYLE_H__
25#define __ODGITEXTSTYLE_H__
26
27#include "TD_PackPush.h"
28
29#include "OdCodePage.h"
30#include "OdFont.h"
31#include "Gi/TtfDescriptor.h"
32#include "DbBaseDatabase.h"
33
34class OdGiWorldDraw;
35class OdGiTextStyleImpl;
36class OdString;
37class OdGePoint2d;
38
39
51{
52 // Members
53 //
54
55 // : public OdTtfDescriptor // MKU 14.02.2003
56
57 OdTtfDescriptor m_ttfDescriptor;
58
59 mutable OdFontPtr m_pFont;
60 mutable OdFontPtr m_pBigFont;
61
62 mutable OdString m_sFontPath;
63 mutable OdString m_sBigFontPath;
64
65 OdString m_sBigfontFile;
66 double m_dTextSize;
67 double m_dXScale;
68 double m_dObliquingAngle;
69 double m_dTrackingPercent;
70 mutable OdUInt16 m_flags;
71 mutable OdCodePageId m_Codepage;
72
73 OdString m_StyleName;
74
75 double m_dIntercharSpacing;
76
77public:
78 enum
79 {
80 kShape = 0x01,
81 kUpsideDown = 0x02,
82 kVertical = 0x04,
83 kUnderlined = 0x08,
84 kOverlined = 0x10,
85 kShxFont = 0x20,
86 kPreLoaded = 0x40,
87 kBackward = 0x80,
88 kShapeLoaded = 0x100,
89 kStriked = 0x200,
90 kUseIntercharSpacing = 0x400,
91 kFixedIntercharSpacing = 0x800,
92 kNoUsePreferableFont = 0x1000
93 };
94
101 bool shapeLoaded) const;
102
108 bool isShapeLoaded() const { return GETBIT(m_flags, kShapeLoaded); }
109
125
130
152 void set(
153 const OdString& fontName,
154 const OdString& bigFontName,
155 const double textSize,
156 const double xScale,
157 const double obliquingAngle,
158 const double trackingPercent,
159 const bool isBackward,
160 const bool isUpsideDown,
161 const bool isVertical,
162 const bool isOverlined,
163 const bool isUnderlined);
164
174 OdDbBaseDatabase* pDb) const;
175
182 OdDbBaseDatabase* pDb) const;
183
190 OdDbBaseDatabase* pDb) const;
191
200 const OdString& fontFilePath){m_sFontPath = fontFilePath;}
201
210 const OdString& bigFontFilePath){m_sBigFontPath = bigFontFilePath;}
211
218 double textSize);
219
226 double xScale);
227
239 void setObliquingAngle(double obliquingAngle);
240
249 double trackingPercent);
250
257 bool isBackward);
258
265 bool isUpsideDown);
266
273 bool isVertical);
274
281 bool isUnderlined);
282
289 bool isOverlined);
290
297 bool isStriked);
298
306 void setPreLoaded(bool value) const;
307
313 void setShxFont(bool value) const;
314
321 const OdString& fontFileName);
322
329 const OdString& bigFontFileName);
330
336 bool isBackward() const { return GETBIT(m_flags, kBackward); }
337
343 bool isUpsideDown() const { return GETBIT(m_flags, kUpsideDown);}
344
350 bool isVertical() const { return GETBIT(m_flags, kVertical); }
351
357 bool isUnderlined() const { return GETBIT(m_flags, kUnderlined);}
358
364 bool isOverlined() const { return GETBIT(m_flags, kOverlined); }
365
371 bool isStriked() const { return GETBIT(m_flags, kStriked); }
372
380 bool isPreLoaded() const { return GETBIT(m_flags, kPreLoaded); }
381
387 bool isShxFont() const { return GETBIT(m_flags, kShxFont); }
388
394 bool isTtfFont() const { return !isShxFont(); }
395
401 bool isShape) { SETBIT(m_flags, kShape, isShape); }
402
408 bool isShape() const { return GETBIT(m_flags, kShape); }
409
410
424 const OdString& typeface,
425 bool bold, bool italic,
426 int charset,
427 int pitchAndFamily);
428
435 OdFont* font){m_pFont = font;}
436
443 OdFont* pBigFont){m_pBigFont = pBigFont;}
444
445
455 void font(
456 OdString& typeface,
457 bool& bold,
458 bool& italic,
459 int& charset,
460 int& pitchAndFamily) const;
461
465 OdFont* getFont() const { return m_pFont; }
466
470 OdFont* getBigFont() const { return m_pBigFont; }
471
476 {
477 return m_ttfDescriptor;
478 }
480 {
481 return m_ttfDescriptor;
482 }
483
488 {
489 return m_sBigfontFile;
490 }
494 double textSize() const
495 {
496 return m_dTextSize;
497 }
498
502 double xScale() const
503 {
504 return m_dXScale;
505 }
506
516 double obliquingAngle() const
517 {
518 return m_dObliquingAngle;
519 }
528 double trackingPercent() const
529 {
530 return m_dTrackingPercent;
531 }
532
533// void odExtentsBox(const OdChar* pStr, int nStrLen, OdUInt32 flags, OdDbDatabase* pDb, OdGePoint3d& min, OdGePoint3d& max, OdGePoint3d* pEndPos = 0); // MKU 02.06.2003
534
539 {
540 return m_Codepage;
541 }
542
548 {
549 m_Codepage = codePage;
550 }
551
555 const OdString& styleName() const
556 {
557 return m_StyleName;
558 }
559
565 {
566 m_StyleName = name;
567 }
568
574 bool isUseIntercharSpacing) { SETBIT(m_flags, kUseIntercharSpacing, isUseIntercharSpacing); }
575
581 bool isUseIntercharSpacing() const { return GETBIT(m_flags, kUseIntercharSpacing); }
582
588 bool isUseIntercharSpacing) { SETBIT(m_flags, kFixedIntercharSpacing, isUseIntercharSpacing); }
589
595 bool isFixedIntercharSpacing() const { return GETBIT(m_flags, kFixedIntercharSpacing); }
596
605 double getIntercharSpacing() const;
606
611 void setIntercharSpacing( double dSpacing );
612
617 void setNoUsePreferableFont(bool isUsePreferableFont) { SETBIT(m_flags, kNoUsePreferableFont, isUsePreferableFont); }
618
624 bool isNoUsePreferableFont() const { return GETBIT(m_flags, kNoUsePreferableFont); }
625
626};
627
628#include "TD_PackPop.h"
629
630#endif // __ODGITEXTSTYLE_H__
631
@ kShape
OdCodePageId
Definition: OdCodePage.h:31
unsigned short OdUInt16
#define SETBIT(flags, bit, value)
Definition: OdaDefs.h:516
#define GETBIT(flags, bit)
Definition: OdaDefs.h:517
#define FIRSTDLL_EXPORT
Definition: RootExport.h:39
Definition: OdFont.h:371
bool isTtfFont() const
Definition: GiTextStyle.h:394
bool isBackward() const
Definition: GiTextStyle.h:336
void setBigFont(OdFont *pBigFont)
Definition: GiTextStyle.h:442
bool isUpsideDown() const
Definition: GiTextStyle.h:343
OdString getBigFontFilePath(OdDbBaseDatabase *pDb) const
void setBackward(bool isBackward)
OdCodePageId getCodePage() const
Definition: GiTextStyle.h:538
bool isShape() const
Definition: GiTextStyle.h:408
void setFont(OdFont *font)
Definition: GiTextStyle.h:434
OdFont * getFont() const
Definition: GiTextStyle.h:465
void setShapeLoaded(bool shapeLoaded) const
void loadStyleRec(OdDbBaseDatabase *pDb) const
void setStyleName(const OdString &name)
Definition: GiTextStyle.h:564
void setNoUsePreferableFont(bool isUsePreferableFont)
Definition: GiTextStyle.h:617
void setUpsideDown(bool isUpsideDown)
void font(OdString &typeface, bool &bold, bool &italic, int &charset, int &pitchAndFamily) const
bool isUnderlined() const
Definition: GiTextStyle.h:357
void setIntercharSpacing(double dSpacing)
void setPreLoaded(bool value) const
double obliquingAngle() const
Definition: GiTextStyle.h:516
void setTextSize(double textSize)
void setIsUseIntercharSpacing(bool isUseIntercharSpacing)
Definition: GiTextStyle.h:573
double xScale() const
Definition: GiTextStyle.h:502
OdFont * getBigFont() const
Definition: GiTextStyle.h:470
double textSize() const
Definition: GiTextStyle.h:494
OdString getFontFilePath(OdDbBaseDatabase *pDb) const
void set(const OdString &fontName, const OdString &bigFontName, const double textSize, const double xScale, const double obliquingAngle, const double trackingPercent, const bool isBackward, const bool isUpsideDown, const bool isVertical, const bool isOverlined, const bool isUnderlined)
void setFileName(const OdString &fontFileName)
void setXScale(double xScale)
void setOverlined(bool isOverlined)
void setIsShape(bool isShape)
Definition: GiTextStyle.h:400
double getIntercharSpacing() const
OdTtfDescriptor & ttfdescriptor()
Definition: GiTextStyle.h:475
void setObliquingAngle(double obliquingAngle)
bool isShxFont() const
Definition: GiTextStyle.h:387
void setIsFixedIntercharSpacing(bool isUseIntercharSpacing)
Definition: GiTextStyle.h:587
void setBigFontFileName(const OdString &bigFontFileName)
bool isOverlined() const
Definition: GiTextStyle.h:364
void setFontFilePath(const OdString &fontFilePath)
Definition: GiTextStyle.h:199
void setCodePage(OdCodePageId codePage)
Definition: GiTextStyle.h:547
bool isStriked() const
Definition: GiTextStyle.h:371
bool isVertical() const
Definition: GiTextStyle.h:350
void setVertical(bool isVertical)
void setStriked(bool isStriked)
void setBigFontFilePath(const OdString &bigFontFilePath)
Definition: GiTextStyle.h:209
double trackingPercent() const
Definition: GiTextStyle.h:528
const OdTtfDescriptor & ttfdescriptor() const
Definition: GiTextStyle.h:479
bool isShapeLoaded() const
Definition: GiTextStyle.h:108
bool isPreLoaded() const
Definition: GiTextStyle.h:380
void setUnderlined(bool isUnderlined)
const OdString & bigFontFileName() const
Definition: GiTextStyle.h:487
void setTrackingPercent(double trackingPercent)
bool isFixedIntercharSpacing() const
Definition: GiTextStyle.h:595
void setFont(const OdString &typeface, bool bold, bool italic, int charset, int pitchAndFamily)
const OdString & styleName() const
Definition: GiTextStyle.h:555
bool isNoUsePreferableFont() const
Definition: GiTextStyle.h:624
bool isUseIntercharSpacing() const
Definition: GiTextStyle.h:581
void setShxFont(bool value) const
GLuint const GLchar * name
Definition: gles2_ext.h:265
GLsizei const GLfloat * value
Definition: gles2_ext.h:302