Milky2018/moon_skrifa/outline does not have a README file

    OutlinePen

    pub(open) trait OutlinePen {
    fn move_to(Self, Double, Double) -> Unit
    fn line_to(Self, Double, Double) -> Unit
    fn quad_to(Self, Double, Double, Double, Double) -> Unit
    fn curve_to(Self, Double, Double, Double, Double, Double, Double) -> Unit
    fn close(Self) -> Unit
    }

    Interface for accepting a sequence of path commands.

    DrawError

    pub(all) suberror DrawError {
    NoSources
    GlyphNotFound(
    GlyphId
    )
    InsufficientMemory
    RecursionLimitExceeded(
    GlyphId
    )
    TooManyPoints(
    GlyphId
    )
    HintingFailed(HintError)
    InvalidAnchorPoint(
    GlyphId
    , UInt16)
    PostScript
    ToPath(ToPathError)
    Read
    HarfBuzzHintingUnsupported
    }

    Errors that may occur when drawing glyphs.

    HintError

    pub(all) suberror HintError {
    Unsupported
    UnexpectedEndOfBytecode
    UnhandledOpcode(Int, Int)
    DefinitionInGlyphProgram
    NestedDefinition
    DefinitionTooLarge
    TooManyDefinitions
    InvalidDefinition(Int)
    ValueStackOverflow
    ValueStackUnderflow
    CallStackOverflow
    CallStackUnderflow
    InvalidStackValue(Int)
    InvalidPointIndex(Int)
    InvalidPointRange(Int, Int)
    InvalidContourIndex(Int)
    InvalidCvtIndex(Int)
    InvalidStorageIndex(Int)
    DivideByZero
    InvalidZoneIndex(Int)
    NegativeLoopCounter
    InvalidJump
    ExceededExecutionBudget
    }

    ToPathError

    pub(all) suberror ToPathError {
    Unsupported
    }

    Errors that can occur when converting an outline to a path.

    AdjustedMetrics

    pub struct AdjustedMetrics {
    has_overlaps : Bool
    lsb : Double?
    advance_width : Double?
    }

    Information and adjusted metrics generated while drawing an outline glyph.

    AdjustedMetrics::default

    DrawSettings

    pub struct DrawSettings {
    // private fields
    }

    Options that define how a glyph outline is drawn to a pen.

    DrawSettings::default

    fn DrawSettings::default() -> DrawSettings

    DrawSettings::hinted

    fn DrawSettings::hinted(instance : HintingInstance, is_pedantic : Bool) -> DrawSettings

    DrawSettings::hinting_instance

    fn DrawSettings::hinting_instance(self : DrawSettings) -> HintingInstance?

    DrawSettings::is_pedantic

    fn DrawSettings::is_pedantic(self : DrawSettings) -> Bool

    DrawSettings::path_style

    fn DrawSettings::path_style(self : DrawSettings) -> PathStyle

    DrawSettings::with_memory

    fn DrawSettings::with_memory(self : DrawSettings, memory : Array[Byte]?) -> DrawSettings

    DrawSettings::with_path_style

    fn DrawSettings::with_path_style(self : DrawSettings, path_style : PathStyle) -> DrawSettings

    Engine

    pub(all) enum Engine {
    Interpreter
    Auto(GlyphStyles?)
    AutoFallback
    }

    Engine::into

    fn Engine::into(self : Engine) -> HintingOptions

    Converts an engine selection into HintingOptions with default target.

    Engine::resolve_auto_fallback

    fn Engine::resolve_auto_fallback(self : Engine, outlines : OutlineGlyphCollection) -> Engine

    Resolves AutoFallback based on outline collection preference.

    GlyphStyles

    pub struct GlyphStyles {
    // private fields
    }

    GlyphStyles::GlyphStyles

    fn GlyphStyles::GlyphStyles(outlines : OutlineGlyphCollection) -> GlyphStyles

    Precomputes the glyph style map for a font.

    This is invariant per font and can be reused when creating multiple HintingInstances with Engine::Auto(...).

    GlyphStyles::is_digit

    GlyphStyles::style_index

    Hinting

    pub(all) enum Hinting {
    None_
    Embedded
    }

    Specifies the hinting strategy for memory size calculations.

    Hinting::default

    fn Hinting::default() -> Hinting

    Hinting::none

    fn Hinting::none() -> Hinting

    HintingInstance

    pub struct HintingInstance {
    // private fields
    }

    Hinting instance that uses information embedded in the font to perform grid-fitting.

    This follows the same high-level behavior as upstream:
    • The backend engine is selected at configuration time (Interpreter/Auto).
    • For TrueType outlines, fpgm + prep are executed during configuration.

    HintingInstance::is_enabled

    fn HintingInstance::is_enabled(self : HintingInstance) -> Bool

    HintingInstance::reconfigure

    HintingInstance::target

    fn HintingInstance::target(self : HintingInstance) -> Target

    HintingMode

    pub(all) enum HintingMode {
    Strong
    Smooth(LcdLayout?, Bool)
    }

    Modes that control hinting when using embedded instructions.

    This mirrors the legacy FreeType hinting mode selector and is intentionally undocumented upstream.

    HintingMode::into

    HintingOptions

    pub struct HintingOptions {
    engine : Engine
    target : Target
    }

    HintingOptions::HintingOptions

    fn HintingOptions::HintingOptions(engine : Engine, target : Target) -> HintingOptions

    Creates hinting options with explicit engine + target.

    HintingOptions::default

    LcdLayout

    pub(all) enum LcdLayout {
    Horizontal
    Vertical
    }

    Specifies direction of pixel layout for LCD-based subpixel hinting.

    NullPen

    pub struct NullPen {
    // private fields
    }

    Pen that drops all drawing output.

    NullPen::NullPen

    fn NullPen::NullPen() -> NullPen

    NullPen::close

    fn NullPen::close(_ : NullPen) -> Unit

    NullPen::curve_to

    fn NullPen::curve_to(_ : NullPen, _ : Double, _ : Double, _ : Double, _ : Double, _ : Double, _ : Double) -> Unit

    NullPen::line_to

    fn NullPen::line_to(_ : NullPen, _ : Double, _ : Double) -> Unit

    NullPen::move_to

    fn NullPen::move_to(_ : NullPen, _ : Double, _ : Double) -> Unit

    NullPen::quad_to

    fn NullPen::quad_to(_ : NullPen, _ : Double, _ : Double, _ : Double, _ : Double) -> Unit

    OutlineGlyph

    pub struct OutlineGlyph {
    // private fields
    }

    A scalable glyph outline.

    This can be sourced from the glyf, CFF or CFF2 tables.

    OutlineGlyph::draw

    fn[P : OutlinePen] OutlineGlyph::draw(self : OutlineGlyph, settings : DrawSettings, pen : P) -> Result[AdjustedMetrics, DrawError]

    Draws the outline glyph with the given settings and emits the resulting path commands to the specified pen.

    OutlineGlyph::draw_memory_size

    fn OutlineGlyph::draw_memory_size(self : OutlineGlyph, hinting : Hinting) -> Int

    Returns the size (in bytes) of the temporary memory required to draw this outline.

    OutlineGlyph::format

    OutlineGlyph::glyph_id

    OutlineGlyph::has_hinting

    fn OutlineGlyph::has_hinting(self : OutlineGlyph) -> Bool?

    Returns a value indicating whether the outline has hinting instructions.

    For CFF outlines, returns None since this is unknown prior to loading the outline.

    OutlineGlyph::has_overlaps

    fn OutlineGlyph::has_overlaps(self : OutlineGlyph) -> Bool?

    Returns a value indicating if the outline may contain overlapping contours or components.

    For CFF outlines, returns None since this information is unavailable.

    OutlineGlyph::path

    fn OutlineGlyph::path(self : OutlineGlyph, settings : DrawSettings) -> Result[Array[PathElement], DrawError]

    Draws the outline glyph and returns a flat list of path elements.

    OutlineGlyphCollection

    pub struct OutlineGlyphCollection {
    // private fields
    }

    OutlineGlyphCollection::OutlineGlyphCollection

    OutlineGlyphCollection::draw

    Draws the outline of a glyph into a pen.

    OutlineGlyphCollection::draw_unscaled

    Convenience wrapper for the previous unscaled API.

    OutlineGlyphCollection::format

    OutlineGlyphCollection::fractional_size_hinting

    fn OutlineGlyphCollection::fractional_size_hinting(self : OutlineGlyphCollection) -> Bool

    Returns true when the font supports hinting at fractional sizes.

    OutlineGlyphCollection::get

    Returns the outline for the given glyph identifier.

    OutlineGlyphCollection::glyph_count

    fn OutlineGlyphCollection::glyph_count(self : OutlineGlyphCollection) -> Int

    Returns the number of glyphs addressable by this outline source.

    OutlineGlyphCollection::iter

    Returns an iterator-like list of all outline glyphs in the collection.

    OutlineGlyphCollection::path

    Draws the outline of a glyph and returns a flat list of path elements.

    OutlineGlyphCollection::path_unscaled

    Convenience wrapper for the previous unscaled API.

    OutlineGlyphCollection::prefer_interpreter

    fn OutlineGlyphCollection::prefer_interpreter(self : OutlineGlyphCollection) -> Bool

    Returns true if the embedded instruction interpreter is preferred.

    This matches the high-level selection logic used by upstream:
    • CFF/CFF2 prefers the (PostScript) interpreter
    • glyf follows FreeType-style preference rules based on max instructions and the presence of fpgm/prep

    OutlineGlyphCollection::require_interpreter

    fn OutlineGlyphCollection::require_interpreter(self : OutlineGlyphCollection) -> Bool

    Returns true when the interpreter engine must be used for hinting this set of outlines to produce correct results.

    OutlineGlyphCollection::svg_path

    Draws the outline of a glyph into an SVG path string.

    OutlineGlyphCollection::svg_path_unscaled

    OutlineGlyphCollection::with_format

    Creates a new outline collection for the given font and outline format.

    Returns None if the font does not contain outlines in the requested format.

    OutlineGlyphFormat

    pub(all) enum OutlineGlyphFormat {
    Glyf
    Cff
    Cff2
    }

    Source format for an outline glyph.

    PathElement

    pub(all) enum PathElement {
    MoveTo(Double, Double)
    LineTo(Double, Double)
    QuadTo(Double, Double, Double, Double)
    CurveTo(Double, Double, Double, Double, Double, Double)
    Close
    }

    Single path command emitted when drawing a glyph outline.

    Coordinate units are raw font units (design units).

    PathStyle

    pub(all) enum PathStyle {
    FreeType
    HarfBuzz
    }

    Style for converting glyf point streams to path commands.

    Some glyph point streams are ambiguous when the first point is off-curve; major implementations differ. This lets callers choose which behavior to match.

    PathStyle::default

    fn PathStyle::default() -> PathStyle

    SmoothMode

    pub(all) enum SmoothMode {
    Normal
    Light
    Lcd
    VerticalLcd
    }

    SmoothMode::into

    fn SmoothMode::into(self : SmoothMode) -> Target

    SvgPen

    pub struct SvgPen {
    // private fields
    }

    Pen that generates SVG style path data.

    SvgPen::SvgPen

    fn SvgPen::SvgPen() -> SvgPen

    SvgPen::clear

    fn SvgPen::clear(self : SvgPen) -> Unit

    SvgPen::close

    fn SvgPen::close(pen : SvgPen) -> Unit

    SvgPen::curve_to

    fn SvgPen::curve_to(pen : SvgPen, cx0 : Double, cy0 : Double, cx1 : Double, cy1 : Double, x : Double, y : Double) -> Unit

    SvgPen::line_to

    fn SvgPen::line_to(pen : SvgPen, x : Double, y : Double) -> Unit

    SvgPen::move_to

    fn SvgPen::move_to(pen : SvgPen, x : Double, y : Double) -> Unit

    SvgPen::quad_to

    fn SvgPen::quad_to(pen : SvgPen, cx0 : Double, cy0 : Double, x : Double, y : Double) -> Unit

    SvgPen::to_string

    fn SvgPen::to_string(self : SvgPen) -> String

    SvgPen::with_precision

    fn SvgPen::with_precision(precision : Int) -> SvgPen

    Creates a new SVG pen that formats floating point values with the given precision (the number of digits printed after the decimal point).

    Target

    pub(all) enum Target {
    Mono
    Smooth(SmoothMode, Bool, Bool)
    }

    Target::default

    fn Target::default() -> Target

    Target::is_grayscale_cleartype

    fn Target::is_grayscale_cleartype(self : Target) -> Bool

    Target::is_lcd

    fn Target::is_lcd(self : Target) -> Bool

    Target::is_light

    fn Target::is_light(self : Target) -> Bool

    Target::is_smooth

    fn Target::is_smooth(self : Target) -> Bool

    Target::is_vertical_lcd

    fn Target::is_vertical_lcd(self : Target) -> Bool

    Target::mode

    fn Target::mode(self : Target) -> SmoothMode?

    Target::preserve_linear_metrics

    fn Target::preserve_linear_metrics(self : Target) -> Bool

    Target::symmetric_rendering

    fn Target::symmetric_rendering(self : Target) -> Bool

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io