CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
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 (OdChar 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) const
 
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 implement font objects. <group Other_Classes>

Definition at line 370 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 379 of file OdFont.h.

Constructor & Destructor Documentation

◆ OdFont()

OdFont::OdFont ( )
inline

Definition at line 377 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] Property font flags to set.
Remarks
Font flags 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 483 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.
Returns
Returns eOk if the specified character is drawn with the font object successfully, or an appropriate error code otherwise.

◆ 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.
Returns
Returns eOk if the specified character is drawn with the font object successfully, or an appropriate error code otherwise.

◆ flags()

OdUInt32 OdFont::flags ( )
inline

Returns the font flags for this font object.

Returns
The font flags for this font object.
Remarks
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 437 of file OdFont.h.

◆ fontAbove()

double OdFont::fontAbove ( ) const
inline

Returns the height of this font object above the baseline.

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 581 of file OdFont.h.

◆ getAbove()

virtual double OdFont::getAbove ( ) const
pure virtual

Returns the height of this font object above the baseline.

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.
Returns
The array of the characters defined in this font object.

◆ getAverageWidth()

virtual double OdFont::getAverageWidth ( )
inlinevirtual

Returns the average width of characters in this font object.

Returns
The average width of characters in this font object.
Remarks
The default implementation of this function always returns 0.0.

Definition at line 636 of file OdFont.h.

◆ getBelow()

virtual double OdFont::getBelow ( ) const
pure virtual

Returns the depth of this font object below the baseline.

Returns
The depth of this font object below the baseline.

◆ getDescriptor()

virtual void OdFont::getDescriptor ( OdTtfDescriptor descr) const
inlinevirtual

Gets the OdTtfDescriptor for this font.

Parameters
descr[out] TrueType font descriptor.

Definition at line 719 of file OdFont.h.

◆ getFileName()

virtual OdString OdFont::getFileName ( ) const
inlinevirtual

Returns the font file name.

Returns
The font file name.
Remarks
The default implementation of this function returns an empty string.

Definition at line 709 of file OdFont.h.

◆ getFlags()

OdUInt32 OdFont::getFlags ( ) const
inline

Returns the font flags for this font object.

Returns
The font flags for this font object.
Remarks
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 414 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 the buffer to receive the data.
cbData[in] The length, in bytes, of the information to be retrieved.
Returns
The font data for the specified character.
Remarks
The default implementation of this function does nothing but return -1.

The number of bytes returned in the buffer.

Definition at line 746 of file OdFont.h.

◆ getHeight()

virtual double OdFont::getHeight ( ) const
inlinevirtual

Returns the height of this font object.

Returns
The height of this font object.

Definition at line 554 of file OdFont.h.

◆ getInternalLeading()

virtual double OdFont::getInternalLeading ( ) const
inlinevirtual

Returns the internal leading of this font object.

Returns
The internal leading of this font object.
Remarks
The default implementation of this function always returns 0.

Definition at line 566 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
The number of bytes returned in the buffer.
Remarks
The default implementation of this function does nothing but return -1. If lpLogFont is NULL, the method returns the number of bytes required in the buffer.

Definition at line 733 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.
Returns
The overline position for this font object at the specified text size.
Remarks
The default implementation of this function returns 1.2 * textSize.

Definition at line 612 of file OdFont.h.

◆ getScore()

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

Returns an array 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.
Returns
Array of points over and under the baseline for the specified character in this OdFont object.
Remarks
The default implementation of this function does nothing.

The textFlags parameter 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

Definition at line 739 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.
Returns
The underline position for this font object at the specified text size.
Remarks
The default implementation of this function returns -2.0 * textSize.

Definition at line 599 of file OdFont.h.

◆ hasCharacter()

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

Checks whether the specified character is defined in this font object.

Parameters
character[in] Character.
Returns
The true value if the specified character is defined in this font object successfully, or an appropriate error code otherwise.

◆ 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 is to be read.
Returns
Returns eOk if the font object is initialized successfully, or an appropriate error code otherwise.

◆ isShxFont()

virtual bool OdFont::isShxFont ( )
inlinevirtual

Checks whether this font object is an SHX font.

Returns
The true value if the font object is an SHX font, or false otherwise.
Remarks
The default implementation of this function always returns true.

Definition at line 624 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] Property font flags to set.
Remarks
Font flags 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 460 of file OdFont.h.

◆ supportsVerticalMode()

virtual bool OdFont::supportsVerticalMode ( )
inlinevirtual

Checks whether the font supports vertical mode.

Returns
The true value if the font supports vertical mode, or false otherwise.
Remarks
The default implementation of this function returns false.

Definition at line 697 of file OdFont.h.


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