CFx SDK Documentation  2023 SP0
Public Types | Public Member Functions | List of all members
OdFont Class Referenceabstract

#include <OdFont.h>

Inheritance diagram for OdFont:
OdRxObject OdTrueTypeFontBase

Public Types

enum  {
  kBigFont10 = 0x0001 , kUniFont10 = 0x0002 , kFont10 = 0x0004 , kFont11 = 0x0008 ,
  kFont10A = 0x0010 , kTrueType = 0x0020 , kFontGdt = 0x0040 , kFontSimplex6 = 0x0080 ,
  kShapes11 = 0x0100 , kFontRsc = 0x0200
}
 

Public Member Functions

 ODRX_DECLARE_MEMBERS (OdFont)
 
 OdFont ()
 
OdUInt32 getFlags () const
 
OdUInt32 flags ()
 
void setFlags (OdUInt32 fontFlags)
 
void addFlag (OdUInt32 fontFlags)
 
virtual OdResult initialize (OdStreamBuf *pStreamBuf)=0
 
virtual OdResult drawCharacter (OdChar character, OdGePoint2d &advance, OdGiCommonDraw *pWd, OdTextProperties &textProperties)=0
 
virtual OdResult drawCharacter (OdChar character, OdGePoint2d &advance, OdGiConveyorGeometry *pGeometry, OdTextProperties &textProperties)=0
 
virtual double getAbove () const =0
 
virtual double getBelow () const =0
 
virtual OdUInt32 getAvailableChars (OdCharArray &characters)=0
 
virtual bool hasCharacter (OdChar character)=0
 
virtual double getHeight () const
 
virtual double getInternalLeading () const
 
double fontAbove () const
 
virtual double getUnderlinePos (double textSize) const
 
virtual double getOverlinePos (double textSize) const
 
virtual bool isShxFont ()
 
virtual double getAverageWidth ()
 
virtual void getScore (OdUInt16 character, OdGePoint2d &advance, OdGePoint3d *pointsOver, OdGePoint3d *pointsUnder, const OdTextProperties &textFlags)
 
virtual OdUInt32 getFontData (OdUInt32 dwTable, OdUInt32 dwOffset, void *pBuffer, OdUInt32 cbData) const
 
virtual bool supportsVerticalMode ()
 
virtual OdString getFileName () const
 
virtual void getDescriptor (OdTtfDescriptor &descr)
 
virtual OdInt32 getLogFont (void *lpLogFont) const
 
- Public Member Functions inherited from OdRxObject
 ODRX_HEAP_OPERATORS ()
 
 OdRxObject ()
 
virtual ~OdRxObject ()
 
virtual OdRxObjectqueryX (const OdRxClass *pClass) const
 
virtual OdRxObjectx (const OdRxClass *pClass) const
 
virtual OdRxClassisA () const
 
virtual void addRef ()=0
 
virtual void release ()=0
 
virtual long numRefs () const
 
bool isKindOf (const OdRxClass *pClass) const
 
virtual OdRxObjectPtr clone () const
 
virtual void copyFrom (const OdRxObject *pSource)
 
virtual OdRx::Ordering comparedTo (const OdRxObject *pOther) const
 
virtual bool isEqualTo (const OdRxObject *pOther) const
 

Additional Inherited Members

- Static Public Member Functions inherited from OdRxObject
static OdRxObjectPtr cast (const OdRxObject *pointer)
 
static OdRxClassdesc ()
 

Detailed Description

This class is the base interface class for classes that implements font objects. <group Other_Classes>

Definition at line 234 of file OdFont.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
kBigFont10 
kUniFont10 
kFont10 
kFont11 
kFont10A 
kTrueType 
kFontGdt 
kFontSimplex6 
kShapes11 
kFontRsc 

Definition at line 243 of file OdFont.h.

Constructor & Destructor Documentation

◆ OdFont()

OdFont::OdFont ( )
inline

Definition at line 241 of file OdFont.h.

Member Function Documentation

◆ addFlag()

void OdFont::addFlag ( OdUInt32  fontFlags)
inline

Adds the specified font flags to this Font object.

Parameters
fontFlags[in] Font flags.
Remarks
fontFlags must be a combination of zero or more of the following:

