Expand description
GPUI’s engine contract: the scene representation that gpui builds and the
platform backends present.
This crate holds the intermediate representation (the Scene and its draw
primitives) together with the interfaces its collaborators implement. It
deliberately has no dependency on the windowing layer, on taffy, or on any
GPU driver, so alternative renderers and engines can reuse or replace the
scene representation without depending on those implementations.
Structs§
- Atlas
Texture Id - Identifies a texture within the sprite atlas.
- Atlas
Tile - A tile within a sprite atlas texture.
- Boundary
- A boundary between two lines of text.
- Engine
Layout Style - The layout-affecting subset of an element’s style.
- Font
- The configuration details for identifying a specific font.
- Font
Fallbacks - The fallback fonts that can be configured for a given font. Fallback fonts family names are stored here.
- Font
Family Id - An opaque identifier for a specific font family.
- Font
Features - The OpenType features that can be configured for a given font.
- FontId
- An opaque identifier for a specific font.
- Font
Metrics - A struct for storing font metrics. It is used to define the measurements of a typeface.
- FontRun
- A run of text with a single font.
- Font
Weight - The degree of blackness or stroke thickness of a font. This value ranges from 100.0 to 900.0, with 400.0 as normal.
- Frame
Session - A window’s layout engine session.
- GlyphId
- An identifier for a specific glyph, as returned by the platform text system.
- Grid
Template - A simplified representation of the grid-template-* value
- Grid
Template Refinement - A refinable version of [
#ident], see that documentation for details. - ImageId
- A unique identifier for the image cache
- Layout
Id - A unique identifier for a layout node, generated when a layout is requested.
- Line
Layout - A laid out and styled line of text
- Line
Layout Index - A saved position in a line-layout cache, used to reuse or truncate the layouts produced during a frame.
- Line
Wrapper - The GPUI line wrapper, used to wrap lines of text to a given width.
- Line
Wrapper Handle - A line wrapper borrowed from a
TextSystempool, returned on drop. - Measure
Handles - The handles a facade supplies for the duration of one layout pass.
- Missing
Glyph - A grapheme cluster that could not be represented by any available font.
- Monochrome
Sprite - Noop
Text System - Padded
Bool32 - A boolean stored as a
u32so that GPU-facing structs contain no compiler-inserted padding bytes, which would be undefined behavior to reinterpret as&[u8]when writing instance buffers. Guaranteed to be0or1by construction; shaders read it as au32/uint. - Paint
Surface - Path
- A line made up of a series of vertices and control points.
- PathId
- Path
Vertex - Polychrome
Sprite - Quad
- Render
Glyph Params - Parameters for rendering a glyph, used as cache keys for raster bounds.
- Render
Image Params - Render
SvgParams - Scene
- Shaped
Glyph - A single glyph, ready to paint.
- Shaped
Run - A run of text that has been shaped .
- Subpixel
Sprite - TextRun
- A styled run of text.
- TileId
- The unique ID of a tile within its texture.
- Transformation
Matrix - A data type representing a 2 dimensional transformation that can be applied to an element.
- Underline
- Wrap
Boundary - A boundary at which a line was wrapped.
- Wrapped
Line Layout - A line of text that has been wrapped to fit a given width.
Enums§
- Align
Content - Sets the distribution of space between and around content items For Flexbox it controls alignment in the cross axis For Grid it controls alignment in the block axis
- Align
Items - Used to control how child nodes are aligned. For Flexbox it controls alignment in the cross axis For Grid it controls alignment in the block axis
- Atlas
Key - Atlas
Texture Kind - The kind of content stored in an atlas texture.
- Border
Style - The style of a border.
- Display
- Sets the layout used for the children of this node
- Fallback
Font Class - The spacing behavior required of a fallback font.
- Flex
Direction - The direction of the flexbox layout main axis.
- Flex
Wrap - Controls whether flex items are forced onto one line or can wrap onto multiple lines.
- Font
Style - Allows italic or oblique faces to be selected.
- Grid
Template MinSize - The minimum size of a column or row in a grid layout
- Line
Fragment - A fragment of a line that can be wrapped.
- Overflow
- How children overflowing their container should affect layout
- Position
- The positioning strategy for this item.
- Primitive
- Primitive
Batch - Text
Rendering Mode - The text rendering mode to use for drawing glyphs.
- Truncate
From - Determines whether to truncate text from the start or end.
Constants§
- SUBPIXEL_
VARIANTS_ X - Number of subpixel glyph variants along the X axis.
- SUBPIXEL_
VARIANTS_ Y - Number of subpixel glyph variants along the Y axis.
Traits§
- Layout
Engine - A layout solver.
- Measure
Context - The handles a custom measure callback receives from the engine.
- Missing
Glyph Reports - A stream of grapheme clusters that exhausted font fallback.
- Missing
Glyph Sink - Accepts missing glyphs detected by a platform text system.
- Platform
Atlas - Platform
Text System - Scene
Renderer - A renderer that presents a
Sceneto some target. - Text
System - The text shaping, metric, wrapping, and line-layout surface.
Functions§
- font
- Get a
Fontfor a given name. - font_
name_ with_ fallbacks - Maps well-known virtual font names to their concrete equivalents.
- font_
name_ with_ fallbacks_ shared - Like
font_name_with_fallbacksbut accepts and returnsSharedStringreferences. - get_
gamma_ correction_ ratios - Compute gamma correction ratios for subpixel text rendering.
- update_
runs_ after_ truncation - Trims
runsto matchresultaftertruncate_linereplaced the removed text withellipsis.
Type Aliases§
- Align
Self - Used to control how the specified nodes is aligned.
Overrides the parent Node’s
AlignItemsproperty. For Flexbox it controls alignment in the cross axis For Grid it controls alignment in the block axis - Boxed
Measure Fn - A type-erased measure callback supplied to
LayoutEngine::request_measured_layout. - Justify
Content - Sets the distribution of space between and around content items For Flexbox it controls alignment in the main axis For Grid it controls alignment in the inline axis
- Justify
Items - Used to control how child nodes are aligned. Does not apply to Flexbox, and will be ignored if specified on a flex container For Grid it controls alignment in the inline axis
- Justify
Self - Used to control how the specified nodes is aligned.
Overrides the parent Node’s
JustifyItemsproperty. Does not apply to Flexbox, and will be ignored if specified on a flex child For Grid it controls alignment in the inline axis - Path
Vertex_ Scaled Pixels