CartoType API
Public Member Functions
CartoType::TFont Class Reference

#include <cartotype_graphics.h>

List of all members.

Public Member Functions

 TFont ()
 TFont (CEngine &aEngine)
 TFont (CEngine &aEngine, const TFontSpec &aFontSpec)
void SetToSize (TFixed aSize)
const TFontSpecFontSpec ()
CT_IMPORT TResult DrawText (CGraphicsContext *aGc, const MString &aText, const TPoint &aOrigin, const TTextParam &aParam, TTextMetrics &aMetrics)
CT_IMPORT int32 Size ()
CT_IMPORT const TFontMetricsMetrics ()
bool IsNull () const

Detailed Description

A font associates a font specification with a matching typeface.


Constructor & Destructor Documentation

CartoType::TFont::TFont ( ) [inline]

Construct a null font. It cannot be used until another font has been assigned to it.

CartoType::TFont::TFont ( CEngine aEngine) [inline]

Construct a font with default attributes.

CartoType::TFont::TFont ( CEngine aEngine,
const TFontSpec aFontSpec 
) [inline]

Construct a font that is the best available match for aFontSpec.


Member Function Documentation

CT_EXPORT TResult TFont::DrawText ( CGraphicsContext aGc,
const MString aText,
const TPoint aOrigin,
const TTextParam aParam,
TTextMetrics aMetrics 
)

Draw or measure text.

If aGc is null the text is measured, otherwise it is drawn into aGc. Drawing is controlled by aParam. Metrics are returned in aMetrics.

const TFontSpec& CartoType::TFont::FontSpec ( ) [inline]

Return the font specification used to construct this font.

bool CartoType::TFont::IsNull ( ) const [inline]

Return true if this is a null font, which cannot be used until another font has been assigned to it.

CT_EXPORT const TFontMetrics & TFont::Metrics ( )

Return the metrics of the current instance (size, etc,) of the font. If no typefaces have been loaded return null metrics.

void CartoType::TFont::SetToSize ( TFixed  aSize) [inline]

Set the em size to aSize and set other components of the typeface instance's transformation to a plain scaling transformation, removing any slant, skew, stretch or rotation.

CT_EXPORT int32 TFont::Size ( )

Get the size (pixels per em) of a font


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