Sign in

    moonbit-community/harfbuzz/font does not have a README file

    FontError

    type FontError derive(Eq, Show, ToJson)

    Font

    pub struct Font {
    face :
    Face

    scale_x : Int
    scale_y : Int
    ppem_x : Int
    ppem_y : Int
    head :
    HeadTable
    ?
    maxp :
    MaxpTable
    ?
    hhea :
    HheaTable
    ?
    hmtx :
    HmtxTable
    ?
    vhea :
    VheaTable
    ?
    vmtx :
    VmtxTable
    ?
    cmap :
    CmapTable
    ?
    loca :
    LocaTable
    ?
    glyf :
    GlyfTable
    ?
    os2 :
    Os2Table
    ?
    name :
    NameTable
    ?
    post :
    PostTable
    ?
    gasp :
    GaspTable
    ?
    meta :
    MetaTable
    ?
    vorg :
    VorgTable
    ?
    hdmx :
    HdmxTable
    ?
    stat :
    StatTable
    ?
    base :
    BaseTable
    ?
    jstf :
    JstfTable
    ?
    math :
    MathTable
    ?
    kern :
    KernTable
    ?
    trak :
    TrakTable
    ?
    morx :
    MorxTable
    ?
    mort :
    MortTable
    ?
    kerx :
    KerxTable
    ?
    ankr :
    AnkrTable
    ?
    bsln :
    BslnTable
    ?
    feat :
    FeatTable
    ?
    just :
    JustTable
    ?
    ltag :
    LtagTable
    ?
    opbd :
    OpbdTable
    ?
    gsub :
    GsubTable
    ?
    gpos :
    GposTable
    ?
    gdef :
    GdefTable
    ?
    cpal :
    CpalTable
    ?
    colr :
    ColrTable
    ?
    hvar :
    HvarTable
    ?
    vvar :
    HvarTable
    ?
    mvar :
    MvarTable
    ?
    fvar :
    FvarTable
    ?
    avar :
    AvarTable
    ?
    cvt :
    CvtTable
    ?
    gvar :
    GvarTable
    ?
    cvar :
    CvarTable
    ?
    varc :
    VarcTable
    ?
    cff1 :
    Cff1Table
    ?
    cff2 :
    Cff2Table
    ?
    var_coords_design : Array[Double]?
    var_coords_norm : Array[Int]?
    } derive(Show, ToJson)

    Font ties a face to scale metrics.

    Font::cvt_values

    fn Font::cvt_values(self : Font) -> Result[Array[Int]?, FontError]

    Font::draw_glyph

    fn[T] Font::draw_glyph(self : Font, glyph : UInt, funcs :
    DrawFuncs
    [T], draw_data : T) -> Result[Unit, FontError]

    Convenience wrapper that ignores draw failures.

    Font::draw_glyph_or_fail

    fn[T] Font::draw_glyph_or_fail(self : Font, glyph : UInt, funcs :
    DrawFuncs
    [T], draw_data : T) -> Result[Bool, FontError]

    Draw glyph outline into draw callbacks. Returns false if unsupported.

    Font::from_bytes

    fn Font::from_bytes(bytes : Bytes) -> Font

    Create a font from raw bytes.

    Font::get_face

    Access the face.

    Font::get_ppem

    fn Font::get_ppem(self : Font) -> (Int, Int)

    Get ppem values.

    Font::get_scale

    fn Font::get_scale(self : Font) -> (Int, Int)

    Get scale values.

    Font::glyph_bounds

    fn Font::glyph_bounds(self : Font, glyph : UInt) -> Result[
    GlyphBounds
    ?, FontError]

    Return glyph bounds from glyf header (font units).

    Font::glyph_contour_point_for_origin

    fn Font::glyph_contour_point_for_origin(self : Font, glyph : UInt, point_index : Int) -> Result[(Int, Int)?, FontError]

    Return glyph contour point in font units if available.

    Font::glyph_for_codepoint

    fn Font::glyph_for_codepoint(self : Font, codepoint : UInt) -> Result[UInt?, FontError]

    Map a codepoint to a glyph id.

    Font::glyph_from_name

    fn Font::glyph_from_name(self : Font, name : String) -> Result[UInt?, FontError]

    Font::glyph_h_advance

    fn Font::glyph_h_advance(self : Font, glyph : UInt) -> Result[Int, FontError]

    Return glyph horizontal advance.

    Font::glyph_name

    fn Font::glyph_name(self : Font, glyph : UInt) -> Result[String?, FontError]

    Font::glyph_v_advance

    fn Font::glyph_v_advance(self : Font, glyph : UInt) -> Result[Int, FontError]

    Return glyph vertical advance.

    Font::mvar_delta

    fn Font::mvar_delta(self : Font, tag :
    Tag
    ) -> Result[Double, FontError]

    Font::new

    Create a font from a face.

    Font::set_ppem

    fn Font::set_ppem(self : Font, x : Int, y : Int) -> Unit

    Set ppem values.

    Font::set_scale

    fn Font::set_scale(self : Font, x : Int, y : Int) -> Unit

    Set scale values (in 26.6 fixed-point like HarfBuzz).

    Font::set_variations

    fn Font::set_variations(self : Font, variations : Array[
    AxisCoord
    ]) -> Result[Unit, FontError]

    Font::varc_components

    fn Font::varc_components(self : Font, glyph : UInt) -> Result[Array[
    VarcComponent
    ]?, FontError]

    Font::variation_coords

    fn Font::variation_coords(self : Font) -> Array[Int]

    Font::variation_glyph_for

    fn Font::variation_glyph_for(self : Font, codepoint : UInt, selector : UInt) -> Result[(Bool, UInt?), FontError]

    Map a codepoint + variation selector to a glyph id, if supported.

    PointDelta

    type PointDelta derive(Show, ToJson)

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io