class

CMiriTextShaper

Module
Miri
Header
#include "Miri/Text/CMiriTextShaper.h"
Namespace
Miri

Constructors

SignatureNameDescription
CMiriTextShaper(const CMiriTextShaper&) = deleteCMiriTextShaper

Public functions

ReturnsNameDescription
CMiriTextShaper&Get
CMiriTextShaper&operator=
boolShapeRunShapes 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.
voidReleaseFace
voidClear
int32_tGlyphLoadFlagsThe 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

CMiriTextShaper

C++
CMiriTextShaper(const CMiriTextShaper&) = delete

Get

C++
static CMiriTextShaper& Get()

operator=

C++
CMiriTextShaper& operator=(const CMiriTextShaper&) = delete

ShapeRun

C++
bool ShapeRun(CMiriFont* font, float fontSize, float rasterScale, const char* text, uint32_t textLength, uint32_t runOffset, uint32_t runLength, bool kerning, std::vector<CMiriShapedRunGlyph>& 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

C++
void ReleaseFace(FT_Face face)

Clear

C++
void Clear()

GlyphLoadFlags

C++
static int32_t GlyphLoadFlags(EMiriFontHinting hinting = EMiriFontHinting::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).

Generated from Miri/Text/CMiriTextShaper.h via miri.json · Dec 5, 2026Version 1.1.0