Value kBigFont10 0x0001 kUniFont10 0x0002 kFont10 0x0004 kFont11 0x0008 kFont10A 0x0010 kTrueType 0x0020 kFontGdt 0x0040 kFontSimplex6 0x0080 kShapes11 0x0100 kFontRsc 0x0200

Definition at line 343 of file OdFont.h.

◆ drawCharacter() [1/2]

virtual OdResult OdFont::drawCharacter ( OdChar  character,
OdGePoint2d advance,
OdGiCommonDraw pWd,
OdTextProperties textProperties 
)
pure virtual

Draws the specified character with this Font object.

Parameters
character[in] Character to draw.
advance[in] Offset to next character.
pWd[in/out] Draw object that can be used by this function to set the necessary attributes and create the necessary geometry.
textProperties[in] Text properties.

◆ drawCharacter() [2/2]

virtual OdResult OdFont::drawCharacter ( OdChar  character,
OdGePoint2d advance,
OdGiConveyorGeometry pGeometry,
OdTextProperties textProperties 
)
pure virtual

Draws the specified character with this Font object.

Parameters
character[in] Character to draw.
advance[in] Offset to next character.
pGeometry[in] Pointer to the modeler geometry.
textProperties[in] Text properties.

◆ flags()

OdUInt32 OdFont::flags ( )
inline

Returns the font flags for this Font object.

Remarks
flags() returns a combination of zero or more of the following:

Value kBigFont10 0x0001 kUniFont10 0x0002 kFont10 0x0004 kFont11 0x0008 kFont10A 0x0010 kTrueType 0x0020 kFontGdt 0x0040 kFontSimplex6 0x0080 kShapes11 0x0100 kFontRsc 0x0200

Definition at line 297 of file OdFont.h.

◆ fontAbove()

double OdFont::fontAbove ( ) const
inline

Returns the height of this Font object above the baseline.

Remarks
The default implementation of this function returns getAbove(), unless it is 0.0, in which case this function returns 1.0.

Definition at line 419 of file OdFont.h.

◆ getAbove()

virtual double OdFont::getAbove ( ) const
pure virtual

Returns the height of this Font object above the baseline.

◆ getAvailableChars()

virtual OdUInt32 OdFont::getAvailableChars ( OdCharArray characters)
pure virtual

Returns an array of the characters defined in this Font object.

Parameters
characters[out] Receives the array of characters.

◆ getAverageWidth()

virtual double OdFont::getAverageWidth ( )
inlinevirtual

Returns the average width of characters in this Font object.

Remarks
The default implementation of this function always returns 0.0.

Definition at line 464 of file OdFont.h.

◆ getBelow()

virtual double OdFont::getBelow ( ) const
pure virtual

Returns the depth of this font object below the baseline.

◆ getDescriptor()

virtual void OdFont::getDescriptor ( OdTtfDescriptor descr)
inlinevirtual

Definition at line 540 of file OdFont.h.

◆ getFileName()

virtual OdString OdFont::getFileName ( ) const
inlinevirtual

Returns font file name.

Remarks
The default implementation of this function returns empty string.

Definition at line 536 of file OdFont.h.

◆ getFlags()

OdUInt32 OdFont::getFlags ( ) const
inline

Returns the font flags for this Font object.

Remarks
getFlags() returns a combination of zero or more of the following:

Value kBigFont10 0x0001 kUniFont10 0x0002 kFont10 0x0004 kFont11 0x0008 kFont10A 0x0010 kTrueType 0x0020 kFontGdt 0x0040 kFontSimplex6 0x0080 kShapes11 0x0100 kFontRsc 0x0200

Definition at line 276 of file OdFont.h.

◆ getFontData()

OdUInt32 OdFont::getFontData ( OdUInt32  dwTable,
OdUInt32  dwOffset,
void pBuffer,
OdUInt32  cbData 
) const
inlinevirtual

Returns the font data for the specified character.

Parameters
dwTable[in] Metric table to query.
dwOffset[in] Offset into table.
pBuffer[in] Pointer to to the buffer to receive the data.
cbData[in] ???.
Returns
Returns the number of bytes returned in buffer.
Remarks
The default implementation of this function does nothing but return -1.

Definition at line 568 of file OdFont.h.

◆ getHeight()

