pub struct ShapeRequest<'a> {
pub text: &'a str,
pub font_data: &'a [u8],
pub px_size: f32,
pub direction: ShapeDirection,
pub script: Option<[u8; 4]>,
pub language: Option<[u8; 4]>,
pub features: Vec<ShapeFeature>,
}Expand description
A complete shaping request with all parameters.
Build via ShapeRequest::builder and then call
SwashShaper::shape_request.
Fields§
§text: &'a strUTF-8 text to shape.
font_data: &'a [u8]Raw font bytes.
px_size: f32Font size in pixels-per-em.
direction: ShapeDirectionShaping direction.
script: Option<[u8; 4]>OpenType script tag (e.g. b"latn", b"arab"), or None for
auto-detection.
language: Option<[u8; 4]>OpenType language tag (e.g. b"ENG ", b"ARA "), or None.
features: Vec<ShapeFeature>OpenType feature overrides.
Implementations§
Source§impl<'a> ShapeRequest<'a>
impl<'a> ShapeRequest<'a>
Sourcepub fn builder() -> ShapeRequestBuilder<'a>
pub fn builder() -> ShapeRequestBuilder<'a>
Returns a new ShapeRequestBuilder.
Trait Implementations§
Source§impl<'a> Clone for ShapeRequest<'a>
impl<'a> Clone for ShapeRequest<'a>
Source§fn clone(&self) -> ShapeRequest<'a>
fn clone(&self) -> ShapeRequest<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for ShapeRequest<'a>
impl<'a> RefUnwindSafe for ShapeRequest<'a>
impl<'a> Send for ShapeRequest<'a>
impl<'a> Sync for ShapeRequest<'a>
impl<'a> Unpin for ShapeRequest<'a>
impl<'a> UnsafeUnpin for ShapeRequest<'a>
impl<'a> UnwindSafe for ShapeRequest<'a>
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
Mutably borrows from an owned value. Read more