LDKTextSize
typedef LDKSizef LDKTextSize;
typedef LDKSizef LDKTextSize;
Clears the dirty flag of an atlas page.
LDK_API void ldk_ttf_clear_page_dirty(
LDKFontInstance *instance,
u32 page_index
);
LDKFontInstance *instanceu32 page_indexCreates a font face from TrueType font data.
LDK_API LDKFontFace * ldk_ttf_face_create(
void const *data,
u32 data_size
);
void const *datau32 data_sizeNew font face, or NULL on failure.
Destroys a font face and all font instances created from it.
LDK_API void ldk_ttf_face_destroy(LDKFontFace *face);
LDKFontFace *faceGets or creates a font instance for a specific pixel height.
LDK_API LDKFontInstance * ldk_ttf_get_instance(
LDKFontFace *face,
float pixel_height,
LDKFontAtlasDesc const *atlas_desc
);
LDKFontFace *facefloat pixel_heightLDKFontAtlasDesc const *atlas_descFont instance, or NULL on failure.
Gets the horizontal kerning adjustment between two codepoints.
LDK_API float ldk_ttf_get_kerning(
LDKFontInstance const *instance,
u32 left_codepoint,
u32 right_codepoint
);
LDKFontInstance const *instanceu32 left_codepointu32 right_codepointKerning adjustment in pixels, or 0 if unavailable.
Gets the scaled line height for a font instance.
LDK_API float ldk_ttf_get_line_height(LDKFontInstance *instance);
LDKFontInstance *instanceLine height in pixels, or 0 if instance is NULL.
Gets scaled font metrics for a font instance.
LDK_API LDKFontMetrics ldk_ttf_get_metrics(LDKFontInstance const *instance);
LDKFontInstance const *instanceFont metrics. Returns zeroed metrics if instance is NULL.
Gets the number of atlas pages owned by a font instance.
LDK_API u32 ldk_ttf_get_page_count(LDKFontInstance const *instance);
LDKFontInstance const *instanceNumber of atlas pages, or 0 if instance is NULL.
Gets information for a font atlas page.
LDK_API bool ldk_ttf_get_page_info(
LDKFontInstance const *instance,
u32 page_index,
LDKFontPageInfo *out_page
);
LDKFontInstance const *instanceu32 page_indexLDKFontPageInfo *out_pagetrue if page information was written, false on failure.
Gets the pixel height used by a font instance.
LDK_API float ldk_ttf_get_pixel_height(LDKFontInstance const *instance);
LDKFontInstance const *instancePixel height, or 0 if instance is NULL.
Preloads printable basic ASCII glyphs.
LDK_API bool ldk_ttf_preload_basic_ascii(LDKFontInstance *instance);
LDKFontInstance *instancetrue if all glyphs were processed, false on failure.
Preloads and caches all glyphs in an inclusive codepoint range.
LDK_API bool ldk_ttf_preload_range(
LDKFontInstance *instance,
u32 first_codepoint,
u32 last_codepoint
);
LDKFontInstance *instanceu32 first_codepointu32 last_codepointtrue if all glyphs were processed, false on failure.
Consumes one UTF-8 codepoint and advances the input cursor.
LDK_API bool ldk_ttf_utf8_consume_codepoint(
char const **cursor,
u32 *out_codepoint
);
char const **cursoru32 *out_codepointtrue if a codepoint was consumed, false if input is invalid or the cursor is at the string terminator.
Consumes one UTF-8 codepoint within a bounded byte range and advances the input cursor.
LDK_API bool ldk_ttf_utf8_consume_codepoint_range(
char const **cursor,
char const *end,
u32 *out_codepoint
);
char const **cursorchar const *endu32 *out_codepointtrue if a codepoint was consumed, false if input is invalid, the cursor is at the string terminator, or the cursor reached end.