Skip to main content

Module text

Module text 

Source
Expand description

The user’s text settings, owned by egui-pop, on the settings window’s Fonts page (under Appearance): the text size (appearance.text_size, a percentage among TEXT_SIZES, so the font atlas holds few sizes), applied through the theme’s size scale (ThemeSpec::text_size; only text grows: the interface zoom, zoom, scales everything), and a family for interface text and one for numbers and code (appearance.font_ui, appearance.font_mono; empty keeps the theme’s), put first in the theme’s lists (ThemeSpec::font_ui).

These are the user’s, not the theme’s: changing theme keeps them.

The text size starts from the system’s: the desktop’s text scaling (SystemTextScale, given to AppBuilder::system_text_scale; the text-scale service of egui-pop-platform reads it) is the setting’s default, rounded to a step. The display’s scale is not part of it (winit gives that as the pixels per point). A value the user chose always wins; the seeded one is a default, so it is never saved as the user’s and follows the system from one run to the next.

Structs§

SystemTextScale
The system’s text scaling: what the desktop asks text to be multiplied by, separate from the display’s scale. egui-pop reads no system itself; an application gives it (AppBuilder::system_text_scale), and egui_pop_platform::text_scale::read reads it.

Constants§

FONT_SETTINGS
The settings shown on the settings window’s Fonts page.
SETTING_FONT_MONO
The setting naming the family of numbers and code (empty: the theme’s).
SETTING_FONT_UI
The setting naming the interface text’s family (empty: the theme’s).
SETTING_TEXT_SIZE
The setting: the text size as a percentage among the steps ("115%").

Functions§

describe
What the text_scale collector shows: the setting, its default, who chose it, the system’s factor and where it was read.
font
The family the user chose for a role, None for the theme’s.
font_setting
The setting of a role’s family.
label
A step’s label: "115%".
parse
The factor of a label ("115%" → 1.15), rounded to a step.
set_font
Chooses a family for a role (None: the theme’s); applied before the next frame.
set_text_size
Asks for a text size, rounded to a step; applied before the next frame (the theme is installed again).
text_size
The text size the setting asks for, a factor (1: the theme’s).
user_set
Whether the user chose the text size: it differs from the default the system seeded. A choice equal to that default is not told apart from it (only values that differ from their default are saved).