Skip to main content

Rasterizer

Description:

  A Rasterizer handles font rendering, containing the font data (image or TrueType font) and drawable glyphs.

release

Type: Function.

Description:

  Destroys the object's Lua reference. The object will be completely deleted if it's not referenced by any other LÖVE object or thread. This method can be used to immediately clean up resources without waiting for Lua's garbage collector.

Signature:

release: function(self: Rasterizer): boolean

Returns:

Return TypeDescription
booleanTrue if the object was released by this call, false if it had been previously released.

type

Type: Function.

Description:

  Gets the type of the object as a string.

Signature:

type: function(self: Rasterizer): string

Returns:

Return TypeDescription
stringThe type as a string.

Of

Type: Function.

Description:

  Checks whether an object is of a certain type. If the object has the type with the specified name in its hierarchy, this function will return true.

Signature:

typeOf: function(self: Rasterizer, type_name: string): boolean

Parameters:

ParameterTypeDescription
type_namestringThe name of the type to check for.

Returns:

Return TypeDescription
booleanTrue if the object is of the specified type, false otherwise.

getHeight

Type: Function.

Description:

  Gets font height.

Signature:

getHeight: function(self: Rasterizer): integer

Returns:

Return TypeDescription
integerFont height

getAdvance

Type: Function.

Description:

  Gets font advance.

Signature:

getAdvance: function(self: Rasterizer): integer

Returns:

Return TypeDescription
integerFont advance.

getAscent

Type: Function.

Description:

  Gets ascent height.

Signature:

getAscent: function(self: Rasterizer): integer

Returns:

Return TypeDescription
integerAscent height.

getDescent

Type: Function.

Description:

  Gets descent height.

Signature:

getDescent: function(self: Rasterizer): integer

Returns:

Return TypeDescription
integerDescent height.

getLineHeight

Type: Function.

Description:

  Gets line height of a font.

Signature:

getLineHeight: function(self: Rasterizer): integer

Returns:

Return TypeDescription
integerLine height of a font.

getGlyphData

Type: Function.

Description:

  Gets glyph data of a specified glyph.

Signature:

getGlyphData: function(self: Rasterizer, glyph: string | integer): GlyphData

Parameters:

ParameterTypeDescription
glyphstring or integerGlyph

Returns:

Return TypeDescription
GlyphDataGlyph data

getGlyphCount

Type: Function.

Description:

  Gets number of glyphs in font.

Signature:

getGlyphCount: function(self: Rasterizer): integer

Returns:

Return TypeDescription
integerGlyphs count.

hasGlyphs

Type: Function.

Description:

  Checks if font contains specified glyphs.

Signature:

hasGlyphs: function(self: Rasterizer, glyph: string | integer, ...: string | integer): boolean

Parameters:

ParameterTypeDescription
glyphstring or integerGlyph
...string or integerThe ... parameter.

Returns:

Return TypeDescription
booleanWhatever font contains specified glyphs.