CFx SDK Documentation  2020SP3
Public Types | Public Member Functions | List of all members
OdGiTextStyle Class Reference

#include <GiTextStyle.h>

Public Types

enum  {
  kShape = 0x01, kUpsideDown = 0x02, kVertical = 0x04, kUnderlined = 0x08,
  kOverlined = 0x10, kShxFont = 0x20, kPreLoaded = 0x40, kBackward = 0x80,
  kShapeLoaded = 0x100, kStriked = 0x200, kUseIntercharSpacing = 0x400, kFixedIntercharSpacing = 0x800
}
 

Public Member Functions

void setShapeLoaded (bool shapeLoaded) const
 
bool isShapeLoaded () const
 
 OdGiTextStyle ()
 
 ~OdGiTextStyle ()
 
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 loadStyleRec (OdDbBaseDatabase *pDb) const
 
OdString getFontFilePath (OdDbBaseDatabase *pDb) const
 
OdString getBigFontFilePath (OdDbBaseDatabase *pDb) const
 
void setFontFilePath (const OdString &fontFilePath)
 
void setBigFontFilePath (const OdString &bigFontFilePath)
 
void setTextSize (double textSize)
 
void setXScale (double xScale)
 
void setObliquingAngle (double obliquingAngle)
 
void setTrackingPercent (double trackingPercent)
 
void setBackward (bool isBackward)
 
void setUpsideDown (bool isUpsideDown)
 
void setVertical (bool isVertical)
 
void setUnderlined (bool isUnderlined)
 
void setOverlined (bool isOverlined)
 
void setStriked (bool isStriked)
 
void setPreLoaded (bool value) const
 
void setShxFont (bool value) const
 
void setFileName (const OdString &fontFileName)
 
void setBigFontFileName (const OdString &bigFontFileName)
 
bool isBackward () const
 
bool isUpsideDown () const
 
bool isVertical () const
 
bool isUnderlined () const
 
bool isOverlined () const
 
bool isStriked () const
 
bool isPreLoaded () const
 
bool isShxFont () const
 
bool isTtfFont () const
 
void setIsShape (bool isShape)
 
bool isShape () const
 
void setFont (const OdString &typeface, bool bold, bool italic, int charset, int pitchAndFamily)
 
void setFont (OdFont *font)
 
void setBigFont (OdFont *pBigFont)
 
void font (OdString &typeface, bool &bold, bool &italic, int &charset, int &pitchAndFamily) const
 
OdFontgetFont () const
 
OdFontgetBigFont () const
 
OdTtfDescriptorttfdescriptor ()
 
const OdTtfDescriptorttfdescriptor () const
 
const OdStringbigFontFileName () const
 
double textSize () const
 
double xScale () const
 
double obliquingAngle () const
 
double trackingPercent () const
 
OdCodePageId getCodePage () const
 
void setCodePage (OdCodePageId codePage)
 
const OdStringstyleName () const
 
void setStyleName (const OdString &name)
 
void setIsUseIntercharSpacing (bool isUseIntercharSpacing)
 
bool isUseIntercharSpacing () const
 
void setIsFixedIntercharSpacing (bool isUseIntercharSpacing)
 
bool isFixedIntercharSpacing () const
 
double getIntercharSpacing () const
 
void setIntercharSpacing (double dSpacing)
 

Detailed Description

This class provides an interface to the display attributes of text.

Remarks
This class is used as an argument to OdGiGeometry::text().
See also
TD_Gi

<group OdGi_Classes>

Definition at line 51 of file GiTextStyle.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
kShape 
kUpsideDown 
kVertical 
kUnderlined 
kOverlined 
kShxFont 
kPreLoaded 
kBackward 
kShapeLoaded 
kStriked 
kUseIntercharSpacing 
kFixedIntercharSpacing 

Definition at line 79 of file GiTextStyle.h.

Constructor & Destructor Documentation

◆ OdGiTextStyle()

OdGiTextStyle::OdGiTextStyle ( )

◆ ~OdGiTextStyle()

OdGiTextStyle::~OdGiTextStyle ( )

Member Function Documentation

◆ bigFontFileName()

const OdString& OdGiTextStyle::bigFontFileName ( ) const
inline

Returns the BigFont filename for this TextStyle.

Definition at line 440 of file GiTextStyle.h.

◆ font()

void OdGiTextStyle::font ( OdString typeface,
bool &  bold,
bool &  italic,
int &  charset,
int &  pitchAndFamily 
) const

Returns the Windows font characteristics for this TextStyle.

