The OpenD Programming Language

FONScontextInternal.addFontMem

Add font to FontStash, using data from memory.

And already loaded font to FontStash. You can replace existing logical fonts. But note that you can't remove logical font by passing "empty" data.

If FONS_INVALID returned, data won't be freed even if freeData is true.
struct FONScontextInternal
nothrow @trusted @nogc
int
addFontMem
(
const(char)[] name
,
ubyte* data
,,,
bool defAA = false
)

Parameters

name const(char)[]

logical font name, that will be used to select this font later.

data ubyte*

font data.

dataSize int

font data size.

freeData bool

should FontStash take ownership of the font data?

defAA bool

should FontStash use antialiased font rasterizer?

Return Value

Type: int

font id or FONS_INVALID.

Meta