RMGui 0.15.0
C11 retained-mode UI library: layout kernel, style schema, widget painters, fonts, software framebuffer
Loading...
Searching...
No Matches
rmgui_field_metrics_t Struct Reference

How a field's text is measured and sized. More...

#include <field.h>

Data Fields

const rmgui_font_t * font
int font_px
int line_height
int min_rows
int scale_percent
int max_rows
const rmgui_style_snapshot_t * style

Detailed Description

How a field's text is measured and sized.

font is required: the font the field wraps and places its caret with, borrowed by every layout produced with these metrics (it must outlive them, and rmgui_field_input measures with it); rmgui_field_paint draws with the same font. font_px and line_height are > 0; min_rows >= 1 is the minimum visible row count; scale_percent is 1..400 and sizes the scrollbar gutter in device pixels. style is the snapshot the embedded scrollbar resolves from, the pointer a host gives rmgui_scroll_t.style (NULL: the built-in): it sets the bar's geometry (arrows, minimum thumb, track action, repeat timing) and metrics, and colours come from the field's resolved style and skin binding. It is borrowed like font and must outlive the layouts produced with these metrics; a layout re-lays itself when the pointer changes. max_rows >= 0 is read by rmgui_field_measure only: 0 sizes the field at min_rows; > 0 lets the measured height follow the rows the text wraps to, between min_rows and min(max_rows, RMGUI_FIELD_VISIBLE_MAX) (never below min_rows).

Field Documentation

◆ font

const rmgui_font_t* rmgui_field_metrics_t::font

◆ font_px

int rmgui_field_metrics_t::font_px

◆ line_height

int rmgui_field_metrics_t::line_height

◆ min_rows

int rmgui_field_metrics_t::min_rows

◆ scale_percent

int rmgui_field_metrics_t::scale_percent

◆ max_rows

int rmgui_field_metrics_t::max_rows

◆ style

const rmgui_style_snapshot_t* rmgui_field_metrics_t::style

The documentation for this struct was generated from the following file: