.TH "lam_font_core" 3 "Version 1.0.0" "liblamina" \" -*- nroff -*- .ad l .nh .SH NAME lam_font_core \- liblamina font management .PP \- Font loading and lifecycle functions\&. .SH SYNOPSIS .br .PP .SS "Functions" .in +1c .ti -1c .RI "uint32_t \fBlam_font_open\fP (const char *png_path, unsigned cell_w, unsigned cell_h, uint8_t first, uint8_t last)" .br .RI "Load a bitmap font from an image file\&. " .ti -1c .RI "uint32_t \fBlam_font_open_ttf\fP (const char *ttf_path, uint32_t px_size)" .br .RI "Load a TrueType/OpenType font via FreeType2\&. " .ti -1c .RI "int \fBlam_font_add_fallback\fP (uint32_t font_ref, uint32_t fallback_ref)" .br .RI "Attach a fallback TTF font for missing codepoints\&. " .ti -1c .RI "int \fBlam_font_is_ttf\fP (uint32_t font_ref)" .br .RI "Return 1 if font_ref is a FreeType TTF/OTF font, 0 otherwise\&. " .ti -1c .RI "uint32_t \fBlam_font_line_height\fP (uint32_t font_ref, uint32_t px_size)" .br .RI "Query the line height (pixels) for a font at a given pixel size\&. " .ti -1c .RI "uint32_t \fBlam_font_ascent\fP (uint32_t font_ref, uint32_t px_size)" .br .RI "Query the typographic ascent (baseline offset from top, pixels)\&. " .ti -1c .RI "void \fBlam_font_close\fP (uint32_t font_ref)" .br .RI "Unload a font and free its resources\&. " .in -1c .SH "Detailed Description" .PP Font loading and lifecycle functions\&. .SH "Function Documentation" .PP .SS "int lam_font_add_fallback (uint32_t font_ref, uint32_t fallback_ref)" .PP Attach a fallback TTF font for missing codepoints\&. .PP \fBParameters\fP .RS 4 \fIfont_ref\fP Primary TTF font handle\&. .br \fIfallback_ref\fP Fallback TTF font handle\&. .RE .PP \fBReturns\fP .RS 4 0 on success, -1 on error\&. .RE .PP .SS "void lam_font_close (uint32_t font_ref)" .PP Unload a font and free its resources\&. .PP \fBParameters\fP .RS 4 \fIfont_ref\fP Font handle returned by \fBlam_font_open()\fP or \fBlam_font_open_ttf()\fP\&. .RE .PP .SS "uint32_t lam_font_line_height (uint32_t font_ref, uint32_t px_size)" .PP Query the line height (pixels) for a font at a given pixel size\&. For bitmap fonts, px_size acts as integer scale (0 => 1)\&. For TTF fonts, px_size == 0 uses the font's default pixel size\&. .SS "uint32_t lam_font_open (const char * png_path, unsigned cell_w, unsigned cell_h, uint8_t first, uint8_t last)" .PP Load a bitmap font from an image file\&. Loads a pre-rendered font atlas (e\&.g\&. generated from BDF) and registers it in liblamina’s internal font table\&. .PP \fBParameters\fP .RS 4 \fIpng_path\fP Path to the font atlas (PNG)\&. .br \fIcell_w\fP Width of each glyph cell\&. .br \fIcell_h\fP Height of each glyph cell\&. .br \fIfirst\fP First character code in the atlas\&. .br \fIlast\fP Last character code in the atlas\&. .RE .PP \fBReturns\fP .RS 4 Font handle (font_ref) or CM_MISS on error\&. .RE .PP .SS "uint32_t lam_font_open_ttf (const char * ttf_path, uint32_t px_size)" .PP Load a TrueType/OpenType font via FreeType2\&. Supports proportional and monospace fonts, full UTF-8 decoding, dynamic glyph atlas caching, and fallback chains\&. .PP \fBParameters\fP .RS 4 \fIttf_path\fP Path to a \&.ttf/\&.otf font file\&. .br \fIpx_size\fP Default pixel height (e\&.g\&. 14 or 16; 0 defaults to 16)\&. .RE .PP \fBReturns\fP .RS 4 Font handle (font_ref) or CM_MISS on error\&. .RE .PP .SH "Author" .PP Generated automatically by Doxygen for liblamina from the source code\&.