Skip to main content

skrifa/outline/
pen.rs

1//! Types for collecting the output when drawing a glyph outline.
2
3pub use read_fonts::model::pen::{ControlBoundsPen, NullPen, OutlinePen, PathElement, SvgPen};
4
5/// Style for path conversion.
6///
7/// The order to process points in a glyf point stream is ambiguous when the
8/// first point is off-curve. Major implementations differ. Which one would
9/// you like to match?
10///
11/// **If you add a new one make sure to update the fuzzer.**
12#[derive(Debug, Default, Copy, Clone)]
13pub enum PathStyle {
14    /// If the first point is off-curve, check if the last is on-curve
15    /// If it is, start there. If it isn't, start at the implied midpoint
16    /// between first and last.
17    #[default]
18    FreeType,
19    /// If the first point is off-curve, check if the second is on-curve.
20    /// If it is, start there. If it isn't, start at the implied midpoint
21    /// between first and second.
22    ///
23    /// Matches hb-draw's interpretation of a point stream.
24    HarfBuzz,
25}