README

Milky2018/moon_skrifa/core does not have a README file

#
NormalizedCoord

type NormalizedCoord = Int

Instance-related types.

Ported from fontations/skrifa (Apache-2.0 OR MIT).

#
StringId

type StringId = UInt16

OpenType name identifier (NameID).

This is a UInt16 in the OpenType spec.

#
VariationSetting

type VariationSetting = Setting[Double]

Definitions for specifying variations and typographic features.

Ported from fontations/skrifa/src/setting.rs (Apache-2.0 OR MIT).

#
ColorPainter

pub(open) trait ColorPainter {
fn push_transform(Self, Transform) -> Unit
fn pop_transform(Self) -> Unit
fn push_clip_glyph(Self, GlyphId) -> Unit
fn push_clip_box(Self, (Double, Double, Double, Double)) -> Unit
fn pop_clip(Self) -> Unit
fn fill(Self, Brush) -> Unit
fn fill_glyph(Self, GlyphId, Transform?, Brush) -> Unit
fn paint_cached_color_glyph(Self, GlyphId) -> Result[PaintCachedColorGlyph, PaintError]
fn push_layer(Self, CompositeMode) -> Unit
fn pop_layer(Self) -> Unit
fn pop_layer_with_mode(Self, CompositeMode) -> Unit
}

#
TableProvider

pub(open) trait TableProvider {
fn table(Self, Tag) -> BytesView?
}

Table provider abstraction.

Upstream skrifa is built on top of read-fonts which exposes a TableProvider trait returning raw table bytes by tag. In MoonBit we keep FontRef::table as the low-level primitive (UInt tag), and provide this trait adapter for Tag-based APIs.

#
Attributes

pub struct Attributes {
stretch : Stretch
style : Style
weight : Weight
}
fn Attributes::Attributes(font : FontRef) -> Attributes

Stretch, style and weight attributes of a font.

#
Attributes::stretch

fn Attributes::stretch(self : Attributes) -> Stretch

#
Attributes::style

fn Attributes::style(self : Attributes) -> Style

#
Attributes::weight

fn Attributes::weight(self : Attributes) -> Weight

#
Axis

pub struct Axis {
// private fields
}

#
Axis::default_value

fn Axis::default_value(self : Axis) -> Double

#
Axis::index

fn Axis::index(self : Axis) -> Int

#
Axis::is_hidden

fn Axis::is_hidden(self : Axis) -> Bool

#
Axis::max_value

fn Axis::max_value(self : Axis) -> Double

#
Axis::min_value

fn Axis::min_value(self : Axis) -> Double

#
Axis::name_id

fn Axis::name_id(self : Axis) -> UInt16

#
Axis::normalize

fn Axis::normalize(self : Axis, coord : Double) -> Int

#
Axis::tag

fn Axis::tag(self : Axis) -> Tag

#
AxisCollection

pub struct AxisCollection {
// private fields
}
fn AxisCollection::AxisCollection(font : FontRef) -> AxisCollection

#
AxisCollection::get

fn AxisCollection::get(self : AxisCollection, index : Int) -> Axis?

#
AxisCollection::get_by_tag

fn AxisCollection::get_by_tag(self : AxisCollection, tag : Tag) -> Axis?

#
AxisCollection::is_empty

fn AxisCollection::is_empty(self : AxisCollection) -> Bool

#
AxisCollection::len

fn AxisCollection::len(self : AxisCollection) -> Int

#
AxisCollection::location

fn AxisCollection::location(self : AxisCollection, settings : ArrayView[Setting[Double]]) -> Location

#
BitmapFormat

pub(all) enum BitmapFormat {
Sbix
Cbdt
Ebdt
}

#
BitmapGlyph

pub struct BitmapGlyph {
// private fields
}

#
BitmapGlyph::data

fn BitmapGlyph::data(self : BitmapGlyph) -> BytesView

#
BitmapGlyph::format

#
BitmapGlyph::height

fn BitmapGlyph::height(self : BitmapGlyph) -> Int?

#
BitmapGlyph::origin_x

fn BitmapGlyph::origin_x(self : BitmapGlyph) -> Int

#
BitmapGlyph::origin_y

fn BitmapGlyph::origin_y(self : BitmapGlyph) -> Int

#
BitmapGlyph::ppem_x

fn BitmapGlyph::ppem_x(self : BitmapGlyph) -> Int

