Expand description
oxitext-shape — Swash-based text shaper for OxiText.
Provides SwashShaper, which wraps swash’s ShapeContext and produces
ShapedRuns from UTF-8 text + raw font bytes.
M1: LTR Latin shaping. Bidi (M2) and script-specific itemisation (M3) are deferred.
§M3 additions
backend: Swappablebackend::ShapeBackendtrait, with the defaultbackend::SwashShaperBackendwrapper and optional [backend::RustybuzzShaper] (featurerustybuzz-backend).
§M5 additions (Slice 5a)
cache: Bounded LRU shape cache (cache::ShapeCache,cache::ShapeKey) backed bylru::LruCache.SwashShaper::with_cache: creates aSwashShaperwith an attachedShapeCache; subsequentshape()calls check the cache before invoking swash.
§Feature-aware shaping (Slice 6)
ShapeFeature: an OpenType feature tag-value pair.ShapeDirection: direction enum (Ltr/Rtl/Ttb/Btt).ShapeRequest/ShapeRequestBuilder: builder pattern for a full shaping request including text, font, size, direction, script, language, and a list ofShapeFeatures.SwashShaper::shape_request: shapes a completeShapeRequest, with automaticvert/vrt2feature injection for top-to-bottom text.SwashShaper::shape_with_features: lower-level entry point that accepts a feature slice directly.
Re-exports§
pub use backend::ShapeBackend;pub use backend::SwashShaperBackend;pub use cache::FontId;pub use cache::ShapeCache;pub use cache::ShapeKey;pub use script_detect::requires_arabic_shaping;pub use script_detect::requires_indic_shaping;pub use script_detect::requires_mark_positioning;
Modules§
- backend
- Swappable text shaping backends.
- batch
- Batch shaping: shape multiple text segments in a single call.
- cache
- Bounded LRU shape cache for
crate::SwashShaper. - script_
detect - Script detection helpers for oxitext-shape.
- variational
- Variable font support and vertical shaping tests.
Structs§
- Shape
Feature - An OpenType feature tag-value pair.
- Shape
Request - A complete shaping request with all parameters.
- Shape
Request Builder - Builder for
ShapeRequest. - Shape
Result - Extended shaping result with metadata.
- Swash
Shaper - Text shaper backed by swash.
Enums§
- Shape
Direction - Text direction for a shaping request.
- Shape
Request Error - Errors that can occur when building a
ShapeRequest.
Functions§
- detect_
emoji_ zwj_ sequences - Returns byte ranges in
textthat correspond to ZWJ-joined emoji sequences. - find_
kashida_ opportunities - Returns glyph indices (into
glyphs) after which a kashida stretch can be inserted for Arabic justification.