Maker.js, a Microsoft Garage project, is a JavaScript library for creating and sharing modular line drawings for CNC and laser cutters.

View project on GitHub Star

Api - Text Class

Hierarchy

  • Text

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Text(font: opentype.Font, text: string, fontSize: number, combine?: boolean, centerCharacterOrigin?: boolean, bezierAccuracy?: number, opentypeOptions?: opentype.RenderOptions): Text
  • Renders text in a given font to a model.

    Parameters

    • font: opentype.Font

      OpenType.Font object.

    • text: string

      String of text to render.

    • fontSize: number

      Font size.

    • Default value combine: boolean = false

      Flag (default false) to perform a combineUnion upon each character with characters to the left and right.

    • Default value centerCharacterOrigin: boolean = false

      Flag (default false) to move the x origin of each character to the center. Useful for rotating text characters.

    • Optional bezierAccuracy: number

      Optional accuracy of Bezier curves.

    • Optional opentypeOptions: opentype.RenderOptions

      Optional opentype.RenderOptions object.

    Returns Text

    Model of the text.

Properties

models

models: IModelMap

Methods

Static glyphToModel

  • glyphToModel(glyph: opentype.Glyph, fontSize: number, bezierAccuracy?: number): IModel
  • Convert an opentype glyph to a model.

    Parameters

    • glyph: opentype.Glyph

      Opentype.Glyph object.

    • fontSize: number

      Font size.

    • Optional bezierAccuracy: number

      Optional accuracy of Bezier curves.

    Returns IModel

    Model of the glyph.

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc