Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace TypesettingUtils

Collection of different constants and utility functions used by Typesetters.

Index

Variables

Const EM_TO_PX

EM_TO_PX: 16 = 16

Ratio between EMs and Pixels.

Const OBLIQUE_ANGLE

OBLIQUE_ANGLE: 0.174533 = 0.174533

Angle used when emulating italic fonts (oblique).

Const OBLIQUE_OFFSET

OBLIQUE_OFFSET: number = Math.tan(OBLIQUE_ANGLE)

Horizontal offset used when emulating italic fonts (oblique).

Const PT_TO_PX

PT_TO_PX: 1.25 = 1.25

Ratio between Points and Pixels.

Functions

computeGlyphTransform

  • computeGlyphTransform(transform: Matrix3, position: Vector3, scale: number, rotation: number, localRotation: number): void
  • Computes the transformation matrix for a glyph.

    Parameters

    • transform: Matrix3

      Matrix used to store the results.

    • position: Vector3

      Glyph' position.

    • scale: number

      Glyph' scale.

    • rotation: number

      TextCanvas rotation.

    • localRotation: number

      Glyph' local rotation.

    Returns void

getDirection

getPixelSize

  • getPixelSize(size: number, unit: FontUnit, originalSize: number): number

getSmallCapsScale

  • getSmallCapsScale(glyphs: GlyphData[], smallCapsTransformations: boolean[], index: number, fontVariant: FontVariant): number

updateBounds

  • updateBounds(corners: Vector3[], globalBounds: Box2, individualBounds?: undefined | { array: Box2[]; offset: number }): void
  • Updates the supplied bounds with the computed screen-space corners for a given glyph.

    Parameters

    • corners: Vector3[]

      Glyph' corners.

    • globalBounds: Box2

      Global text bounds.

    • Optional individualBounds: undefined | { array: Box2[]; offset: number }

      Individual per-character bounds.

    Returns void

Generated using TypeDoc