CartoType C++ API 8.8-7-gb35e4dc71
for Windows, Linux, Qt and other platforms supporting C++ development
|
#include <cartotype_graphics_context.h>
Public Member Functions | |
Font ()=default | |
Font (std::shared_ptr< CEngine > aEngine) | |
Font (std::shared_ptr< CEngine > aEngine, const FontSpec &aFontSpec) | |
void | SetToSize (double aSize) |
const CartoTypeCore::FontSpec & | FontSpec () const |
void | SetColor (Color aColor) |
CartoTypeCore::Color | Color () const |
DrawResult | DrawText (GraphicsContext *aGc, const MString &aText, const PointFP &aOrigin, const TextParam &aParam, TextMetrics &aMetrics) |
bool | CanDrawText (const MString &aText) |
int32_t | Size () |
const FontMetrics & | Metrics () |
bool | IsNull () const |
A font associates a font specification with a matching typeface.
|
default |
Constructs a null font. It cannot be used until another font has been assigned to it.
|
inline |
Constructs a font with default attributes.
|
inline |
Constructs a font that is the best available match for aFontSpec.
bool CartoTypeCore::Font::CanDrawText | ( | const MString & | aText | ) |
Returns true if all required glyphs are available to draw some text.
|
inline |
Returns the text color; if it's null (completely transparent) the graphic context's current color is used.
DrawResult CartoTypeCore::Font::DrawText | ( | GraphicsContext * | aGc, |
const MString & | aText, | ||
const PointFP & | aOrigin, | ||
const TextParam & | aParam, | ||
TextMetrics & | 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 |
Returns the font specification used to construct this font.
|
inline |
Returns true if this is a null font, which cannot be used until another font has been assigned to it.
const FontMetrics & CartoTypeCore::Font::Metrics | ( | ) |
Returns the metrics of the current instance (size, etc.,) of the font. If no instance has been set null metrics are returned.
|
inline |
Sets the text color; if it's null (completely transparent) the graphic context's current color is used.
|
inline |
Sets 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 CartoTypeCore::Font::Size | ( | ) |
Returns the size of a font in pixels per em.