CArcTextShaper
- Module
- Arc
- Header
#include "Arc/Text/CArcTextShaper.h"- Namespace
Arcf
Constructors
| Signature | Name | Description |
|---|---|---|
CArcTextShaper(const CArcTextShaper&) = delete | CArcTextShaper |
Public functions
| Returns | Name | Description |
|---|---|---|
CArcTextShaper& | Get | |
CArcTextShaper& | operator= | |
bool | ShapeRun | Shapes at the device pixel size fontSize maps to under rasterScale and converts the result back to logical units, so every advance and offset is a whole number of device pixels. |
void | ReleaseFace | |
void | Clear | |
int32_t | GlyphLoadFlags | The FreeType load flags both the shaper (advances) and the bitmap atlas (outlines) use, so advances and the bitmaps they position come from one grid-fitting: light hinting, vertical snapping only, unless the font opted out of hinting altogether (an icon font). |
Function details
CArcTextShaper
CArcTextShaper(const CArcTextShaper&) = deleteGet
static CArcTextShaper& Get()operator=
CArcTextShaper& operator=(const CArcTextShaper&) = deleteShapeRun
bool ShapeRun(CArcFont* font, float fontSize, float rasterScale, const char* text, uint32_t textLength, uint32_t runOffset, uint32_t runLength, bool kerning, std::vector<CArcShapedRunGlyph>& outGlyphs, bool rightToLeft = false, const char* features = nullptr)Shapes at the device pixel size fontSize maps to under rasterScale and converts the result back to logical units, so every advance and offset is a whole number of device pixels. Hinted advances taken at the logical size instead describe a grid-fitting the atlas bitmaps were never drawn with, and the pen drifts off the pixel grid. A right-to-left run comes back in HarfBuzz's visual order (clusters descending), with mirrored brackets and the script's RTL forms; the caller decides the direction from the run's bidi level. features is a comma or space separated list in HarfBuzz syntax ("tnum", "ss01", "-liga"); an unparsable entry is skipped.
ReleaseFace
void ReleaseFace(FT_Face face)Clear
void Clear()GlyphLoadFlags
static int32_t GlyphLoadFlags(EArcFontHinting hinting = EArcFontHinting::Light)The FreeType load flags both the shaper (advances) and the bitmap atlas (outlines) use, so advances and the bitmaps they position come from one grid-fitting: light hinting, vertical snapping only, unless the font opted out of hinting altogether (an icon font).