FontRef.rasterize

Result!(GlyphBitmap, TextError) rasterize(GlyphId glyph, BitmapFormat format, Fixed26_6 subpixel, scope ubyte[] outBuf) @safe nothrow @nogc

Rasterizes one glyph into a caller buffer.

Parameters

glyphthe glyph id.
formatthe pixel format to produce (see BitmapFormat).
subpixelhorizontal offset in 26.6; implementors that cannot shift ignore it.
outBufcaller buffer for the pixels.

Returns

Result!(GlyphBitmap, TextError): on success the complete

geometry and the required byte count for the same glyph, format, options and subpixel offset. When required > outBuf.length nothing is written (resize and retry); otherwise outBuf[0 .. required] holds the pixels. UNSUPPORTED for a format the face cannot produce, INVALID_GLYPH for an unknown glyph, IO/PROVIDER_ERROR for backend failures.