ttypt/lam-font.h(3)liblaminaVersion 1.0.0

NAME

ttypt/lam-font.h - Public header for the liblamina bitmap font system.

SYNOPSIS

#include <stdint.h>
#include './lam-ui.h'

Enumerations

enum

Optional layout flags for lam_font_*_px_ex().

Functions

uint32_t lam_font_open (const char *png_path, unsigned cell_w, unsigned cell_h, uint8_t first, uint8_t last)

Load a bitmap font from an image file.

uint32_t lam_font_open_ttf (const char *ttf_path, uint32_t px_size)

Load a TrueType/OpenType font via FreeType2.

int lam_font_add_fallback (uint32_t font_ref, uint32_t fallback_ref)

Attach a fallback TTF font for missing codepoints.

int lam_font_is_ttf (uint32_t font_ref)

Return 1 if font_ref is a FreeType TTF/OTF font, 0 otherwise.

uint32_t lam_font_line_height (uint32_t font_ref, uint32_t px_size)

Query the line height (pixels) for a font at a given pixel size.

uint32_t lam_font_ascent (uint32_t font_ref, uint32_t px_size)

Query the typographic ascent (baseline offset from top, pixels).

void lam_font_close (uint32_t font_ref)

Unload a font and free its resources.

const char * lam_font_draw (uint32_t font_ref, const char *text, uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1, uint32_t scale, lam_ui_white_space_t white_space, lam_ui_word_break_t word_break)

Draw text using a loaded font.

const char * lam_font_draw_px (uint32_t font_ref, const char *text, uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1, uint32_t px_size, lam_ui_white_space_t white_space, lam_ui_word_break_t word_break)

Draw text at an explicit pixel size (for TTF fonts; falls back to scale for bitmap fonts).

const char * lam_font_measure (uint32_t *out_w, uint32_t *out_h, uint32_t font_ref, const char *text, uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1, uint32_t scale, lam_ui_white_space_t white_space, lam_ui_word_break_t word_break)

Measure text layout and overflow.

const char * lam_font_measure_px (uint32_t *out_w, uint32_t *out_h, uint32_t font_ref, const char *text, uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1, uint32_t px_size, lam_ui_white_space_t white_space, lam_ui_word_break_t word_break)

Measure text at an explicit pixel size (for TTF fonts; falls back to scale for bitmap fonts).

const char * lam_font_draw_px_ex (uint32_t font_ref, const char *text, uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1, uint32_t px_size, lam_ui_white_space_t white_space, lam_ui_word_break_t word_break, float letter_spacing_px, uint32_t flags)

Draw text at an explicit pixel size with letter-spacing and layout flags.

const char * lam_font_measure_px_ex (uint32_t *out_w, uint32_t *out_h, uint32_t font_ref, const char *text, uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1, uint32_t px_size, lam_ui_white_space_t white_space, lam_ui_word_break_t word_break, float letter_spacing_px, uint32_t flags)

Measure text at an explicit pixel size with letter-spacing and layout flags.

Detailed Description

Public header for the liblamina bitmap font system.

Declares the API for loading, measuring and rendering bitmap-based fonts used by the liblamina rendering layer.

Author

Generated automatically by Doxygen for liblamina from the source code.