Ot.Glyph

The type-namespace duplex Ot.Glyph defines the datatype, related datatype and operations for OpenType glyphs.

Glyph Store

A Ot.Font support any datatype implemented Data.OrderStore<Ot.Glyph> to be the glyph store. ot-builder provided Ot.ListGlyphStore as the default glyph store implementation.

Interface Ot.GlyphStore

Alias of Data.OrderStore<Ot.Glyph>.

Interface Ot.GlyphStoreFactory<GS extends Ot.GlyphStore>

Alias of Data.OrderStoreFactory<Ot.Glyph,​GS>.

Interface Ot.GlyphStoreFactoryWithDefault<GS extends Ot.GlyphStore>

Alias of Data.OrderStoreFactoryWithDefault<Ot.Glyph,​GS>.

Type Ot.ListGlyphStore

An opaque class that implements Data.OrderStore<Ot.Glyph>. Created by Ot.ListGlyphStoreFactory.

Singleton Ot.ListGlyphStoreFactory

An opaque factory object that implements Data.OrderStoreFactoryWithDefault<Ot.Glyph,​Ot.ListGlyphStore>.

Glyph

Class Ot.Glyph

The Ot.Glyph class represents one glyph. Object identity of Ot.Glyph's carry the semantics of glyph identity. Many parts of the font, even some geometries inside the glyph, will hold references to Ot.Glyph's.

Constructor

Properties

Methods

Metrics

Datatype Ot.Glyph.Metric

Defines a metric advance of a glyph.

Properties

Geometry

Interface Ot.Glyph.Geometry

Defines as the union of the following cases.

Properties

  • readonly type:​unique symbol

    The type tag of this hint object.

Case Class Ot.Glyph.ContourSet | type = Ot.Glyph.GeometryType.ContourSet

Implements

Constructor

Interface Ot.Glyph.ContourSetProps

Properties

Case Class Ot.Glyph.TtReference | type = Ot.Glyph.GeometryType.TtReference

Implements

Constructor

Interface Ot.Glyph.TtReferenceProps

Properties

Case Class Ot.Glyph.GeometryList | type = Ot.Glyph.GeometryType.GeometryList

Implements

Constructor

Type Ot.Glyph.GeometryListProp

Properties

Hints

Interface Ot.Glyph.Hint

Defines as the union of the following cases.

Properties

  • readonly type:​unique symbol

    The type tag of this hint object.

Case Class Ot.Glyph.TtInstruction | type = Ot.Glyph.HintType.TtInstruction

Implements

Constructor

Interface Ot.Glyph.TtInstructionProps

Properties

  • instructions:​Buffer

    The buffer containing the TrueType instructions.

Case Class Ot.Glyph.CffHint | type = Ot.Glyph.HintType.CffHint

Implements

Constructor

Interface Ot.Glyph.CffHintProps

Properties

Datatype Ot.Glyph.CffHintStem

Properties

  • start:​Ot.Var

    Start coordinate of this hint stem.

  • end:​Ot.Var

    End coordinate of this hint stem.

Factory Methods

Datatype Ot.Glyph.CffHintMask

Properties

Factory Methods

Support Types

Datatype Ot.Glyph.Contour

Defined as Ot.Glyph.Point[].

Datatype Ot.Glyph.Point

Ot.Glyph.Point defines the datatype of glyph points.

Factory Methods

Properties

Singleton Ot.Glyph.PointOps

Properties

Methods

Type Ot.Glyph.Transform2X3

Constants

Factory Methods

Properties

  • readonly dx:​Ot.Var.Value

    X offset.

  • readonly dy:​Ot.Var.Value

    Y offset.

  • readonly xx:​number

    X scale.

  • readonly yx:​number

    X shearing. Used by the "Scale10" coefficient in TrueType's `glyf`` table.

  • readonly xy:​number

    Y shearing. Used by the "Scale01" coefficient in TrueType's `glyf`` table.

  • readonly yy:​number

    Y scale.

  • readonly scaledOffset:​Data.Maybe<boolean>

    Whether the offset is scaled.

Enumeration Ot.Glyph.PointType

  • Corner = 0

    This point is corner point.

  • Lead = 1

    This point is the first control point of a cubic Bezier curve.

  • Follow = 2

    This point is the second control point of a cubic Bezier curve.

  • Quad = 3

    This point is an off-curve control point in a quadratic contour, as in TrueType.

Datatype Ot.Glyph.PointRef

Properties

Datatype Ot.Glyph.PointIDRef

Properties

Datatype Ot.Glyph.GlyphPointIDRef

Properties

Datatype Ot.Glyph.PointAttachment

Properties

Glyph Naming

Type Ot.GlyphNamingSource

Properties

Interface Ot.GlyphNamer

Properties

Singleton Ot.StandardGlyphNamer

The default glyph namer, implements Ot.GlyphNamer.

Glyph Stats (namespace Ot.Glyph.Stats)

Class Ot.Glyph.Stats.BoundingBox

Constructor

Properties

Static Methods

Geometry Utilities (namespace Ot.GeometryUtil)

Interface Ot.GeometryUtil.GeometrySink<T>

Methods

Interface Ot.GeometryUtil.GeometrySinkClass<T>

Class that constructs Ot.GeometryUtil.GeometrySink<T> instances.

Class Ot.GeometryUtil.Flattener

Implements Ot.GeometryUtil.GeometrySink<Ot.Glyph.Point[][]>

A sink class to flatten the geometry to a contour list.

Class Ot.GeometryUtil.ListPoint

Implements Ot.GeometryUtil.GeometrySink<Ot.Glyph.Point[]>

A sink class to list the geometry's points

Class Ot.GeometryUtil.GetBound

Implements Ot.GeometryUtil.GeometrySink<Ot.Glyph.Stat.BoundingBox>

A sink class to get the bounding box of a geometry

Class Ot.GeometryUtil.CountPoint

Implements Ot.GeometryUtil.GeometrySink<number>

A sink class to count the geometry's points.

Function Ot.GeometryUtil.apply<T>(cls:Ot.GeometryUtil.GeometrySinkClass<T>,​...geometries:Ot.Glyph.Geometry[]):​T

Traverse the geometries and use the sink to collect data.