|
CartoType C++ API 7.8.2, 2022-03-25
for Windows, Linux, Qt and other platforms supporting C++ development
|
#include <cartotype_graphics_context.h>
Public Member Functions | |
| TFont ()=default | |
| TFont (std::shared_ptr< CEngine > aEngine) | |
| TFont (std::shared_ptr< CEngine > aEngine, const TFontSpec &aFontSpec) | |
| void | SetToSize (double aSize) |
| const TFontSpec & | FontSpec () const |
| void | SetColor (TColor aColor) |
| TColor | Color () const |
| TDrawResult | DrawText (CGraphicsContext *aGc, const MString &aText, const TPoint &aOrigin, const TTextParam &aParam, TTextMetrics &aMetrics) |
| int32_t | Size () |
| const TFontMetrics & | Metrics () |
| bool | IsNull () const |
A font associates a font specification with a matching typeface.
|
default |
Construct a null font. It cannot be used until another font has been assigned to it.
|
inline |
Construct a font with default attributes.
|
inline |
Construct a font that is the best available match for aFontSpec.
|
inline |
Get the text color; if it's null (completely transparent) the graphic context's current color is used.
| TDrawResult CartoType::TFont::DrawText | ( | CGraphicsContext * | aGc, |
| const MString & | aText, | ||
| const TPoint & | aOrigin, | ||
| const TTextParam & | aParam, | ||
| TTextMetrics & | aMetrics | ||
| ) |
Draws or measures 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.
|
inline |
Return the font specification used to construct this font.
|
inline |
Return true if this is a null font, which cannot be used until another font has been assigned to it.
| const TFontMetrics & CartoType::TFont::Metrics | ( | ) |
Returns the metrics of the current instance (size, etc.,) of the font. If no instance has been set null metrics are returned.
|
inline |
Set the text color; if it's null (completely transparent) the graphic context's current color is used.
|
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.
| int32_t CartoType::TFont::Size | ( | ) |
Gets the size of a font in pixels per em.