#
BitmapGlyph::ppem_y

fn BitmapGlyph::ppem_y(self : BitmapGlyph) -> Int

#
BitmapGlyph::width

fn BitmapGlyph::width(self : BitmapGlyph) -> Int?

#
BitmapImageFormat

pub(all) enum BitmapImageFormat {
Png
Jpeg
Unknown(UInt)
}

#
BitmapStrike

pub struct BitmapStrike {
// private fields
}

#
BitmapStrike::format

fn BitmapStrike::format(self : BitmapStrike) -> BitmapFormat

#
BitmapStrike::get

fn BitmapStrike::get(self : BitmapStrike, gid : GlyphId) -> BitmapGlyph?

Returns the bitmap glyph for gid if present.

Currently supports sbix and a minimal subset of CBDT/CBLC and EBDT/EBLC.

#
BitmapStrike::ppem_x

fn BitmapStrike::ppem_x(self : BitmapStrike) -> Int

#
BitmapStrike::ppem_y

fn BitmapStrike::ppem_y(self : BitmapStrike) -> Int

#
BitmapStrikes

pub struct BitmapStrikes {
// private fields
}
fn BitmapStrikes::BitmapStrikes(font : FontRef) -> BitmapStrikes

#
BitmapStrikes::format

#
BitmapStrikes::get

fn BitmapStrikes::get(self : BitmapStrikes, index : Int) -> BitmapStrike?

#
BitmapStrikes::glyph_for_size

fn BitmapStrikes::glyph_for_size(self : BitmapStrikes, size : Size, glyph_id : GlyphId) -> BitmapGlyph?

#
BitmapStrikes::is_empty

fn BitmapStrikes::is_empty(self : BitmapStrikes) -> Bool

#
BitmapStrikes::iter

#
BitmapStrikes::len

fn BitmapStrikes::len(self : BitmapStrikes) -> Int

#
BitmapStrikes::with_format

fn BitmapStrikes::with_format(font : FontRef, format : BitmapFormat) -> BitmapStrikes?

#
Brush

pub(all) enum Brush {
Solid(Int, Double)
LinearGradient((Double, Double), (Double, Double), Array[ColorStop], Extend)
RadialGradient((Double, Double), Double, (Double, Double), Double, Array[ColorStop], Extend)
SweepGradient((Double, Double), Double, Double, Array[ColorStop], Extend)
}

#
Charmap

pub struct Charmap {
// private fields
}
fn Charmap::Charmap(font : FontRef) -> Charmap

#
Charmap::default

fn Charmap::default() -> Charmap

#
Charmap::glyph_id

fn Charmap::glyph_id(self : Charmap, codepoint : UInt) -> GlyphId?

#
Charmap::has_map

fn Charmap::has_map(self : Charmap) -> Bool

#
Charmap::has_variant_map

fn Charmap::has_variant_map(self : Charmap) -> Bool

#
Charmap::is_symbol

fn Charmap::is_symbol(self : Charmap) -> Bool

#
Charmap::map

fn Charmap::map(self : Charmap, codepoint : UInt) -> GlyphId?

#
Charmap::map_variant

fn Charmap::map_variant(self : Charmap, codepoint : UInt, selector : UInt) -> MapVariant?

#
Charmap::mappings

fn Charmap::mappings(self : Charmap) -> Array[(UInt, GlyphId)]

#
Charmap::variant_mappings

fn Charmap::variant_mappings(self : Charmap) -> Array[(UInt, UInt, MapVariant)]

#
Color

pub struct Color {
r : Byte
g : Byte
b : Byte
a : Byte
}

#
Color::a

fn Color::a(self : Color) -> Byte

#
Color::b

fn Color::b(self : Color) -> Byte

#
Color::g

fn Color::g(self : Color) -> Byte

#
Color::r

fn Color::r(self : Color) -> Byte

#
ColorGlyph

pub struct ColorGlyph {
// private fields
}

#
ColorGlyph::format

fn ColorGlyph::format(self : ColorGlyph) -> ColorGlyphFormat

#
ColorGlyph::layers

fn ColorGlyph::layers(self : ColorGlyph) -> Array[ColorLayer]?

#
ColorGlyph::paint

fn[P : ColorPainter] ColorGlyph::paint(self : ColorGlyph, location : LocationRef, painter : P) -> Result[Unit, PaintError]

#
ColorGlyphCollection

pub struct ColorGlyphCollection {
// private fields
}
fn ColorGlyphCollection::ColorGlyphCollection(font : FontRef) -> ColorGlyphCollection

#
ColorGlyphCollection::get

#
ColorGlyphCollection::get_with_format

fn ColorGlyphCollection::get_with_format(self : ColorGlyphCollection, glyph_id : GlyphId, glyph_format : ColorGlyphFormat) -> ColorGlyph?

#
ColorGlyphCollection::has_colr_v1

fn ColorGlyphCollection::has_colr_v1(self : ColorGlyphCollection) -> Bool

#
ColorGlyphCollection::layers

#
ColorGlyphCollection::version

fn ColorGlyphCollection::version(self : ColorGlyphCollection) -> Int

#
ColorGlyphFormat

pub(all) enum ColorGlyphFormat {
ColrV0
ColrV1
}

#
ColorLayer

pub struct ColorLayer {
glyph_id : GlyphId
palette_index : Int
}

#
ColorLayer::glyph_id

fn ColorLayer::glyph_id(self : ColorLayer) -> GlyphId

#
ColorLayer::palette_index

fn ColorLayer::palette_index(self : ColorLayer) -> Int

#
ColorPalette

pub struct ColorPalette {
// private fields
}

#
ColorPalette::color

fn ColorPalette::color(self : ColorPalette, entry : Int) -> Color?

#
ColorPalette::colors

fn ColorPalette::colors(self : ColorPalette) -> Array[Color]

#
ColorPalette::index

fn ColorPalette::index(self : ColorPalette) -> Int

#
ColorPalette::label

fn ColorPalette::label(self : ColorPalette) -> UInt16?

#
ColorPalette::palette_type

fn ColorPalette::palette_type(self : ColorPalette) -> ColorPaletteType?

#
ColorPaletteType

pub struct ColorPaletteType {
bits : UInt
}

#
ColorPaletteType::raw

fn ColorPaletteType::raw(self : ColorPaletteType) -> UInt

#
ColorPaletteType::usable_with_dark_background

fn ColorPaletteType::usable_with_dark_background(self : ColorPaletteType) -> Bool

#
ColorPaletteType::usable_with_light_background

fn ColorPaletteType::usable_with_light_background(self : ColorPaletteType) -> Bool

#
ColorPalettes

pub struct ColorPalettes {
// private fields
}
fn ColorPalettes::ColorPalettes(font : FontRef) -> ColorPalettes

#
ColorPalettes::color

fn ColorPalettes::color(self : ColorPalettes, palette : Int, entry : Int) -> Color?

#
ColorPalettes::color_label

fn ColorPalettes::color_label(self : ColorPalettes, color_index : Int) -> UInt16?

#
ColorPalettes::entries_per_palette

fn ColorPalettes::entries_per_palette(self : ColorPalettes) -> Int

#
ColorPalettes::get

fn ColorPalettes::get(self : ColorPalettes, index : Int) -> ColorPalette?

#
ColorPalettes::is_empty

fn ColorPalettes::is_empty(self : ColorPalettes) -> Bool

#
ColorPalettes::len

fn ColorPalettes::len(self : ColorPalettes) -> Int

#
ColorPalettes::version

fn ColorPalettes::version(self : ColorPalettes) -> Int

#
ColorStop

pub(all) struct ColorStop {
offset : Double
palette_index : Int
alpha : Double
}

#
CompositeMode

pub(all) enum CompositeMode {
Clear
Src
Dest
SrcOver
DestOver
SrcIn
DestIn
SrcOut
DestOut
SrcAtop
DestAtop
Xor
Plus
Screen
Overlay
Darken
Lighten
ColorDodge
ColorBurn
HardLight
SoftLight
Difference
Exclusion
Multiply
HslHue
HslSaturation
HslColor
HslLuminosity
Unknown
}

#
CompositeMode::raw

fn CompositeMode::raw(self : CompositeMode) -> Int

#
Decoration

pub struct Decoration {
offset : Double
thickness : Double
}

#
Decoration::offset

fn Decoration::offset(self : Decoration) -> Double

#
Decoration::thickness

fn Decoration::thickness(self : Decoration) -> Double

#
Extend

pub(all) enum Extend {
Pad
Repeat
Reflect
Unknown
}

#
Extend::raw

fn Extend::raw(self : Extend) -> Int

#
FontRef

pub struct FontRef {
data : Bytes
index : UInt
}

#
FontRef::attributes

fn FontRef::attributes(self : FontRef) -> Attributes

#
FontRef::axes

fn FontRef::axes(self : FontRef) -> AxisCollection

#
FontRef::bitmap_strikes

fn FontRef::bitmap_strikes(self : FontRef) -> BitmapStrikes

#
FontRef::charmap

fn FontRef::charmap(self : FontRef) -> Charmap

#
FontRef::color_glyphs

fn FontRef::color_glyphs(self : FontRef) -> ColorGlyphCollection

#
FontRef::color_palettes

fn FontRef::color_palettes(self : FontRef) -> ColorPalettes

#
FontRef::data

fn FontRef::data(self : FontRef) -> Bytes

#
FontRef::font_metrics

fn FontRef::font_metrics(self : FontRef, size : Size) -> Metrics

#
FontRef::font_metrics_at

fn FontRef::font_metrics_at(self : FontRef, size : Size, location : LocationRef) -> Metrics

#
FontRef::from_bytes

fn FontRef::from_bytes(data : Bytes) -> FontRef?

#
FontRef::from_index

fn FontRef::from_index(data : Bytes, index : UInt) -> FontRef?

#
FontRef::glyph_metrics

fn FontRef::glyph_metrics(self : FontRef, size : Size, location : LocationRef) -> GlyphMetrics

#
FontRef::glyph_names

fn FontRef::glyph_names(self : FontRef) -> GlyphNames

#
FontRef::hmtx_metrics

fn FontRef::hmtx_metrics(self : FontRef) -> HmtxMetrics?

#
FontRef::index

fn FontRef::index(self : FontRef) -> UInt

#
FontRef::localized_strings

fn FontRef::localized_strings(self : FontRef, id : UInt16) -> LocalizedStrings

#
FontRef::metrics

fn FontRef::metrics(self : FontRef, size : Size, location : LocationRef) -> Metrics

#
FontRef::named_instances

fn FontRef::named_instances(self : FontRef) -> NamedInstanceCollection

#
FontRef::paint_colr_v1

fn[P : ColorPainter] FontRef::paint_colr_v1(self : FontRef, glyph_id : GlyphId, painter : P) -> Result[Unit, PaintError]

#
FontRef::paint_colr_v1_at

fn[P : ColorPainter] FontRef::paint_colr_v1_at(self : FontRef, glyph_id : GlyphId, location : LocationRef, painter : P) -> Result[Unit, PaintError]

#
FontRef::table

fn FontRef::table(self : FontRef, tag : UInt) -> BytesView?

Returns the table data as a BytesView (slice into the original font bytes).

tag is a big-endian 4-byte OpenType table tag (e.g. 0x636D6170 for "cmap").

#
FontRef::table_tag

fn FontRef::table_tag(self : FontRef, tag : Tag) -> BytesView?

Tag-based table lookup adapter for parity with upstream TableProvider.

#
GlyphBounds

pub struct GlyphBounds {
// private fields
}

#
GlyphBounds::x_max

fn GlyphBounds::x_max(self : GlyphBounds) -> Double

#
GlyphBounds::x_min

fn GlyphBounds::x_min(self : GlyphBounds) -> Double

#
GlyphBounds::y_max

fn GlyphBounds::y_max(self : GlyphBounds) -> Double

#
GlyphBounds::y_min

fn GlyphBounds::y_min(self : GlyphBounds) -> Double

#
GlyphId

pub struct GlyphId {
// private fields
}
fn GlyphId::GlyphId(value : UInt16) -> GlyphId

Basic representation of an in-memory font resource.

Ported from fontations/skrifa/src/font.rs (Apache-2.0 OR MIT).
impl Compare for GlyphId
impl Eq for GlyphId
impl Show for GlyphId

#
GlyphId::default

fn GlyphId::default() -> GlyphId

#
GlyphId::notdef

fn GlyphId::notdef() -> GlyphId

#
GlyphId::to_int

fn GlyphId::to_int(self : GlyphId) -> Int

#
GlyphId::to_string

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

#
GlyphId::to_u16

fn GlyphId::to_u16(self : GlyphId) -> UInt16

#
GlyphId::to_uint64

fn GlyphId::to_uint64(self : GlyphId) -> UInt64

#
GlyphMetrics

pub struct GlyphMetrics {
// private fields
}
fn GlyphMetrics::GlyphMetrics(font : FontRef, size : Size, location : LocationRef) -> GlyphMetrics

Glyph specific metrics for a particular size and variation location.

Port of skrifa::metrics::GlyphMetrics, including:
  • base metrics from hmtx
  • variation deltas from HVAR
  • glyph-variation phantom-point deltas from gvar

#
GlyphMetrics::advance_width

fn GlyphMetrics::advance_width(self : GlyphMetrics, gid : GlyphId) -> Double?

#
GlyphMetrics::bounds

fn GlyphMetrics::bounds(self : GlyphMetrics, gid : GlyphId) -> GlyphBounds?

Returns scaled bounds for a glyf glyph (if present).

#
GlyphMetrics::glyph_count

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

#
GlyphMetrics::left_side_bearing

fn GlyphMetrics::left_side_bearing(self : GlyphMetrics, gid : GlyphId) -> Double?

#
GlyphName

pub struct GlyphName {
// private fields
}

#
GlyphName::as_str

fn GlyphName::as_str(self : GlyphName) -> String

#
GlyphName::is_synthesized

fn GlyphName::is_synthesized(self : GlyphName) -> Bool

#
GlyphNameSource

pub(all) enum GlyphNameSource {
Post
Cff
Synthesized
}

#
GlyphNames

pub struct GlyphNames {
// private fields
}
fn GlyphNames::GlyphNames(font : FontRef) -> GlyphNames

#
GlyphNames::get

fn GlyphNames::get(self : GlyphNames, glyph_id : GlyphId) -> GlyphName?

#
GlyphNames::num_glyphs

fn GlyphNames::num_glyphs(self : GlyphNames) -> Int

#
GlyphNames::source

fn GlyphNames::source(self : GlyphNames) -> GlyphNameSource

#
HmtxMetrics

pub struct HmtxMetrics {
// private fields
}

#
HmtxMetrics::advance_width

fn HmtxMetrics::advance_width(self : HmtxMetrics, gid : GlyphId) -> UInt?

Returns advance width for a glyph in font units.

#
HmtxMetrics::from_font

fn HmtxMetrics::from_font(font : FontRef) -> HmtxMetrics?

Parses required tables (maxp/hhea/hmtx) from the font.

#
HmtxMetrics::lsb

fn HmtxMetrics::lsb(self : HmtxMetrics, gid : GlyphId) -> Int?

Returns left side bearing for a glyph in font units.

#
HmtxMetrics::num_glyphs

fn HmtxMetrics::num_glyphs(self : HmtxMetrics) -> Int

#
HmtxMetrics::number_of_hmetrics

fn HmtxMetrics::number_of_hmetrics(self : HmtxMetrics) -> Int

#
LocalizedString

pub struct LocalizedString {
// private fields
}

#
LocalizedString::chars

fn LocalizedString::chars(self : LocalizedString) -> Array[Char]

#
LocalizedString::language

fn LocalizedString::language(self : LocalizedString) -> String?

#
LocalizedString::to_string

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

#
LocalizedStrings

pub struct LocalizedStrings {
// private fields
}
fn LocalizedStrings::LocalizedStrings(font : FontRef, id : UInt16) -> LocalizedStrings

#
LocalizedStrings::english_or_first

fn LocalizedStrings::english_or_first(self : LocalizedStrings) -> LocalizedString?

#
LocalizedStrings::id

fn LocalizedStrings::id(self : LocalizedStrings) -> UInt16

#
LocalizedStrings::strings

#
Location

pub struct Location {
// private fields
}
fn Location::Location(len : Int) -> Location

Owned ordered sequence of normalized variation coordinates.

#
Location::as_ref

fn Location::as_ref(self : Location) -> LocationRef

#
Location::coords

fn Location::coords(self : Location) -> ArrayView[Int]

#
Location::from_array

fn Location::from_array(coords : Array[Int]) -> Location

#
LocationRef

pub struct LocationRef {
// private fields
}
fn LocationRef::LocationRef(coords : ArrayView[Int]) -> LocationRef

Reference to an ordered sequence of normalized variation coordinates.

This is a minimal port of LocationRef from upstream.

#
LocationRef::coords

fn LocationRef::coords(self : LocationRef) -> ArrayView[Int]

#
LocationRef::default

fn LocationRef::default() -> LocationRef

#
LocationRef::effective_coords

fn LocationRef::effective_coords(self : LocationRef) -> ArrayView[Int]

Returns the underlying coordinate array if any entries are non-zero.

Otherwise returns an empty view (to bypass downstream variation logic).

#
LocationRef::is_default

fn LocationRef::is_default(self : LocationRef) -> Bool

#
MapVariant

pub(all) enum MapVariant {
UseDefault
Variant(GlyphId)
}

#
MappingIndex

pub struct MappingIndex {
// private fields
}
fn MappingIndex::MappingIndex(font : FontRef) -> MappingIndex

#
MappingIndex::charmap

fn MappingIndex::charmap(self : MappingIndex, font : FontRef) -> Charmap

#
MappingIndex::default

fn MappingIndex::default() -> MappingIndex

#
Metrics

pub struct Metrics {
units_per_em : UInt16
glyph_count : UInt16
is_monospace : Bool
italic_angle : Double
ascent : Double
descent : Double
leading : Double
cap_height : Double?
x_height : Double?
average_width : Double?
max_width : Double?
underline : Decoration?
strikeout : Decoration?
bounds : GlyphBounds?
}
fn Metrics::Metrics(font : FontRef, size : Size, _location : LocationRef) -> Metrics

#
Metrics::ascent

fn Metrics::ascent(self : Metrics) -> Double

#
Metrics::average_width

fn Metrics::average_width(self : Metrics) -> Double?

#
Metrics::bounds

fn Metrics::bounds(self : Metrics) -> GlyphBounds?

#
Metrics::cap_height

fn Metrics::cap_height(self : Metrics) -> Double?

#
Metrics::descent

fn Metrics::descent(self : Metrics) -> Double

#
Metrics::glyph_count

fn Metrics::glyph_count(self : Metrics) -> UInt16

#
Metrics::is_monospace

fn Metrics::is_monospace(self : Metrics) -> Bool

#
Metrics::italic_angle

fn Metrics::italic_angle(self : Metrics) -> Double

#
Metrics::leading

fn Metrics::leading(self : Metrics) -> Double

#
Metrics::max_width

fn Metrics::max_width(self : Metrics) -> Double?

#
Metrics::strikeout

fn Metrics::strikeout(self : Metrics) -> Decoration?

#
Metrics::underline

fn Metrics::underline(self : Metrics) -> Decoration?

#
Metrics::units_per_em

fn Metrics::units_per_em(self : Metrics) -> UInt16

#
Metrics::x_height

fn Metrics::x_height(self : Metrics) -> Double?

#
NamedInstance

pub struct NamedInstance {
// private fields
}

#
NamedInstance::location

fn NamedInstance::location(self : NamedInstance) -> Location

#
NamedInstance::postscript_name_id

fn NamedInstance::postscript_name_id(self : NamedInstance) -> UInt16?

#
NamedInstance::subfamily_name_id

fn NamedInstance::subfamily_name_id(self : NamedInstance) -> UInt16

#
NamedInstance::user_coords

fn NamedInstance::user_coords(self : NamedInstance) -> ArrayView[Double]

#
NamedInstanceCollection

pub struct NamedInstanceCollection {
// private fields
}
fn NamedInstanceCollection::NamedInstanceCollection(font : FontRef) -> NamedInstanceCollection

#
NamedInstanceCollection::get

#
NamedInstanceCollection::is_empty

#
NamedInstanceCollection::len

#
PaintCachedColorGlyph

pub(all) enum PaintCachedColorGlyph {
Ok
Unimplemented
}

#
PaintError

pub(all) enum PaintError {
ParseError
GlyphNotFound(GlyphId)
PaintCycleDetected
DepthLimitExceeded
UnsupportedPaintFormat(Int)
}

#
Setting

pub struct Setting[T] {
selector : Tag
value : T
}
fn Setting::Setting(selector : Tag, value : T) -> Setting[T]

Definitions for specifying variations and typographic features.

Ported from fontations/skrifa/src/setting.rs (Apache-2.0 OR MIT).

#
Setting::from_str

fn[T] Setting::from_str(selector : String, value : T) -> Setting[T]

#
Setting::from_str_tuple

fn[T] Setting::from_str_tuple(pair : (String, T)) -> Setting[T]

#
Setting::from_tuple

fn[T] Setting::from_tuple(pair : (Tag, T)) -> Setting[T]

#
Size

pub struct Size {
ppem : Double?
}
fn Size::Size(size : Double) -> Size

#
Size::fixed_linear_scale

fn Size::fixed_linear_scale(self : Size, units_per_em : UInt16) -> Int

Computes a 16.16 fixed-point linear scale factor that matches FreeType.

This is intended for internal routines that apply the FreeType-style mul_div(value, scale, 64) pattern.

#
Size::linear_scale

fn Size::linear_scale(self : Size, units_per_em : UInt16) -> Double

Computes a linear scale factor for this font size and the given units-per-em.

Returns 1.0 for an unscaled size or when units_per_em is 0.

#
Size::ppem

fn Size::ppem(self : Size) -> Double?

#
Size::unscaled

fn Size::unscaled() -> Size

#
Size::value

fn Size::value(self : Size) -> Double

Legacy helper for the earlier API.

#
Stretch

pub struct Stretch {
// private fields
}
fn Stretch::Stretch(ratio : Double) -> Stretch

#
Stretch::condensed

fn Stretch::condensed() -> Stretch

#
Stretch::default

fn Stretch::default() -> Stretch

#
Stretch::expanded

fn Stretch::expanded() -> Stretch

#
Stretch::extra_condensed

fn Stretch::extra_condensed() -> Stretch

#
Stretch::extra_expanded

fn Stretch::extra_expanded() -> Stretch

#
Stretch::normal

fn Stretch::normal() -> Stretch

#
Stretch::percentage

fn Stretch::percentage(self : Stretch) -> Double

#
Stretch::ratio

fn Stretch::ratio(self : Stretch) -> Double

#
Stretch::semi_condensed

fn Stretch::semi_condensed() -> Stretch

#
Stretch::semi_expanded

fn Stretch::semi_expanded() -> Stretch

#
Stretch::ultra_condensed

fn Stretch::ultra_condensed() -> Stretch

#
Stretch::ultra_expanded

fn Stretch::ultra_expanded() -> Stretch

#
Style

pub(all) enum Style {
Normal
Italic
Oblique(Double?)
}

#
Tag

pub struct Tag {
// private fields
}
fn Tag::Tag(bytes : Bytes) -> Tag

OpenType tag (four ASCII bytes).

Ported from read-fonts::types::Tag usage in fontations/skrifa.

#
Tag::default

fn Tag::default() -> Tag

#
Tag::from_str

fn Tag::from_str(s : String) -> Tag?

#
Tag::from_str_or_default

fn Tag::from_str_or_default(s : String) -> Tag

#
Tag::from_u8s

fn Tag::from_u8s(b0 : Int, b1 : Int, b2 : Int, b3 : Int) -> Tag?

#
Tag::from_uint

fn Tag::from_uint(value : UInt) -> Tag

#
Tag::to_string

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

#
Tag::to_uint

fn Tag::to_uint(self : Tag) -> UInt

#
Transform

pub(all) struct Transform {
xx : Double
yx : Double
xy : Double
yy : Double
dx : Double
dy : Double
}

Affine transformation matrix used for COLRv1 drawing.

Ported from fontations/skrifa/src/color/transform.rs (Apache-2.0 OR MIT).

#
Transform::apply

fn Transform::apply(self : Transform, x : Double, y : Double) -> (Double, Double)

#
Transform::default

fn Transform::default() -> Transform

#
Transform::mul

fn Transform::mul(self : Transform, rhs : Transform) -> Transform

#
Weight

pub struct Weight {
// private fields
}
fn Weight::Weight(value : Double) -> Weight

#
Weight::black

fn Weight::black() -> Weight

#
Weight::bold

fn Weight::bold() -> Weight

#
Weight::default

fn Weight::default() -> Weight

#
Weight::extra_black

fn Weight::extra_black() -> Weight

#
Weight::extra_bold

fn Weight::extra_bold() -> Weight

#
Weight::extra_light

fn Weight::extra_light() -> Weight

#
Weight::light

fn Weight::light() -> Weight

#
Weight::medium

fn Weight::medium() -> Weight

#
Weight::normal

fn Weight::normal() -> Weight

#
Weight::semi_bold

fn Weight::semi_bold() -> Weight

#
Weight::semi_light

fn Weight::semi_light() -> Weight

#
Weight::thin

fn Weight::thin() -> Weight

#
Weight::value

fn Weight::value(self : Weight) -> Double

#
STRING_ID_COMPATIBLE_FULL_NAME

let STRING_ID_COMPATIBLE_FULL_NAME : UInt16

Compatible full name (Macintosh only).
let STRING_ID_COPYRIGHT_NOTICE : UInt16

Copyright notice.

#
STRING_ID_DARK_BACKGROUND_PALETTE

let STRING_ID_DARK_BACKGROUND_PALETTE : UInt16

Dark background palette label.

#
STRING_ID_DESCRIPTION

let STRING_ID_DESCRIPTION : UInt16

Description.

#
STRING_ID_DESIGNER

let STRING_ID_DESIGNER : UInt16

Designer name.

#
STRING_ID_DESIGNER_URL

let STRING_ID_DESIGNER_URL : UInt16

Designer URL.

#
STRING_ID_FAMILY_NAME

let STRING_ID_FAMILY_NAME : UInt16

#
STRING_ID_FULL_NAME

let STRING_ID_FULL_NAME : UInt16

Full font name.

#
STRING_ID_LAST_ALLOWED_NAME_ID

let STRING_ID_LAST_ALLOWED_NAME_ID : UInt16

The last value that is available for font-specific names.

#
STRING_ID_LAST_RESERVED_NAME_ID

let STRING_ID_LAST_RESERVED_NAME_ID : UInt16

The last value that is explicitly reserved for standard names.

#
STRING_ID_LICENSE_DESCRIPTION

let STRING_ID_LICENSE_DESCRIPTION : UInt16

License description.

#
STRING_ID_LICENSE_URL

let STRING_ID_LICENSE_URL : UInt16

License URL.

#
STRING_ID_LIGHT_BACKGROUND_PALETTE

let STRING_ID_LIGHT_BACKGROUND_PALETTE : UInt16

Light background palette label.

#
STRING_ID_MANUFACTURER

let STRING_ID_MANUFACTURER : UInt16

Manufacturer name.

#
STRING_ID_POSTSCRIPT_CID_NAME

let STRING_ID_POSTSCRIPT_CID_NAME : UInt16

PostScript CID findfont name.

#
STRING_ID_POSTSCRIPT_NAME

let STRING_ID_POSTSCRIPT_NAME : UInt16

PostScript name.

#
STRING_ID_SAMPLE_TEXT

let STRING_ID_SAMPLE_TEXT : UInt16

Sample text.

#
STRING_ID_SUBFAMILY_NAME

let STRING_ID_SUBFAMILY_NAME : UInt16

#
STRING_ID_TRADEMARK

let STRING_ID_TRADEMARK : UInt16

Trademark.

#
STRING_ID_TYPOGRAPHIC_FAMILY_NAME

let STRING_ID_TYPOGRAPHIC_FAMILY_NAME : UInt16

Typographic family name.

#
STRING_ID_TYPOGRAPHIC_SUBFAMILY_NAME

let STRING_ID_TYPOGRAPHIC_SUBFAMILY_NAME : UInt16

Typographic subfamily name.

#
STRING_ID_UNIQUE_ID

let STRING_ID_UNIQUE_ID : UInt16

Unique font identifier.

#
STRING_ID_VARIATIONS_POSTSCRIPT_NAME_PREFIX

let STRING_ID_VARIATIONS_POSTSCRIPT_NAME_PREFIX : UInt16

Variations PostScript name prefix.

#
STRING_ID_VENDOR_URL

let STRING_ID_VENDOR_URL : UInt16

Vendor URL.

#
STRING_ID_VERSION_STRING

let STRING_ID_VERSION_STRING : UInt16

Version string.

#
STRING_ID_WWS_FAMILY_NAME

let STRING_ID_WWS_FAMILY_NAME : UInt16

WWS family name.

#
STRING_ID_WWS_SUBFAMILY_NAME

let STRING_ID_WWS_SUBFAMILY_NAME : UInt16

WWS subfamily name.

#
string_id_checked_add

fn string_id_checked_add(id : UInt16, rhs : UInt16) -> UInt16?

#
string_id_is_reserved

fn string_id_is_reserved(id : UInt16) -> Bool

#
string_id_predefined

fn string_id_predefined() -> Array[UInt16]

Returns the set of predefined name identifiers according to the OpenType spec.

This matches fontations/font-types::NameId::predefined(): IDs 0..15 and 16..=25 (note: ID 15 is not assigned).