Skip to main content

Module glyphs

Module glyphs 

Source
Expand description

Terminal glyphs, with an ASCII fallback for terminals not doing UTF-8 (SSH, a C locale), where Unicode would render as replacement boxes.

No Nerd Font glyphs. Every Unicode character passes the font-coverage audit (scripts/code/audit_glyphs.py): present in JetBrainsMono Nerd Font, and never an Emoji=Yes, Emoji_Presentation=No codepoint missing from Liberation Mono or Noto Sans Mono (those fall back to the color-emoji font and draw blank or clipped). Nerd Font icons appear only in the Omarchy menu and in users’ own [glyphs] overrides.

Structs§

Glyphs
Symbols used by the UI, in whichever alphabet the terminal can render.
PlotMarks
The marks ratatui’s Chart, Canvas and BarChart draw, and their axis and legend lines; ratatui ignores the locale, so each set names its own.

Enums§

SlotOverride
One [glyphs] override from the config: a single glyph, or a list for the slots that hold one (spinner, score_marks, mini_bars, bar_eighths).
UnicodeMode
What the user asked for, from [display] unicode.

Functions§

active_is_unicode
Whether the active set is Unicode (copies of consts have no identifying address).
ascii
The ASCII set.
asciify_instructions
Instructional text mapped to ASCII for the help overlay on a non-UTF-8 terminal, at the render boundary only (user data is never transliterated). Coverage is checked by every_help_screen_is_ascii_clean.
cell_width
Cells text takes in a table cell, grapheme by grapheme at ratatui’s widths: unlike display_width, a joined emoji sequence counts once and control characters zero.
display_width
Display columns text occupies; scalar counts get CJK and combining marks wrong.
dotted
Text written with · between its parts, in the glyph set’s middot: - on an ASCII terminal. A · in a UI string is this template, drawn through here.
environment_is_utf8
Whether the terminal can be trusted with UTF-8: LC_ALL over LC_CTYPE over LANG, as POSIX; with none set, only Windows counts. The locale, not terminal capability, decides whether multi-byte characters render.
fit
text in width columns, cut at its end and marked with the ellipsis.
fit_cells
text fitted to width cells: whole if it fits, else cut at a grapheme boundary and closed with marker (never half a wide character). Control characters are dropped, as ratatui drops them. If marker itself does not fit, as much as does. Reads text only as far as width cells and one more, however long it is.
fit_middle
text in width columns, cut from the middle: weather/…/daily.
fit_start
text in width columns, cut at its start: a path keeps its leaf. The ellipsis is measured, since it is three columns on an ASCII terminal.
get
The active glyph set. Falls back to detection when init_with_overrides was never called, so library users and tests get sensible symbols without ceremony.
init_with_overrides
Choose the glyph set for this run, with [glyphs] overrides over the Unicode set. Never over the ASCII set: it is the tested floor, where rich-font overrides would garble. Later calls are ignored.
instructions_in_ascii
text with every instructional character replaced by its (wider) ASCII twin. Help rows (key, two+ spaces, description) are re-padded per section, so descriptions stay aligned and a section shifts right together when a key outgrows its column.
take_columns
The longest prefix of text that fits width display columns, never splitting a wide character.
take_columns_end
The longest suffix of text that fits width display columns, never splitting a wide character.
unicode
The Unicode set, for tests and for callers that know their output is UTF-8.
validate_overrides
Check a [glyphs] override map at load time, naming the bad slot. Each override must keep its glyph’s display width, so every layout width invariant holds.