Parameters
typeface[out] Typeface name of the font.
bold[out] True if and only if bold.
italic[out] True if and only if italic.
charset[out] Windows character set identifier.
pitchAndFamily[out] Windows pitch and character family identifier.

◆ getBigFont()

OdFont* OdGiTextStyle::getBigFont ( ) const
inline

Returns the OdFont associated with the BigFont for this TextStyle.

Definition at line 423 of file GiTextStyle.h.

◆ getBigFontFilePath()

OdString OdGiTextStyle::getBigFontFilePath ( OdDbBaseDatabase pDb) const

Returns the fully qualified BigFont file path associated with this TextStyle.

Parameters
pDb[in] Pointer to the database whose OdDbHostAppServices object will be used.

◆ getCodePage()

OdCodePageId OdGiTextStyle::getCodePage ( ) const
inline

Returns the CodePage associated with this TextStyle.

Definition at line 491 of file GiTextStyle.h.

◆ getFont()

OdFont* OdGiTextStyle::getFont ( ) const
inline

Returns the OdFont associated with this TextStyle.

Definition at line 418 of file GiTextStyle.h.

◆ getFontFilePath()

OdString OdGiTextStyle::getFontFilePath ( OdDbBaseDatabase pDb) const

Returns the fully qualified font file path associated with this TextStyle.

Parameters
pDb[in] Pointer to the database whose OdDbHostAppServices object will be used.

◆ getIntercharSpacing()

double OdGiTextStyle::getIntercharSpacing ( ) const

Returns the interchar spacing for this TextStyle.

Remarks
Interchar spacing is a factor of text size, that determine distance from start of character to start of next character for fixed interchar spacing mode or a additional distance from end of character to start of next character for common interchar spacing mode.

◆ isBackward()

bool OdGiTextStyle::isBackward ( ) const
inline

Returns true if and only if text is drawn backwards with this TextStyle.

Definition at line 313 of file GiTextStyle.h.

◆ isFixedIntercharSpacing()

bool OdGiTextStyle::isFixedIntercharSpacing ( ) const
inline

Returns true if fixed interchar spacing used.

DOM

Definition at line 541 of file GiTextStyle.h.

◆ isOverlined()

bool OdGiTextStyle::isOverlined ( ) const
inline

Returns true if and only if text is drawn overlined with this TextStyle.

Definition at line 333 of file GiTextStyle.h.

◆ isPreLoaded()

bool OdGiTextStyle::isPreLoaded ( ) const
inline

DOM

Definition at line 341 of file GiTextStyle.h.

◆ isShape()

bool OdGiTextStyle::isShape ( ) const
inline

Returns true if and only if the font file for this TextStyle is a shape file.

DOM

Definition at line 361 of file GiTextStyle.h.

◆ isShapeLoaded()

bool OdGiTextStyle::isShapeLoaded ( ) const
inline

Returns true if and only if the text font file for this TextStyle marked as loaded.

DOM

Definition at line 108 of file GiTextStyle.h.

◆ isShxFont()

bool OdGiTextStyle::isShxFont ( ) const
inline

DOM

Definition at line 344 of file GiTextStyle.h.

◆ isStriked()

bool OdGiTextStyle::isStriked ( ) const
inline

Returns true if and only if text is drawn strike with this TextStyle.

Definition at line 338 of file GiTextStyle.h.

◆ isTtfFont()

bool OdGiTextStyle::isTtfFont ( ) const
inline

DOM

Definition at line 347 of file GiTextStyle.h.

◆ isUnderlined()

bool OdGiTextStyle::isUnderlined ( ) const
inline

Returns true if and only if text is drawn underlined with this TextStyle.

Definition at line 328 of file GiTextStyle.h.

◆ isUpsideDown()

bool OdGiTextStyle::isUpsideDown ( ) const
inline

Returns true if and only if text is drawn upside down with this TextStyle.

Definition at line 318 of file GiTextStyle.h.

◆ isUseIntercharSpacing()

bool OdGiTextStyle::isUseIntercharSpacing ( ) const
inline

Returns true if interchar spacing used.

DOM

Definition at line 527 of file GiTextStyle.h.

◆ isVertical()

bool OdGiTextStyle::isVertical ( ) const
inline

Returns true if and only if text is drawn vertical with this TextStyle.

Definition at line 323 of file GiTextStyle.h.

◆ loadStyleRec()

void OdGiTextStyle::loadStyleRec ( OdDbBaseDatabase pDb) const

Loads the font file(s) associated with this TextStyle.

