Expand description
CPU text rasterization: fonts, glyph layout and glyph masks.
Structs§
- Font
Family Key - Identity an app-supplied face was registered under.
- Software
Glyph Atlas Glyph - A glyph with its mask, where to draw it and in which color.
- Software
Glyph Atlas Key - Identifies one rasterized glyph in a glyph atlas: the font, the glyph, and the scale and the synthetic styling it was drawn with.
- Software
Glyph Atlas Mask - The coverage mask of one rasterized glyph.
- Software
Glyph Atlas Placement - Where to draw a glyph whose mask the atlas already holds.
- Software
Glyph Raster Cache - A cache of rasterized glyph masks and kerning pairs, kept across frames.
- Software
Glyph Raster Cache Stats - Counters of a
SoftwareGlyphRasterCache. - Software
Text Font - A parsed face that measures and rasterizes text on the CPU, with its family names, weight and style.
- Software
Text Font Set - The faces that text resolves against, with the choice of the default face.
- Software
Text Measurer - A
TextMeasurerthat measures text with aSoftwareTextFontSetand caches the results. - Styled
Text Ref - The slice of a text payload that solid-run rasterization reads: content
plus span styles. Borrowable from both an
AnnotatedString(UI-side text) and aRenderString(a lowered scene’s link-handler-free view), so the run collectors serve both without copying either.
Enums§
- Font
Bytes - The bytes a face is parsed from.
- Software
Glyph Atlas RunGlyph - One glyph of a text run for a renderer that draws from a glyph atlas.
- Software
Text Font Error - Why a font could not be built for software text.
Functions§
- collect_
cached_ solid_ text_ atlas_ placements - Appends to
outthe atlas placements of the glyphs oftext, without rasterizing anything. ReturnsNonewhen a glyph has no cached mask or the style cannot be drawn as solid atlas glyphs. Arguments are as forrasterize_text_to_image. - collect_
solid_ text_ atlas_ glyphs - Appends to
outevery glyph oftextthat puts pixels down, with its mask, for a renderer that draws solid text from a glyph atlas. ReturnsNonewhen the style cannot be drawn as solid atlas glyphs. Arguments are as forrasterize_text_to_image. - collect_
solid_ text_ atlas_ run - Appends the glyphs of
textthat put pixels down toout: each either placed from the mask cache or rasterized into it. - cursor_
x_ for_ offset_ with_ font - Returns the x position in logical pixels of the caret at byte
offsetoftext. An offset past the end counts as the end, and one inside a character moves back to its start. - default_
software_ text_ font - The embedded default font, or
Nonewhen the build has none or it cannot be parsed. - layout_
text_ with_ font - Lays out
textwithfontinstyleand returns the per-character positions and line boxes as aTextLayoutResult. - measure_
annotated_ text_ with_ font - Measures annotated
text, including its span styles, drawn withfontinstyleatfont_sizelogical pixels. - measure_
annotated_ text_ with_ font_ set - Measures annotated
textwith the faces offonts, choosing a face for each span and falling back to other faces for characters that the first face lacks. - measure_
text_ with_ font - Measures
textdrawn withfontinstyleatfont_sizelogical pixels. - rasterize_
annotated_ text_ region - Rasterizes an annotated paragraph into
rect, preserving its originaltext_originwhen the image covers only a clipped portion of the paragraph. Glyphs from every span share line baselines and may extend across line boxes. - rasterize_
annotated_ text_ to_ image_ with_ glyph_ cache - Rasterizes annotated
textwithfontsinto an RGBA image that coversrect, reusing glyph masks fromglyph_cache. Arguments are as forrasterize_text_to_image. - rasterize_
text_ to_ image - Rasterizes
textwithfontinto an RGBA image that coversrect, in logical pixels, atscaledevice pixels per logical pixel.fallback_colorpaints text whose style names no color, andfont_sizeis in logical pixels. ReturnsNonewhen there is nothing to draw. - rasterize_
text_ to_ image_ with_ font - Rasterize a raw font at its ab_glyph pixel scale with explicit style spacing.
Use
rasterize_text_to_imagefor registered font sizing and automatic tracking. - rasterize_
text_ to_ image_ with_ glyph_ cache - Like
rasterize_text_to_image, and reuses glyph masks fromglyph_cache. - software_
text_ font_ from_ fonts_ or_ default - Returns the default face of the font set that
fontsyields, orNonewhen that set is empty. - software_
text_ font_ set_ from_ fonts_ or_ default - Builds the font set for
fonts. SeeSoftwareTextFontSet::from_fonts_or_default. - text_
offset_ for_ position_ with_ font - Returns the byte offset in
textof the caret position nearest to the point (x,y), in logical pixels in the text’s own coordinates. - try_
default_ software_ text_ font - Parses the embedded default font, or fails with
EmbeddedFontDisabledin a build without theembedded-default-fontfeature.