Skip to content
Henryk Wollik edited this page Jul 29, 2014 · 2 revisions

Class: TextureFont

TextureFont

new TextureFont(arraybuffer, textureUnit)

A glyphmap representation of a font.

Parameters:
Name Type Argument Description
arraybuffer ArrayBuffer

The font data

textureUnit Number <optional>

The target texture unit

Source:

Methods

<static> getSupportedCharsDefault() → {String}

Return the default renderable chracters.

Source:
Returns:
Type
String

deleteGlTexture()

Delete the glyphmap texture.

Source:

drawText(str, color)

Draw a string on the xy-plane.

Parameters:
Name Type Argument Default Description
str String

The string

color Color <optional>
Color.white()

The color send to the shader.

Source:

drawTextBox(str, size, color)

Draw a size constrained string on the xy-plane.

Parameters:
Name Type Argument Default Description
str String

The string

size Vec2

The size of the bounding box

color Color <optional>
Color.white()

The color send to the shader

Source:

getCharsSupported() → {String}

Return the currently renderable characters.

Source:
Returns:
Type
String

getFontSize() → {Number}

Return the current fontsize;

Source:
Returns:
Type
Number

getGlyphTableGLTexture() → {WebGLTexture}

Return the glyphmap texture.

Source:
Returns:
Type
WebGLTexture

getGlyphTableGLTextureSize(v) → {Vec2}

Return the current glyphmap texture size.

Parameters:
Name Type Argument Description
v Vec2 <optional>

Out size

Source:
Returns:
Type
Vec2

getLineHeight() → {Number}

Return the current line height.

Source:
Returns:
Type
Number

getTextBounds(str, rect) → {Rect}

Return the bounding box of a string

Parameters:
Name Type Description
str String

The string

rect Rect

Out rect

Source:
Returns:
Type
Rect

getTextWidth(str) → {Number}

Return the width of a string.

Parameters:
Name Type Description
str String

The string

Source:
Returns:
Type
Number

setCharsSupported(chars)

Set the renderable characters.

Parameters:
Name Type Description
chars String

The characters

Source:

setFontSize(fontSize)

Set the fontsize.

Parameters:
Name Type Description
fontSize Number

The size

Source:

setLineHeight(lineHeight)

Set the line height.

Parameters:
Name Type Description
lineHeight Number

The height

Source:

Generated with wicked.