#[non_exhaustive]pub struct ImageQuad {
pub screen: [f32; 4],
pub name: String,
pub char_offset: usize,
}Expand description
An inline image placeholder.
text-typeset computes the position and size but does NOT load or rasterize
the image. The adapter retrieves the image data (e.g., from
TextDocument::resource(name)) and draws it as a separate texture.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.screen: [f32; 4]Screen position and size: [x, y, width, height] in pixels.
The size is the laid-out one: an image wider than its line’s measure is capped to that measure, its height scaled by the same factor, so this can be smaller than the size the document stores. A host that draws a resize grip or reports the size the writer sees takes it from here, not from the document.
name: StringImage resource name (matches FragmentContent::Image::name from text-document).
char_offset: usizeDocument-absolute character offset of this image’s single U+FFFC.
The name alone cannot say which placement this is — a document may
hold one picture in three places — so anything that has to answer “is
THIS image inside the selection” needs the offset. Same value, derived
the same way, as the offset hit_test reports for a click on it.