Parameters
pDb[in] Pointer to the database whose OdDbHostAppServices object will be used.
Remarks
This function is run after a call to setFileName() or setBigFontFileName(), and must be called after loading a True Type font (TTF).

◆ obliquingAngle()

double OdGiTextStyle::obliquingAngle ( ) const
inline

Returns the obliquing angle for this TextStyle.

Remarks
obliquingAngle has a domain of ±1.48335 radians (±85°). Negative angles will have Oda2PI added to them.
All angles are expressed in radians.

Definition at line 469 of file GiTextStyle.h.

◆ set()

void OdGiTextStyle::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 
)

Sets the parameters of this TextStyle object according to its parameters.

Parameters
fontName[in] Font filename.
bigFontName[in] BigFont filename.
textSize[in] Fixed text size.
xScale[in] X-scale (width) factor of text.
obliquingAngle[in] Obliquing angle of text.
trackingPercent[in] Tracking percent of text.
isBackward[in] Controls backwards drawing of text.
isUpsideDown[in] Controls upside down drawing of text.
isVertical[in] Controls vertical drawing of text.
isOverlined[in] Controls overlined drawing of text.
isUnderlined[in] Controls overlined drawing of text.
Remarks
obliquingAngle has a domain of ±1.48335 radians (±85°). Negative angles will have Oda2PI added to them.
All angles are expressed in radians.

◆ setBackward()

void OdGiTextStyle::setBackward ( bool  isBackward)

Controls the backwards drawing of text with this TextStyle.

Parameters
isBackwards[in] Controls backwards drawing.

◆ setBigFont()

void OdGiTextStyle::setBigFont ( OdFont pBigFont)
inline

Sets this TextStyle to use the specified OdFont as the BigFont.

Parameters
pBigFont[in] Pointer to the BigFont.

Definition at line 395 of file GiTextStyle.h.

◆ setBigFontFileName()

void OdGiTextStyle::setBigFontFileName ( const OdString bigFontFileName)

Sets the name of the BitFont file associated with this TextStyle.

Parameters
bigFontFileName[in] Filename.

◆ setBigFontFilePath()

void OdGiTextStyle::setBigFontFilePath ( const OdString bigFontFilePath)
inline

Sets the fully qualified BigFont file path associated with this TextStyle.

Parameters
bigFontFilePath[in] BigFont file path.
Remarks
loadStyleRec() should be called after calling this function:

Definition at line 196 of file GiTextStyle.h.

◆ setCodePage()

void OdGiTextStyle::setCodePage ( OdCodePageId  codePage)
inline

Sets the CodePage associated with this TextStyle.

Parameters
codePage[in] CodePage.

Definition at line 500 of file GiTextStyle.h.

◆ setFileName()

void OdGiTextStyle::setFileName ( const OdString fontFileName)

Sets the name of the font file associated with this TextStyle.

Parameters
fontFileName[in] Filename.

◆ setFont() [1/2]

void OdGiTextStyle::setFont ( const OdString typeface,
bool  bold,
bool  italic,
int  charset,
int  pitchAndFamily 
)

Sets this TextStyle to use the specified Windows font characteristics.

Parameters
typeface[in] Typeface name of the font.
bold[in] Bold if and only if true.
italic[in] Italic if and only if true.
charset[in] Windows character set identifier.
pitchAndFamily[in] Windows pitch and character family identifier.
Remarks
If typeface is null, the Windows font information is removed from this text style.

◆ setFont() [2/2]

void OdGiTextStyle::setFont ( OdFont font)
inline

Sets this TextStyle to use the specified OdFont characteristics.

Parameters
pFont[in] Pointer to the font.

Definition at line 387 of file GiTextStyle.h.

◆ setFontFilePath()

void OdGiTextStyle::setFontFilePath ( const OdString fontFilePath)
inline

Sets the fully qualified font file path associated with this TextStyle.

Parameters
fontFilePath[in] Font file path.
Remarks
loadStyleRec() should be called after calling this function:

Definition at line 185 of file GiTextStyle.h.

◆ setIntercharSpacing()

void OdGiTextStyle::setIntercharSpacing ( double  dSpacing)

Allow to set interchar spacing for this TextStyle.

◆ setIsFixedIntercharSpacing()

void OdGiTextStyle::setIsFixedIntercharSpacing ( bool  isUseIntercharSpacing)
inline

Controls if fixed interchar spacing used.

Parameters
isShape[in] Controls setting.

DOM

Definition at line 534 of file GiTextStyle.h.

◆ setIsShape()

