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 Attributes | |
int32_t | iMaxWidth = INT32_MAX |
const CFlatPath * | iFlatPath = nullptr |
double | iPathStart = 0 |
double | iMaxTurnSine = 0.707106781 |
TTextBaseline | iBaseline = TTextBaseline::Alphabetic |
double | iBaselineOffset = 0 |
double | iLetterSpacing = 0 |
double | iWordSpacing = 0 |
double | iMaxCopyFitExpansion = 4 |
size_t | iFonts = 0 |
const TFont * | iFont = nullptr |
bool | iTraversePathBackwards: 1 |
bool | iCopyFit: 1 |
bool | iRoundAdvances: 1 |
Parameters to control the way text is drawn or measured.
TTextBaseline CartoType::TTextParam::iBaseline = TTextBaseline::Alphabetic |
The type of the baseline used to align the text.
double CartoType::TTextParam::iBaselineOffset = 0 |
The baseline offset in pixels. This value is added to the baseline's y coordinate. It can be used to shift the text away from the path it is drawn along, for example when drawing a road label beside the road instead of along the road.
bool CartoType::TTextParam::iCopyFit |
If drawing text on a path, stretch it out to fit the path by adding letter spacing and word spacing.
const CFlatPath* CartoType::TTextParam::iFlatPath = nullptr |
If iFlatPath is non-null the text is drawn along the path, which is relative to the origin passed to DrawText.
const TFont* CartoType::TTextParam::iFont = nullptr |
A pointer to an array of fonts, to be selected using special characters embedded in the text. This pointer must be non-null if iFonts is greater than zero.
size_t CartoType::TTextParam::iFonts = 0 |
The number of fonts in iFont. An array of fonts can be supplied to override the TFont object used to draw or measure the text, and thus allow rich text to be drawn.
double CartoType::TTextParam::iLetterSpacing = 0 |
Letter spacing in pixels. This value is added to all character advances.
double CartoType::TTextParam::iMaxCopyFitExpansion = 4 |
The greatest factor by which a string can be expanded when copy-fitting by adding letter spacing and word spacing. The default value is 4.
double CartoType::TTextParam::iMaxTurnSine = 0.707106781 |
If drawing on a path, the sine of the maximum tolerated angle between baselines of successive characters. The default is .707 = sin(45 degrees).
int32_t CartoType::TTextParam::iMaxWidth = INT32_MAX |
If the text cannot be fitted into iMaxWidth, measured along the baseline in pixels, it is truncated.
double CartoType::TTextParam::iPathStart = 0 |
If drawing along a path, the distance along the path to start at.
bool CartoType::TTextParam::iRoundAdvances |
Round advances to integer values, which is normally done if drawing horizontally or vertically, to maximise glyph cache hits.
bool CartoType::TTextParam::iTraversePathBackwards |
If drawing text on a path, traverse the path backwards.
double CartoType::TTextParam::iWordSpacing = 0 |
Word spacing in pixels. This value is added to the advance of word spaces.