Font - Verge3D User Manual - Soft8Soft
Description: Learn how to use Font in your interactive 3D apps made with Verge3D

# Font

Create a set of Shapes representing a font loaded in JSON format.

## Constructor

### Font(data : Object)

data — JSON typeface data representing the font.

This constructor creates a new Font, which is an array of Shapes.

## Properties

### # .data : Object

The JSON typeface data passed in the constructor.

## Methods

### # .generateShapes(text : String, size : Float, alignX : String, alignY : String, lineHeight : Float, scaledEmSize : Boolean) → Array

- text — string of text.
- size — (optional) scale for the Shapes. Default is `100`.
- alignX — (optional) horizontal text alignment. Default is `"left"`.
- alignY — (optional) vertical text alignment. Default is `"topBaseline"`.
- lineHeight — (optional) line height. Default is `-1` for auto.
- scaledEmSize — (optional) reduce font height to match font bounding box, not ascender-descender value taken from the font. Default is `false`.

Creates an array of shapes representing the text rendered with this font. Internally, this method uses ShapePath to generate shapes.

## See Also

Check out the Text Rendering section in the manual for more info on creating text objects in Verge3D.

## Source

For more info on how to obtain the source code of this module see this page.