.TH "lam_font_render" 3 "Version 1.0.0" "liblamina" \" -*- nroff -*- .ad l .nh .SH NAME lam_font_render \- liblamina font rendering and measurement .PP \- Functions for drawing and measuring text\&. .SH SYNOPSIS .br .PP .SS "Enumerations" .in +1c .ti -1c .RI "enum " .br .RI "Optional layout flags for lam_font_*_px_ex()\&. " .in -1c .SS "Functions" .in +1c .ti -1c .RI "const char * \fBlam_font_draw\fP (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)" .br .RI "Draw text using a loaded font\&. " .ti -1c .RI "const char * \fBlam_font_draw_px\fP (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)" .br .RI "Draw text at an explicit pixel size (for TTF fonts; falls back to scale for bitmap fonts)\&. " .ti -1c .RI "const char * \fBlam_font_measure\fP (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)" .br .RI "Measure text layout and overflow\&. " .ti -1c .RI "const char * \fBlam_font_measure_px\fP (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)" .br .RI "Measure text at an explicit pixel size (for TTF fonts; falls back to scale for bitmap fonts)\&. " .ti -1c .RI "const char * \fBlam_font_draw_px_ex\fP (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)" .br .RI "Draw text at an explicit pixel size with letter-spacing and layout flags\&. " .ti -1c .RI "const char * \fBlam_font_measure_px_ex\fP (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)" .br .RI "Measure text at an explicit pixel size with letter-spacing and layout flags\&. " .in -1c .SH "Detailed Description" .PP Functions for drawing and measuring text\&. .SH "Function Documentation" .PP .SS "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)" .PP Draw text using a loaded font\&. Renders text within the given rectangle, obeying wrapping and breaking rules\&. Returns a pointer to the first unrendered character if overflow occurred\&. .PP \fBParameters\fP .RS 4 \fIfont_ref\fP Font handle\&. .br \fItext\fP UTF-8 text to render\&. .br \fIx0,y0\fP Top-left position (pixels)\&. .br \fIx1,y1\fP Bottom-right boundary (pixels)\&. .br \fIscale\fP Font scale factor (1 = base size)\&. .br \fIwhite_space\fP White-space handling mode (see lam_ui_white_space_t)\&. .br \fIword_break\fP Word-break behavior (see lam_ui_word_break_t)\&. .RE .PP \fBReturns\fP .RS 4 NULL if fully rendered, or pointer to remaining text\&. .RE .PP .SS "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)" .PP Measure text layout and overflow\&. Computes how text fits within the specified rectangle and returns a pointer to the first unrendered character if overflow occurred\&. .PP \fBParameters\fP .RS 4 \fIout_w\fP Optional: resulting text width in pixels\&. .br \fIout_h\fP Optional: resulting text height in pixels\&. .br \fIfont_ref\fP Font handle\&. .br \fItext\fP UTF-8 text to measure\&. .br \fIx0,y0\fP Top-left position (pixels)\&. .br \fIx1,y1\fP Bottom-right boundary (pixels)\&. .br \fIscale\fP Font scale factor\&. .br \fIwhite_space\fP White-space handling mode (see lam_ui_white_space_t)\&. .br \fIword_break\fP Word-break behavior (see lam_ui_word_break_t)\&. .RE .PP \fBReturns\fP .RS 4 NULL if text fully fits, or pointer to remaining text\&. .RE .PP .SH "Author" .PP Generated automatically by Doxygen for liblamina from the source code\&.