Expand description
Text for oxframe: layout with parley, glyph outlines with skrifa.
Status: oxframe is under very active development. The API is not stable yet and may change from version to version. Pin the exact version in your Cargo.toml and check the changelog before upgrading.
Text becomes a BezPath, so it renders identically on every backend
and can be morphed and trimmed like any other path.
Determinism: only embedded fonts are used — Inter and JetBrains Mono
(SIL OFL 1.1, see fonts/) plus fonts registered with
register_font. System fonts are never consulted.
Structs§
- Code
Diff - Edit script from one source to another.
- Edit
Error - Why a source edit could not be applied.
- Glyph
Info - Where a glyph came from.
- Loc
- A place in a source. Lines are 1-based, columns are 0-based characters.
- Piece
- One highlight token, split at whitespace so a renamed word does not take the spaces around it with it. The color is still the highlighter’s.
- Text
Layout - Laid-out text. Coordinates: origin at the top-left of the layout box, y pointing down.
- Text
Span - A run of text with its own style; unset fields inherit the base style.
- Text
Style - How text is laid out.
Enums§
- Align
- Horizontal alignment of lines.
- Lang
- Language for syntax highlighting.
- Line
Edit - What happened to one line. Indexes are 0-based.
- Piece
Edit - What happened to one piece.
- Token
- Kind of a highlighted piece of code.
Constants§
Functions§
- code_
lines - Lines of
src, without their newlines. A trailing newline does not add an empty line; a blank line in the middle does. - diff_
code - Diff
fromintoto. Highlight tokens come fromlang. - highlight
- Splits
codeinto highlighted ranges covering all of it. - insert_
at - Inserts
textatline(1-based) andcol(0-based characters). - layout
- Lays out
text(cached by text and style). - layout_
rich - Lays out styled spans as one paragraph (cached).
- line_
pieces - Highlight pieces of one line, split at whitespace.
- map_
focus - Where the focused old lines land.
(0, 0)stays “everything”.Nonewhen every focused line was deleted. - register_
font - Registers a font (TTF/OTF/TTC bytes, e.g. from
include_bytes!). Returns the family names it provides. - remove_
range - Removes the half-open range
start..end. - replace_
range - Replaces the half-open range
start..endwithtext.