Skip to main content

GlyphData

Description:

  A GlyphData represents a drawable symbol of a font Rasterizer.

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: GlyphData): 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: GlyphData): 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: GlyphData, 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.

getString

Type: Function.

Description:

  Gets the full Data as a string.

Signature:

getString: function(self: GlyphData): string

Returns:

Return TypeDescription
stringThe raw data.

getSize

Type: Function.

Description:

  Gets the Data's size in bytes.

Signature:

getSize: function(self: GlyphData): integer

Returns:

Return TypeDescription
integerThe size of the Data in bytes.

getPointer

Type: Function.

Description:

  Gets a pointer to the Data. Can be used with libraries such as LuaJIT's FFI.

Signature:

getPointer: function(self: GlyphData): any

Returns:

Return TypeDescription
anyA raw pointer to the Data.

getFFIPointer

Type: Function.

Description:

  Gets an FFI pointer to the Data. This function should be preferred instead of Data:getPointer because the latter uses light userdata which can't store more all possible memory addresses on some new ARM64 architectures, when LuaJIT is used.

Signature:

getFFIPointer: function(self: GlyphData): nil

Returns:

Return TypeDescription
nilA raw void* pointer to the Data, or nil if FFI is unavailable.

clone

Type: Function.

Description:

  Creates a new copy of the Data object.

Signature:

clone: function(self: GlyphData): GlyphData

Returns:

Return TypeDescription
GlyphDataThe new copy.

getWidth

Type: Function.

Description:

  Gets glyph width.

Signature:

getWidth: function(self: GlyphData): integer

Returns:

Return TypeDescription
integerGlyph width.

getHeight

Type: Function.

Description:

  Gets glyph height.

Signature:

getHeight: function(self: GlyphData): integer

Returns:

Return TypeDescription
integerGlyph height.

getDimensions

Type: Function.

Description:

  Gets glyph dimensions.

Signature:

getDimensions: function(self: GlyphData): integer, integer

Returns:

Return TypeDescription
integerGlyph width.
integerGlyph height.

getGlyph

Type: Function.

Description:

  Gets glyph number.

Signature:

getGlyph: function(self: GlyphData): integer

Returns:

Return TypeDescription
integerGlyph number.

getGlyphString

Type: Function.

Description:

  Gets glyph string.

Signature:

getGlyphString: function(self: GlyphData): string

Returns:

Return TypeDescription
stringGlyph string.

getAdvance

Type: Function.

Description:

  Gets glyph advance.

Signature:

getAdvance: function(self: GlyphData): integer

Returns:

Return TypeDescription
integerGlyph advance.

getBearing

Type: Function.

Description:

  Gets glyph bearing.

Signature:

getBearing: function(self: GlyphData): integer, integer

Returns:

Return TypeDescription
integerGlyph bearing X.
integerGlyph bearing Y.

getBoundingBox

Type: Function.

Description:

  Gets glyph bounding box.

Signature:

getBoundingBox: function(self: GlyphData): integer, integer, integer, integer

Returns:

Return TypeDescription
integerGlyph position x.
integerGlyph position y.
integerGlyph width.
integerGlyph height.

getFormat

Type: Function.

Description:

  Gets glyph pixel format.

Signature:

getFormat: function(self: GlyphData): string

Returns:

Return TypeDescription
stringGlyph pixel format.