Font2dResource

lumin. Font2dResource

A 2D font is a font rendered onto a planar image (whatever the format),
as opposed to a 3D model of the glyphs or other graphical representation.

Note, for this implementation, the loadGlyphs() and unloadGlyphs()
functions will only work if called on the render thread by the process
with the OpenGL context. These two methods are also not needed by Lumin
clients, which can create font resources within their prisms; see
Prism::createFont2dResource.

Extends

Methods

getAdvanceDirection() → {lumin.glyph.AdvanceDirection}

Inherited From:

Get the advance direction.

Returns:
Type
lumin.glyph.AdvanceDirection

getAscender() → {number}

Inherited From:

The ascender is the vertical distance from the horizontal
baseline to the highest glyph coordinate.

Returns:
Type
number

getBasePath() → {string}

Inherited From:

Gets the base path of the resource.

Returns:

Base path

Type
string

getDescender() → {number}

Inherited From:

The descender is the vertical distance from the horizontal
baseline to the lowest glyph coordinate, which is negative
if any glyphs extend below the baseline (usually they do).

Returns:
Type
number

getFileName() → {string}

Inherited From:

Gets the FileName Associated with this resource.

Returns:

Filename

Type
string

getFlowDirection() → {lumin.text.FlowDirection}

Inherited From:

Get the text-flow direction.

Returns:
Type
lumin.text.FlowDirection

getFontName() → {string}

Inherited From:
Returns:
Type
string

getFontSize() → {number}

Inherited From:

Get the size of the font; the units are not specified by the interface.

Returns:
Type
number

getFontStyle() → {string}

Inherited From:

Get the font style; e.g., "Italic".

Returns:
Type
string

getGlyphHeight() → {number}

Inherited From:

Get the global glyph height for the font.

Formally, this is the difference between the ascender and descender,
which is what getGlyphHeight() returns.

Returns:
Type
number

getGlyphQuality() → {lumin.glyph.Quality}

Get the glyph quality of the font resource specified in the
Font2dDesc when the font resource was created.

Returns:
Type
lumin.glyph.Quality

getLineSpacing() → {number}

Inherited From:

Get the space between lines of text written with this font.

This is a value provided by the font designer to indicate how
much space should separate lines of text written with the font
relative to the size of a tile (which is 1 in glyph space).

Returns:
Type
number

getLoadedGlyphs() → {Array.<number>}

Inherited From:

Get the list of character codes for which glyphs have been loaded.

Returns:
Type
Array.<number>

getLoadStatus() → {lumin.resources.LoadStatus}

Inherited From:

Return a int that contains the result of loading this resource.

Returns:

int with the result value.

Type
lumin.resources.LoadStatus

getMinAlphaToDiscard() → {number}

Get the minimum value of text fragments to render; see Font2dDesc.

Returns:
Type
number

getResourceId() → {BigInt}

Inherited From:

Returns the Unique ID of this resource

Returns:

Resource ID

Type
BigInt

getShaderType() → {lumin.utils.ShaderType}

Get the type of shader to use for rendering this resource.

Returns:

kMAX only if an error occurred; shader type otherwise.

Type
lumin.utils.ShaderType

getTexture2dArrayIds() → {Array.<number>}

Get the IDs of all 2D texture arrays containing the glyphs of the font.

Returns:
Type
Array.<number>

getTextureDims(textureId) → {ivec3}

After the server has loaded the font resource, this will
return the dimensions of the texture with the given ID.

Parameters:
Name Type Description
textureId number
Returns:

the (height, width, depth) of the texture with the given ID,
or else (0, 0, 0) if the textureID equals 0 or is not known.

Type
ivec3

getTileInfo(character) → {lumin.glyph.TileInfo}

Get the information for rendering a particular character.

Parameters:
Name Type Description
character number

Glyph identifier

Returns:

Information about the glyph representing the given character,
which will equal NONE if no such character has been loaded.

Type
lumin.glyph.TileInfo

getTileSize() → {number}

Get the size of the tiles for the glyphs managed by this resource.

Returns:
Type
number

isResourceValid() → {boolean}

Inherited From:

Returns True if the Resource was successfully loaded

Loading only happens on the server-side so this call is
only useful to the server

Returns:

TRUE = Successfully loaded

Type
boolean

setFont2dDesc(fontDesc)

Parameters:
Name Type Description
fontDesc lumin.glyph.Font2dDesc