CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
GiTextStyle.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2024, 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-2024 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 //DOM-IGNORE-BEGIN
79 enum
80 {
81 kShape = 0x01,
83 kVertical = 0x04,
85 kOverlined = 0x10,
86 kShxFont = 0x20,
87 kPreLoaded = 0x40,
88 kBackward = 0x80,
89 kShapeLoaded = 0x100,
90 kStriked = 0x200,
94 };
95 //DOM-IGNORE-END
96
103 bool shapeLoaded) const;
104
110 bool isShapeLoaded() const { return GETBIT(m_flags, kShapeLoaded); }
111
127
132
154 void set(
155 const OdString& fontName,
156 const OdString& bigFontName,
157 const double textSize,
158 const double xScale,
159 const double obliquingAngle,
160 const double trackingPercent,
161 const bool isBackward,
162 const bool isUpsideDown,
163 const bool isVertical,
164 const bool isOverlined,
165 const bool isUnderlined);
166
176 OdDbBaseDatabase* pDb) const;
177
184 OdDbBaseDatabase* pDb) const;
185
192 OdDbBaseDatabase* pDb) const;
193
202 const OdString& fontFilePath){m_sFontPath = fontFilePath;}
203
212 const OdString& bigFontFilePath){m_sBigFontPath = bigFontFilePath;}
213
220 double textSize);
221
228 double xScale);
229
242
251 double trackingPercent);
252
259 bool isBackward);
260
267 bool isUpsideDown);
268
275 bool isVertical);
276
283 bool isUnderlined);
284
291 bool isOverlined);
292
299 bool isStriked);
300
308 void setPreLoaded(bool value) const;
309
315 void setShxFont(bool value) const;
316
323 const OdString& fontFileName);
324
332
338 bool isBackward() const { return GETBIT(m_flags, kBackward); }
339
345 bool isUpsideDown() const { return GETBIT(m_flags, kUpsideDown);}
346
352 bool isVertical() const { return GETBIT(m_flags, kVertical); }
353
359 bool isUnderlined() const { return GETBIT(m_flags, kUnderlined);}
360
366 bool isOverlined() const { return GETBIT(m_flags, kOverlined); }
367
373 bool isStriked() const { return GETBIT(m_flags, kStriked); }
374
382 bool isPreLoaded() const { return GETBIT(m_flags, kPreLoaded); }
383
389 bool isShxFont() const { return GETBIT(m_flags, kShxFont); }
390
396 bool isTtfFont() const { return !isShxFont(); }
397
403 bool isShape) { SETBIT(m_flags, kShape, isShape); }
404
410 bool isShape() const { return GETBIT(m_flags, kShape); }
411
412
426 const OdString& typeface,
427 bool bold, bool italic,
428 int charset,
429 int pitchAndFamily);
430
437 OdFont* font){m_pFont = font;}
438
445 OdFont* pBigFont){m_pBigFont = pBigFont;}
446
447
457 void font(
458 OdString& typeface,
459 bool& bold,
460 bool& italic,
461 int& charset,
462 int& pitchAndFamily) const;
463
467 OdFont* getFont() const { return m_pFont; }
468
472 OdFont* getBigFont() const { return m_pBigFont; }
473
478 {
479 return m_ttfDescriptor;
480 }
482 {
483 return m_ttfDescriptor;
484 }
485
490 {
491 return m_sBigfontFile;
492 }
493
496 double textSize() const
497 {
498 return m_dTextSize;
499 }
500
504 double xScale() const
505 {
506 return m_dXScale;
507 }
508
518 double obliquingAngle() const
519 {
520 return m_dObliquingAngle;
521 }
522
530 double trackingPercent() const
531 {
532 return m_dTrackingPercent;
533 }
534
535// void odExtentsBox(const OdChar* pStr, int nStrLen, OdUInt32 flags, OdDbDatabase* pDb, OdGePoint3d& min, OdGePoint3d& max, OdGePoint3d* pEndPos = 0); // MKU 02.06.2003
536
541 {
542 return m_Codepage;
543 }
544
550 {
551 m_Codepage = codePage;
552 }
553
557 const OdString& styleName() const
558 {
559 return m_StyleName;
560 }
561
567 {
568 m_StyleName = name;
569 }
570
577
583 bool isUseIntercharSpacing() const { return GETBIT(m_flags, kUseIntercharSpacing); }
584
591
597 bool isFixedIntercharSpacing() const { return GETBIT(m_flags, kFixedIntercharSpacing); }
598
607 double getIntercharSpacing() const;
608
613 void setIntercharSpacing( double dSpacing );
614
619 void setNoUsePreferableFont(bool isUsePreferableFont) { SETBIT(m_flags, kNoUsePreferableFont, isUsePreferableFont); }
620
626 bool isNoUsePreferableFont() const { return GETBIT(m_flags, kNoUsePreferableFont); }
627
628};
629
630#include "TD_PackPop.h"
631
632#endif // __ODGITEXTSTYLE_H__
633
OdRxObject OdDbBaseDatabase
OdCodePageId
Definition OdCodePage.h:31
OdSmartPtr< OdFont > OdFontPtr
Definition OdFont.h:781
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
bool isTtfFont() const
bool isBackward() const
void setBigFont(OdFont *pBigFont)
bool isUpsideDown() const
OdString getBigFontFilePath(OdDbBaseDatabase *pDb) const
void setBackward(bool isBackward)
OdCodePageId getCodePage() const
bool isShape() const
void setFont(OdFont *font)
OdFont * getFont() const
void setShapeLoaded(bool shapeLoaded) const
void loadStyleRec(OdDbBaseDatabase *pDb) const
void setStyleName(const OdString &name)
void setNoUsePreferableFont(bool isUsePreferableFont)
void setUpsideDown(bool isUpsideDown)
void font(OdString &typeface, bool &bold, bool &italic, int &charset, int &pitchAndFamily) const
bool isUnderlined() const
void setIntercharSpacing(double dSpacing)
void setPreLoaded(bool value) const
double obliquingAngle() const
void setTextSize(double textSize)
void setIsUseIntercharSpacing(bool isUseIntercharSpacing)
double xScale() const
OdFont * getBigFont() const
double textSize() const
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)
double getIntercharSpacing() const
OdTtfDescriptor & ttfdescriptor()
void setObliquingAngle(double obliquingAngle)
bool isShxFont() const
void setIsFixedIntercharSpacing(bool isUseIntercharSpacing)
void setBigFontFileName(const OdString &bigFontFileName)
bool isOverlined() const
void setFontFilePath(const OdString &fontFilePath)
void setCodePage(OdCodePageId codePage)
bool isStriked() const
bool isVertical() const
void setVertical(bool isVertical)
void setStriked(bool isStriked)
void setBigFontFilePath(const OdString &bigFontFilePath)
double trackingPercent() const
const OdTtfDescriptor & ttfdescriptor() const
bool isShapeLoaded() const
bool isPreLoaded() const
void setUnderlined(bool isUnderlined)
const OdString & bigFontFileName() const
void setTrackingPercent(double trackingPercent)
bool isFixedIntercharSpacing() const
void setFont(const OdString &typeface, bool bold, bool italic, int charset, int pitchAndFamily)
const OdString & styleName() const
bool isNoUsePreferableFont() const
bool isUseIntercharSpacing() const
void setShxFont(bool value) const
GLuint const GLchar * name
Definition gles2_ext.h:265
GLsizei const GLfloat * value
Definition gles2_ext.h:302