TrueType font rasterizer (stb_truetype backend).
<insightdock/font.h>
class Font;
| Name | Description |
|---|---|
TextMetrics | Width and height of a text string at an explicit pixel size. |
| Name | Description |
|---|---|
Font [constructor] | Constructors |
~Font [destructor] | Destructor |
operator= [deleted] | Copy assignment operator |
ascent | Ascent in pixels (distance from baseline to the top of the em box). |
baseline_offset | Distance from the alphabetic baseline up to the anchor for baseline, in pixels. |
data | Shared TTF bytes used by this font (for rendering at another resolution). |
draw_text | Draw text into an image buffer. |
draw_text_rotated_ccw | Draw text rotated 90° counter-clockwise (reads bottom-to-top). |
draw_text_rotated_cw | Draw text rotated 90° clockwise (reads top-to-bottom). |
is_loaded | Whether a font is loaded and ready to draw. |
line_height | Line height in pixels at current font size. |
load_from_file | Load a TrueType font from disk. |
load_from_memory | Load a TrueType font from memory. |
measure | Measure text at an explicit pixel size without changing the font state. |
measure_width | Measure text width in pixels at current font size (widest line if
present). |
set_size | Set pixel size for rendering (default 14). |
size | Current pixel size. |
Non-copyable. Construct with default embedded font or load custom TTF data.