Libraries.Game.Graphics.Fonts.KerningValuesList Documentation

The KerningValuesList class maintains a hash table which maps a right-hand character to a kerning value. This hash table is mapped to a given left-hand character in the KerningTable class.

Example Code

use Libraries.Game.Graphics.Fonts.all
    use Libraries.Game.Game

    class Main is Game
        action Main
            StartGame()
        end 

        action CreateGame
            KerningValuesList values
            // Gets the kerning value of the glyph at glyph table index 0
            output values:GetKerningValue(0)
        end
    end

Inherits from: Libraries.Language.Object

Summary

Actions Summary Table

ActionsDescription
Add(integer rightCharacterGlyphIndex, integer kerningValue)This action adds the kerning value of the right-hand character to the hash table.
Compare(Libraries.Language.Object object)This action compares two object hash codes and returns an integer.
Equals(Libraries.Language.Object object)This action determines if two objects are equal based on their hash code values.
GetHashCode()This action gets the hash code for an object.
GetKerningValue(integer rightCharacterGlyphIndex)This action returns the kerning value for the character at the given glyph table index.
HasKey(integer rightCharacterGlyphIndex)This action checks if the kerning value table contains a kerning value for the given right-hand character.

Actions Documentation

Add(integer rightCharacterGlyphIndex, integer kerningValue)

This action adds the kerning value of the right-hand character to the hash table.

Example Code

use Libraries.Game.Graphics.Fonts.all
        use Libraries.Game.Game

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                KerningValuesList values
                // Adds a kerning value of 10 to the glyph at glyph table index 0
                // to the hash table.
                values:Add(0, 10)
            end
        end

Parameters

Compare(Libraries.Language.Object object)

This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.

Example Code

Object o
        Object t
        integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)

Parameters

Return

integer: The Compare result, Smaller, Equal, or Larger.

Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

Example Code

use Libraries.Language.Object
        use Libraries.Language.Types.Text
        Object o
        Text t
        boolean result = o:Equals(t)

Parameters

Return

boolean: True if the hash codes are equal and false if they are not equal.

GetHashCode()

This action gets the hash code for an object.

Example Code

Object o
        integer hash = o:GetHashCode()

Return

integer: The integer hash code of the object.

GetKerningValue(integer rightCharacterGlyphIndex)

This action returns the kerning value for the character at the given glyph table index.

Example Code

use Libraries.Game.Graphics.Fonts.all
        use Libraries.Game.Game

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                KerningValuesList values
                output values:GetKerningValue(0)
            end
        end

Parameters

Return

integer: Returns the kerning value for the characters.

HasKey(integer rightCharacterGlyphIndex)

This action checks if the kerning value table contains a kerning value for the given right-hand character.

Example Code

use Libraries.Game.Graphics.Fonts.all
        use Libraries.Game.Game

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                KerningValuesList values
                output values:HasKey(0)
            end
        end

Parameters

Return

boolean: Returns true if there is a kerning value for the given character, and false if there is not.