pub type GlyphVariationData<'a> = TupleVariationData<'a, GlyphDelta>;Expand description
Variation data specialized for the glyph variations table.
Aliased Type§
pub struct GlyphVariationData<'a> {
pub(crate) axis_count: u16,
pub(crate) shared_tuples: Option<ComputedArray<'a, Tuple<'a>>>,
pub(crate) shared_point_numbers: Option<PackedPointNumbers<'a>>,
pub(crate) tuple_count: TupleVariationCount,
pub(crate) header_data: FontData<'a>,
pub(crate) serialized_data: FontData<'a>,
pub(crate) _marker: PhantomData<fn() -> GlyphDelta>,
}Fields§
§axis_count: u16§tuple_count: TupleVariationCount§header_data: FontData<'a>§serialized_data: FontData<'a>§_marker: PhantomData<fn() -> GlyphDelta>Implementations§
Source§impl GlyphVariationData<'_>
impl GlyphVariationData<'_>
Sourcepub fn simple_deltas<C, D>(
&self,
coords: &[F2Dot14],
points: &[Point<C>],
flags: &mut [PointFlags],
contours: &[u16],
buffers: &mut DeltaBuffers<'_, D>,
) -> Result<(), ReadError>
pub fn simple_deltas<C, D>( &self, coords: &[F2Dot14], points: &[Point<C>], flags: &mut [PointFlags], contours: &[u16], buffers: &mut DeltaBuffers<'_, D>, ) -> Result<(), ReadError>
Computes the deltas for the points of a simple glyph at the given location in variation space.
Deltas for points that a sparse tuple does not reference are inferred by interpolation, so this needs the glyph’s points and contour end points in addition to the buffers it writes.
pointsandcontoursdescribe the unvaried glyph.pointsmust include the four phantom points.flagsis used as scratch: thePointMarker::HAS_DELTAmarker is cleared and set as tuples are processed.bufferssupplies the output and interpolation storage.
flags and both buffers must be at least as long as points, which
is what everything here is indexed by.
The deltas are zeroed before anything else happens, so they never retain values from a previous call.
See Gvar::simple_deltas to look a glyph’s data up first.
Sourcepub fn composite_deltas<D: PointCoord>(
&self,
coords: &[F2Dot14],
deltas: &mut [Point<D>],
) -> Result<(), ReadError>
pub fn composite_deltas<D: PointCoord>( &self, coords: &[F2Dot14], deltas: &mut [Point<D>], ) -> Result<(), ReadError>
Computes the deltas for the component offsets of a composite glyph at the given location in variation space.
Interpolation is meaningless for component offsets, so this skips the
expensive part of Self::simple_deltas and needs no scratch.
deltas must have one entry per component plus four for the phantom
points, and is zeroed first.
See Gvar::composite_deltas to look a glyph’s data up first.
Sourcefn accumulate_deltas<D: PointCoord>(
&self,
coords: &[F2Dot14],
deltas: &mut [Point<D>],
apply_sparse_tuple: impl FnMut(Fixed, TupleVariation<'_, GlyphDelta>, &mut [Point<D>]) -> Result<(), ReadError>,
) -> Result<(), ReadError>
fn accumulate_deltas<D: PointCoord>( &self, coords: &[F2Dot14], deltas: &mut [Point<D>], apply_sparse_tuple: impl FnMut(Fixed, TupleVariation<'_, GlyphDelta>, &mut [Point<D>]) -> Result<(), ReadError>, ) -> Result<(), ReadError>
The parts shared by simple and composite glyph processing.
Zeroes deltas, then accumulates every tuple that is active at
coords. Dense tuples are handled here; sparse tuples are passed to
apply_sparse_tuple, which differs between the two glyph kinds.