virtual double OdFont::getHeight ( ) const
inlinevirtual

Returns the height of this Font object.

Definition at line 397 of file OdFont.h.

◆ getInternalLeading()

virtual double OdFont::getInternalLeading ( ) const
inlinevirtual

Returns the internal leading of this Font object.

Remarks
The default implementation of this function always returns 0.

Definition at line 406 of file OdFont.h.

◆ getLogFont()

virtual OdInt32 OdFont::getLogFont ( void lpLogFont) const
inlinevirtual

Returns the LOGFONT for this font

Parameters
lpLogFont[in] Pointer to the buffer to receive the data.
Returns
Returns the number of bytes returned in buffer. In case lpLogFont is NULL methods return number of bytes required in buffer.
Remarks
The default implementation of this function does nothing but return -1.

Definition at line 555 of file OdFont.h.

◆ getOverlinePos()

virtual double OdFont::getOverlinePos ( double  textSize) const
inlinevirtual

Returns the overline position for this Font object at the specified text size.

Parameters
textSize[in] Text size.
Remarks
The default implementation of this function returns 1.2 * textSize.

Definition at line 445 of file OdFont.h.

◆ getScore()

void OdFont::getScore ( OdUInt16  character,
OdGePoint2d advance,
OdGePoint3d pointsOver,
OdGePoint3d pointsUnder,
const OdTextProperties textFlags 
)
inlinevirtual

Returns arrays of points over and under the baseline for the specified character in this OdFont object.

Parameters
character[in] Character.
advance[in] Offset to next character.
pointsOver[in] Array of points over the baseline..
pointsUnder[in] Array of points under the baseline.
textFlags[in] Text flags.
Remarks
textFlags must be a combination of one or more of the following:

Value OdTextProperties::kNormalText 0x01 OdTextProperties::kVerticalText 0x02 OdTextProperties::kUnderlined 0x04 OdTextProperties::kOverlined 0x08 OdTextProperties::kLastChar 0x10 OdTextProperties::kInBigFont 0x20 OdTextProperties::kInclPenups 0x40

Remarks
The default implementation of this function does nothing but return.

Definition at line 561 of file OdFont.h.

◆ getUnderlinePos()

virtual double OdFont::getUnderlinePos ( double  textSize) const
inlinevirtual

Returns the underline position for this Font object at the specified text size.

Parameters
textSize[in] Text size.
Remarks
The default implementation of this function returns -2.0 * textSize.

Definition at line 434 of file OdFont.h.

◆ hasCharacter()

virtual bool OdFont::hasCharacter ( OdChar  character)
pure virtual

Returns true if and only if the specified character is defined in this Font object.

Parameters
character[in] Character.

◆ initialize()

virtual OdResult OdFont::initialize ( OdStreamBuf pStreamBuf)
pure virtual

Initializes this Font object to read font data from the specified StreamBuf object.

Parameters
pStreamBuf[in] Pointer to the StreamBuf object from which the data are to be read.
Returns
Returns eOk if successful, or an appropriate error code if not.

◆ isShxFont()

virtual bool OdFont::isShxFont ( )
inlinevirtual

Returns true if and only if this Font object is an SHX font.

Remarks
The default implementation of this function always returns true.

Definition at line 455 of file OdFont.h.

◆ ODRX_DECLARE_MEMBERS()

OdFont::ODRX_DECLARE_MEMBERS ( OdFont  )

◆ setFlags()

void OdFont::setFlags ( OdUInt32  fontFlags)
inline

Sets the font flags for this Font object.

Parameters
fontFlags[in] Font flags.
Remarks
fontFlags must be a combination of zero or more of the following:

Value kBigFont10 0x0001 kUniFont10 0x0002 kFont10 0x0004 kFont11 0x0008 kFont10A 0x0010 kTrueType 0x0020 kFontGdt 0x0040 kFontSimplex6 0x0080 kShapes11 0x0100 kFontRsc 0x0200

Definition at line 320 of file OdFont.h.

◆ supportsVerticalMode()

virtual bool OdFont::supportsVerticalMode ( )
inlinevirtual

Returns true if and only if the font supports vertical mode.

Remarks
The default implementation of this function returns false.

Definition at line 525 of file OdFont.h.


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