void OdGiTextStyle::setIsShape ( bool  isShape)
inline

Controls if the font file for this TextStyle is treated as a shape file.

Parameters
isShape[in] Controls setting.

DOM

Definition at line 354 of file GiTextStyle.h.

◆ setIsUseIntercharSpacing()

void OdGiTextStyle::setIsUseIntercharSpacing ( bool  isUseIntercharSpacing)
inline

Controls if interchar spacing used.

Parameters
isShape[in] Controls setting.

DOM

Definition at line 520 of file GiTextStyle.h.

◆ setObliquingAngle()

void OdGiTextStyle::setObliquingAngle ( double  obliquingAngle)

Sets the obliquing angle for this TextStyle.

Parameters
obliquingAngle[in] Obliquing angle.
Remarks
obliquingAngle has a domain of ±1.48335 radians (±85°). Negative angles will have Oda2PI added to them.
All angles are expressed in radians.

◆ setOverlined()

void OdGiTextStyle::setOverlined ( bool  isOverlined)

Controls the overlined drawing of text with this TextStyle.

Parameters
overlined[in] Controls overlined drawing.

◆ setPreLoaded()

void OdGiTextStyle::setPreLoaded ( bool  value) const

DOM

◆ setShapeLoaded()

void OdGiTextStyle::setShapeLoaded ( bool  shapeLoaded) const

Controls if the text font file for this TextStyle marked as loaded.

Parameters
shapeLoaded[in] Controls shape loaded.

DOM

◆ setShxFont()

void OdGiTextStyle::setShxFont ( bool  value) const

DOM

◆ setStriked()

void OdGiTextStyle::setStriked ( bool  isStriked)

Controls the strike drawing of text with this TextStyle.

Parameters
overlined[in] Controls strike drawing.

◆ setStyleName()

void OdGiTextStyle::setStyleName ( const OdString name)
inline

Definition at line 510 of file GiTextStyle.h.

◆ setTextSize()

void OdGiTextStyle::setTextSize ( double  textSize)

Sets the fixed text size for this TextStyle.

Parameters
textSize[in] Fixed text size.

◆ setTrackingPercent()

void OdGiTextStyle::setTrackingPercent ( double  trackingPercent)

Sets the tracking percent for this TextStyle.

Parameters
trackingPercent[in] TrackingPercent [0.75, 4.0].
Remarks
Tracking percent is a multiplier for the spacing between characters as defined in the font file.

◆ setUnderlined()

void OdGiTextStyle::setUnderlined ( bool  isUnderlined)

Controls the underlined drawing of text with this TextStyle.

Parameters
underlined[in] Controls underlined drawing.

◆ setUpsideDown()

void OdGiTextStyle::setUpsideDown ( bool  isUpsideDown)

Controls the upside down drawing of text with this TextStyle.

Parameters
isUpsideDown[in] Controls upside down drawing.

◆ setVertical()

void OdGiTextStyle::setVertical ( bool  isVertical)

Controls the vertical drawing of text with this TextStyle.

Parameters
isVertical[in] Controls vertical drawing.

◆ setXScale()

void OdGiTextStyle::setXScale ( double  xScale)

Sets the X-scale (width) factor for this TextStyle.

Parameters
xScale[in] X-scale factor.

◆ styleName()

const OdString& OdGiTextStyle::styleName ( ) const
inline

Definition at line 505 of file GiTextStyle.h.

◆ textSize()

double OdGiTextStyle::textSize ( ) const
inline

Returns the fixed text size for this TextStyle.

Definition at line 447 of file GiTextStyle.h.

◆ trackingPercent()

double OdGiTextStyle::trackingPercent ( ) const
inline

Returns the tracking percent for this TextStyle.

Remarks
Tracking percent is a multiplier for the spacing between characters as defined in the font file.

trackingPercent() has a range of [0.75..4].

Definition at line 481 of file GiTextStyle.h.

◆ ttfdescriptor() [1/2]

OdTtfDescriptor& OdGiTextStyle::ttfdescriptor ( )
inline

Returns a reference to the TTF descriptor for this TextStyle.

Definition at line 428 of file GiTextStyle.h.

◆ ttfdescriptor() [2/2]

const OdTtfDescriptor& OdGiTextStyle::ttfdescriptor ( ) const
inline

Definition at line 432 of file GiTextStyle.h.

◆ xScale()

double OdGiTextStyle::xScale ( ) const
inline

Returns the X-scale (width) factor for this TextStyle.

Definition at line 455 of file GiTextStyle.h.


The documentation for this class was generated from the following file: