README

moonbit-community/harfbuzz/ot/color does not have a README file

#
PaintVisitor

type PaintVisitor = (
Paint
, Int) -> Bool

Visitor callback for COLRv1 paint traversal.

#
ColorError

pub suberror ColorError {
UnexpectedEof
InvalidFormat
Var(
VarError
)
} derive(Eq, Show, ToJson)

#
BaseGlyphPaintRecord

pub struct BaseGlyphPaintRecord {
glyph_id : Int
paint_offset : Int
} derive(Eq, Show, ToJson)

COLRv1 base glyph -> paint record.

#
ClipBox

pub struct ClipBox {
format : Int
x_min : Int
y_min : Int
x_max : Int
y_max : Int
var_idx_base : UInt?
} derive(Eq, Show, ToJson)

Clip box data (format 1 or 2).

#
ClipExtents

pub struct ClipExtents {
x_bearing : Int
y_bearing : Int
width : Int
height : Int
} derive(Eq, Show, ToJson)

Clip extents for a glyph (y-bearing is y_max).

#
ClipList

pub struct ClipList {
format : Int
records : Array[ClipRecord]
} derive(Eq, Show, ToJson)

Clip list (format 1) for COLRv1.

#
ClipRecord

pub struct ClipRecord {
start_glyph_id : Int
end_glyph_id : Int
clip_box : ClipBox
} derive(Eq, Show, ToJson)

Clip record for a glyph range.

#
ColrBaseGlyph

pub struct ColrBaseGlyph {
glyph_id : Int
first_layer_index : Int
num_layers : Int
} derive(Eq, Show, ToJson)

COLRv0 base glyph record.

#
ColrLayer

pub struct ColrLayer {
glyph_id : Int
color_index : Int
} derive(Eq, Show, ToJson)

COLRv0 layer record.

#
ColrTable

pub struct ColrTable {
version : Int
base_glyphs : Array[ColrBaseGlyph]
layers : Array[ColrLayer]
base_glyph_paints : Array[BaseGlyphPaintRecord]
layer_paint_offsets : Array[Int]
clip_list : ClipList?
var_idx_map :
DeltaSetIndexMap
?
var_store :
ItemVariationStore
?
data : BytesView
} derive(Show, ToJson)

COLR table (v0/v1) parsed data.

#
ColrTable::clip_box_for_glyph

fn ColrTable::clip_box_for_glyph(self : ColrTable, glyph_id : Int) -> ClipBox?

Get COLRv1 clip box for a glyph, if present.

#
ColrTable::clip_extents_for_glyph

fn ColrTable::clip_extents_for_glyph(self : ColrTable, glyph_id : Int, coords? : Array[Int]) -> ClipExtents?

Get COLRv1 clip extents for a glyph, applying variation if available.

#
ColrTable::glyph_layers

fn ColrTable::glyph_layers(self : ColrTable, glyph_id : Int) -> Array[ColrLayer]?

Get COLRv0 layers for a glyph.

#
ColrTable::has_v0

fn ColrTable::has_v0(self : ColrTable) -> Bool

True if COLRv0 data exists.

#
ColrTable::has_v1

fn ColrTable::has_v1(self : ColrTable) -> Bool

True if COLRv1 data exists.

#
ColrTable::layer_paint

fn ColrTable::layer_paint(self : ColrTable, index : Int) -> Result[
Paint
?, ColorError]

Get COLRv1 layer paint by index.

#
ColrTable::paint_at

fn ColrTable::paint_at(self : ColrTable, offset : Int) -> Result[
Paint
, ColorError]

Parse a paint table at an absolute offset.

#
ColrTable::paint_for_glyph

fn ColrTable::paint_for_glyph(self : ColrTable, glyph_id : Int) -> Result[
Paint
?, ColorError]

Get COLRv1 paint for a glyph, if present.

#
ColrTable::parse

fn ColrTable::parse(data : BytesView) -> Result[ColrTable, ColorError]

Parse COLR table data.

#
ColrTable::var_instancer

fn ColrTable::var_instancer(self : ColrTable, coords : Array[Int]) -> ColrVarInstancer

Build a variation instancer for COLRv1 data.

#
ColrTable::walk_paint

fn ColrTable::walk_paint(self : ColrTable, paint :
Paint
, visit : (
Paint
, Int) -> Bool, max_depth? : Int) -> Result[Int, ColorError]

Walk a COLRv1 paint graph, visiting each node and returning count.

#
ColrVarInstancer

COLRv1 variation instancer.

#
ColrVarInstancer::delta

fn ColrVarInstancer::delta(self : ColrVarInstancer, var_idx_base : UInt?, offset : Int) -> Double

Resolve a variation delta for a varIdxBase + offset.

#
ColrVarInstancer::f16dot16

fn ColrVarInstancer::f16dot16(self : ColrVarInstancer, value : Int, var_idx_base : UInt?, offset : Int) -> Double

Apply a variation delta to an F16DOT16 value (returns float).

#
ColrVarInstancer::f2dot14

fn ColrVarInstancer::f2dot14(self : ColrVarInstancer, value : Int, var_idx_base : UInt?, offset : Int) -> Double

Apply a variation delta to an F2DOT14 value (returns float).

#
ColrVarInstancer::fword

fn ColrVarInstancer::fword(self : ColrVarInstancer, value : Int, var_idx_base : UInt?, offset : Int) -> Double

Apply a variation delta to an FWORD value (returns float).

#
CpalTable

pub struct CpalTable {
version : Int
num_colors : Int
num_palettes : Int
num_color_records : Int
color_records : Array[
Color
]
color_record_indices : Array[Int]
palette_flags : Array[UInt]?
palette_labels : Array[Int]?
color_labels : Array[Int]?
} derive(Show, ToJson)

CPAL color palette table.

#
CpalTable::palette_colors

fn CpalTable::palette_colors(self : CpalTable, palette_index : Int) -> Array[
Color
]

Get palette colors for the given palette index.

#
CpalTable::parse

fn CpalTable::parse(data : BytesView) -> Result[CpalTable, ColorError]

Parse CPAL table data.

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

© 2026 mooncakes.io