|
CartoType API
|
#include <cartotype_graphics.h>
Public Member Functions | |
| TFont () | |
| TFont (CEngine &aEngine) | |
| TFont (CEngine &aEngine, const TFontSpec &aFontSpec) | |
| void | SetToSize (TFixed aSize) |
| const TFontSpec & | FontSpec () |
| CT_IMPORT TResult | DrawText (CGraphicsContext *aGc, const MString &aText, const TPoint &aOrigin, const TTextParam &aParam, TTextMetrics &aMetrics) |
| CT_IMPORT int32 | Size () |
| CT_IMPORT const TFontMetrics & | Metrics () |
| bool | IsNull () const |
A font associates a font specification with a matching typeface.
| 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.
Construct a font that is the best available match for aFontSpec.
| 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
1.7.5.1