Function ratatui_set_custom_font

Source
#[no_mangle]
pub extern "C" fn ratatui_set_custom_font(
    handle: *mut c_void,
    font_data: *const u8,
    font_len: u32,
) -> u8
Expand description

Replaces the embedded JetBrains Mono font with custom TTF bytes.

The cell width/height are recomputed from the new font’s metrics, the glyph cache is dropped, and the pixel buffer is resized to the new cols × cell_size dimensions. After a successful call the values reported by ratatui_pixel_width / ratatui_pixel_height change accordingly; callers must re-query them and resize any host-side texture before the next ratatui_end_frame* call.

§Returns

1 on success, 0 if handle is null, font_data is null/empty, or the bytes are not a valid font.