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: Font, text: string, fontSize: number, combine?: boolean, centerCharacterOrigin?: boolean, bezierAccuracy?: number, opentypeOptions?: RenderOptions): Text
  • Renders text in a given font to a model.

    Parameters

    • font: 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: RenderOptions

      Optional opentype.RenderOptions object.

    Returns Text

    Model of the text.

Properties

models

models: IModelMap

Methods

Static glyphToModel

  • glyphToModel(glyph: Glyph, fontSize: number, bezierAccuracy?: number): IModel

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