moonbit-community/diago/fonts does not have a README file

    Resolver

    type Resolver = (Face) -> Source?

    Called only for font roles required by the rendered SVG. Return None when the requested face is unavailable; rendering then reports a RenderError.

    Face

    pub(all) enum Face {
    SansRegular
    SansBold
    SansSemibold
    SansItalic
    MonoRegular
    MonoBold
    MonoItalic
    } derive(Eq, Hash,
    Debug
    )

    Font roles used by the renderer and its built-in measurement tables.

    Face::equal

    #deprecated("`Face::equal` is deprecated, use `Eq::equal` instead.")
    fn Face::equal(Face, Face) -> Bool

    Face::hash

    #deprecated("`Face::hash` is deprecated, use `Hash::hash` instead.")
    fn Face::hash(self : Face) -> Int

    Face::hash_combine

    #deprecated("`Face::hash_combine` is deprecated, use `Hash::hash_combine` instead.")
    fn Face::hash_combine(Face, Hasher) -> Unit

    Face::name

    fn Face::name(self : Face) -> String

    Face::not_equal

    #deprecated("`Face::not_equal` is deprecated, use `Eq::not_equal` instead.")
    fn Face::not_equal(x : Face, y : Face) -> Bool

    Face::to_repr

    #deprecated("`Face::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
    fn Face::to_repr(Face) ->
    Repr

    MeasureRequest

    pub(all) struct MeasureRequest {
    text : String
    font_size : Int
    face : Face
    bounds_with_dot : Bool
    code_line_height : Bool
    }

    A text run to measure in pixels. The selected face is the same role used by the SVG font resolver. The host must load its fonts before measurement.

    Measurement

    pub(all) struct Measurement {
    width : Double
    height : Double
    }

    Unrounded dimensions for the complete request, including any newlines. Values must be finite and nonnegative. Diago rounds the final label bounds.

    Measurer

    pub struct Measurer((MeasureRequest) -> Measurement)

    A per-call text measurement implementation, for example backed by a browser canvas, a host font library, or precomputed metrics for a custom typeface.

    Measurer::measure

    fn Measurer::measure(self : Measurer, request : MeasureRequest) -> Measurement

    Measurer::new

    fn Measurer::new(measure : (MeasureRequest) -> Measurement) -> Measurer

    Measurer::to_repr

    #deprecated("`Measurer::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
    fn Measurer::to_repr(_self : Measurer) ->
    Repr

    Source

    pub(all) enum Source {
    Ttf(Bytes)
    Url(String)
    }

    TTF data is subsetted and embedded in the exported SVG. A URL is written to the SVG unchanged apart from CSS escaping; the renderer performs no I/O. For replacement typefaces, supply a matching Measurer during both layout and rendering. With no Measurer, Diago uses its built-in font metrics.