pub struct ShapeOptions {
pub width: Option<f32>,
pub wrap: WrapMode,
pub max_lines: Option<u32>,
pub family: Option<Arc<str>>,
pub weight: u16,
pub line_height: Option<f32>,
}Expand description
Extension shape parameters. Backends that don’t override
[TextShaper::shape_wrapped] fall through to the no-wrap path so old
callers keep working.
Fields§
§width: Option<f32>Available width for wrapping, in logical pixels. None = unbounded.
wrap: WrapModeWrap policy.
max_lines: Option<u32>Hard cap on line count after shaping (callers cull). None = unbounded.
family: Option<Arc<str>>CSS font-family fallback chain as authored (comma-separated,
possibly quoted names, generic keywords allowed). None = the
platform sans-serif. The backend resolves the first family
present in its font database.
weight: u16CSS font-weight (1-1000; 400 = normal, 700 = bold).
line_height: Option<f32>Resolved CSS line-height, in the same unit space as the size_px
argument passed alongside these options to TextShaper::shape
(a caller that scales size_px by DPR must scale this the same
way). None => the backend’s own line-height: normal fallback
(DEFAULT_LINE_HEIGHT_MULTIPLIER). Callers with a TextStyle-ish
source resolve one via
lumen_core::components::resolve_line_height before constructing
these options; this field never re-derives the multiplier itself.
Implementations§
Source§impl ShapeOptions
impl ShapeOptions
Sourcepub fn resolved_line_height(&self, size_px: f32) -> f32
pub fn resolved_line_height(&self, size_px: f32) -> f32
Line height in the same unit space as size_px: the authored CSS
line-height when the caller resolved one, else size_px times
DEFAULT_LINE_HEIGHT_MULTIPLIER. Shaping, measuring, and
painting all route through this so one paragraph cannot end up
with three different line heights.
Trait Implementations§
Source§impl Clone for ShapeOptions
impl Clone for ShapeOptions
Source§fn clone(&self) -> ShapeOptions
fn clone(&self) -> ShapeOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ShapeOptions
impl Debug for ShapeOptions
Auto Trait Implementations§
impl Freeze for ShapeOptions
impl RefUnwindSafe for ShapeOptions
impl Send for ShapeOptions
impl Sync for ShapeOptions
impl Unpin for ShapeOptions
impl UnsafeUnpin for ShapeOptions
impl UnwindSafe for ShapeOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FromTemplate for T
impl<T> FromTemplate for T
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
§impl<T> Template for T
impl<T> Template for T
§fn build_template(
&self,
_context: &mut TemplateContext<'_, '_>,
) -> Result<<T as Template>::Output, BevyError>
fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>
entity context to produce a [Template::Output].§fn clone_template(&self) -> T
fn clone_template(&self) -> T
Clone.