Libraries.Game.Graphics.Fonts.TrueTypeFileInformation Documentation

The TrueTypeFileInformation class is used to maintain information that is read from TrueType format (.ttf) files. This includes how many tables are in the file, the offsets for each table, font flags, and more.

Example Code

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

    class Main is Game
        action Main
            StartGame()
        end

        action CreateGame
            TrueTypeFileInformation information
            // Sets the number of pixels between two characters on different lines.
            // This value is combined with the maximum height of a possible glyph
            // in the font to create the appropriate spacing.
            information:SetLineGap(1)
            // Sets the number of pixels that the tallest glyph in the font will
            // extend above the baseline by to 20. Used in calculating line spacing.
            information:SetMaximumAscent(20)
        end
    end

Inherits from: Libraries.Language.Object

Summary

Actions Summary Table

ActionsDescription
AddFontTableDirectoryEntry(text tag, integer checksum, integer offset, integer length)This action adds information about a table from the font file to the array of table directories.
BoundingBoxToText(integer pixelSize, integer emSize)This action returns the scaled minimum and maximum x and y coordinate positions of the bounding box for the font file as text.
BoundingBoxToText()This action returns the minimum and maximum x and y coordinate positions of the bounding box for the font file as text.
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.
GetCharacterMapFormat()This action returns the format of the character map table of the font file.
GetCharacterMapTablePosition()This action returns the offset needed to access the character map table ("cmap" table) in the font file.
GetCreatedDate()This action returns the date the font file was created.
GetEntrySelector()This action returns the index of the current entry in a table from the font file.
GetFontDirectionHint()This action returns the direction to adjust pixels when performing hinting.
GetGlyphDataLocationTablePosition()This action returns the offset needed to access the glyph data location table ("loca" table) in the font file.
GetGlyphOutlineTablePosition()This action returns the offset needed to access the glyph outline table ("glyf" table) in the font file.
GetHashCode()This action gets the hash code for an object.
GetHorizontalHeaderTablePosition()This action returns the offset needed to access the horizontal header table ("head" table) in the font file.
GetIndexToLocationTableFormat()This action returns the format of the indecies used to access the location table.
GetKerningSubtablePosition()This action returns the offset needed to access the kerning table ("kern" table) in the font file.
GetKerningValuesTablePosition()This action returns the offset needed to access the kerning values table ("kerx" table) in the font file.
GetLastChangedDate()This action returns the date the font file was last changed.
GetLineGap()This action returns the line gap value to use when creating space between two lines of text.
GetLowestRecommendedPixelsPerEm()This action returns the lowest recommended pixels per EM of the font.
GetMaximumAscent()This action returns the maximum ascent, the distance from the baseline of the font to the highest point of the tallest glyph of the font, of the font, in pixels.
GetMaximumDescent()This action returns the maximum descent, the distance from the baseline of the font to the lowest point of the lowest glyph of the font, of the font, in pixels.
GetNumberOfTables()This action returns the number of tables in the font file.
GetRangeShift()This action returns how much the index of a table has to be shifted by to move to the next location in the table.
GetScalerType()This action returns the scaler type of the font file.
GetSearchRange()This action returns the maximum index range for reading a table in the font file.
GetTrueTypeCollectionFlag()This action returns the flag which determines if the font file is a TrueTypeCollection (.
GetTrueTypeCollectionRecords()This action returns the TrueTypeCollectionRecords for the font file.
GetUnitsPerEm()This action returns the units per EM of the font.
GetXMaximum()This action returns the rightmost x-coordinate position of the font; no glyph in the font should be farther to the right than this point.
GetXMinimum()This action returns the leftmost x-coordinate position of the font; no glyph in the font should be father left than this point.
GetYMaximum()This action returns the uppermost y-coordinate position of the font; no glyph in the font should be above this point.
GetYMinimum()This action returns the lowermost y-coordinate position of the font; no glyph in the font should be below this point.
SetAllTrueTypeInformation(Libraries.Game.Graphics.Fonts.TrueTypeCollectionData information)This action sets all of the font file information using a TrueTypeCollectionData object.
SetCharacterMapFormat(integer format)This action sets the format of the character map table of the font file.
SetCharacterMapTablePosition(integer characterMapPosition, integer format)This action sets the offset needed to access the character map table in the font file, as well as the format of the character map table.
SetCreatedDate(Libraries.Compute.BigInteger createdDate)This action sets the date the font file was created.
SetEntrySelector(integer value)This action sets the index of the current entry in a table from the font file.
SetFontDirectionHint(integer fontDirectionHint)This action sets the direction to adjust pixels when performing hinting.
SetGlobalFontInformationFlags(integer flags)This action sets the general flags of the font.
SetGlyphDataLocationTablePosition(integer glyphDataLocationPosition)This action sets the offset needed to access the glyph data table ("loca" table) in the font file.
SetGlyphOutlineTablePosition(integer glyfPosition)This action sets the offset needed to access the glyph outline table in the font file.
SetHorizontalHeaderTablePosition(integer horizontalPosition)This action sets the offset needed to access the horizontal header table ("head" table) in the font file.
SetIndexToLocationTableFormat(integer indexToLocationFormat)This action sets the format of the indecies used to access the location table.
SetKerningSubtablePosition(integer kernPosition)This action sets the offset needed to access the kerning table ("kern" table) in the font file.
SetKerningValuesTablePosition(integer kerningValuesTablePosition)This action sets the offset needed to access the kerning values table ("kerx" table) in the font file.
SetLastChangedDate(Libraries.Compute.BigInteger lastChangedDate)This action sets the date the font file was last changed.
SetLineGap(integer value)This action sets the line gap value to use when creating space between two lines of text.
SetLowestRecommendedPixelsPerEm(integer lowestRecommendedPixelsPerEm)This action sets the lowest recommended pixels per EM of the font.
SetMacStyleFlags(integer flags)This action sets the Mac style flags of the font.
SetMaximumAscent(integer value)This action sets the maximum ascent, the distance from the baseline of the font to the highest point of the tallest glyph of the font, of the font, in pixels.
SetMaximumDescent(integer value)This action sets the maximum descent, the distance from the baseline of the font to the lowest point of the lowest glyph of the font, of the font, in pixels.
SetNumberOfTables(integer value)This action sets the number of tables in the font file.
SetRangeShift(integer value)This action sets how much the index of a table has to be shifted by to move to the next location in the table.
SetScalerType(integer value)This action sets the scaler type of the font file.
SetSearchRange(integer value)This action sets the maximum index range for reading a table in the font file.
SetTrueTypeCollectionFlag(boolean value)This action sets the flag which determines if the font file is a TrueTypeCollection (.
SetTrueTypeCollectionRecords(Libraries.Game.Graphics.Fonts.TrueTypeCollectionRecords table)This action sets the TrueTypeCollectionRecords for the font file.
SetUnitsPerEm(integer unitsPerEM)This action sets the units per EM of the font.
SetXMaximum(Libraries.Game.Graphics.Fonts.Signed16BitFontUnit xMaximum)This action sets the rightmost x-coordinate position of the font; no glyph in the font should be farther to the right than this point.
SetXMinimum(Libraries.Game.Graphics.Fonts.Signed16BitFontUnit xMinimum)This action sets the leftmost x-coordinate position of the font; no glyph in the font should be farther left than this point.
SetYMaximum(Libraries.Game.Graphics.Fonts.Signed16BitFontUnit yMaximum)This action sets the uppermost y-coordinate position of the font; no glyph in the font should be above this point.
SetYMinimum(Libraries.Game.Graphics.Fonts.Signed16BitFontUnit yMinimum)This action sets the lowermost y-coordinate position of the font; no glyph in the font should be below this point.

Actions Documentation

AddFontTableDirectoryEntry(text tag, integer checksum, integer offset, integer length)

This action adds information about a table from the font file to the array of table directories. These entries contain the tag of the table, such as "glyf", a checksum value to make sure the table is accurate, the offset to access the table, and the size of the table.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                information:AddFontTableDirectoryEntry("glyf", 0, 100, 500)
            end
        end

Parameters

BoundingBoxToText(integer pixelSize, integer emSize)

This action returns the scaled minimum and maximum x and y coordinate positions of the bounding box for the font file as text.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                output information:BoundingBoxToText(12, 2048)
            end
        end

Parameters

Return

text: Returns the scaled minimum and maximum x and y coordinate positions of the bounding box for the font file as text.

BoundingBoxToText()

This action returns the minimum and maximum x and y coordinate positions of the bounding box for the font file as text.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                output information:BoundingBoxToText()
            end
        end

Return

text: Returns the minimum and maximum x and y coordinate positions of the boundign box for the font file as text.

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.

GetCharacterMapFormat()

This action returns the format of the character map table of the font file.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                output information:GetCharacterMapFormat()
            end
        end

Return

integer: Returns the format of the character map table of the font file.

GetCharacterMapTablePosition()

This action returns the offset needed to access the character map table ("cmap" table) in the font file.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                integer offset = information:GetCharacterMapTablePosition()
            end
        end

Return

integer: Returns the offset needed to access the character map table ("cmap" table) in the font file.

GetCreatedDate()

This action returns the date the font file was created.

Example Code

use Libraries.Game.Graphics.Fonts.all
        use Libraries.Game.Game
        use Libraries.Compute.BigInteger

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                BigInteger date
                date = information:GetCreatedDate()
            end
        end

Return

Libraries.Compute.BigInteger: Returns the date the font file was created.

GetEntrySelector()

This action returns the index of the current entry in a table from the font file.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                output information:GetEntrySelector()
            end
        end

Return

integer: Returns the index of the current entry in a table from the font file.

GetFontDirectionHint()

This action returns the direction to adjust pixels when performing hinting.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                output information:GetFontDirectionHint()
            end
        end

Return

integer: Returns the direction to adjust pixels when performing hinting.

GetGlyphDataLocationTablePosition()

This action returns the offset needed to access the glyph data location table ("loca" table) in the font file.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                integer offset = information:GetGlyphDataLocationTablePosition()
            end
        end

Return

integer: Returns the offset needed to access the glyph data location table ("loca" table) in the font file.

GetGlyphOutlineTablePosition()

This action returns the offset needed to access the glyph outline table ("glyf" table) in the font file.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                integer offset = information:GetGlyphOutlineTablePosition()
            end
        end

Return

integer: Returns the offset needed to access the glyph outline table ("glyf" table) in the font file.

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.

GetHorizontalHeaderTablePosition()

This action returns the offset needed to access the horizontal header table ("head" table) in the font file.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                integer offset = information:GetHorizontalHeaderTablePosition()
            end
        end

Return

integer: Returns the offset needed to access the horizontal header table ("head" table) in the font file.

GetIndexToLocationTableFormat()

This action returns the format of the indecies used to access the location table.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                output information:GetIndexToLocationTableFormat()
            end
        end

Return

integer: Returns the format of the indecies used to access the location table.

GetKerningSubtablePosition()

This action returns the offset needed to access the kerning table ("kern" table) in the font file.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                integer offset = information:GetKerningSubtablePosition()
            end
        end

Return

integer: Returns the offset needed to access the kerning table ("kern" table) in the font file.

GetKerningValuesTablePosition()

This action returns the offset needed to access the kerning values table ("kerx" table) in the font file.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                integer offset = information:GetKerningValuesTablePosition()
            end
        end

Return

integer: Returns the offset needed to access the kerning values table ("kerx" table) in the font file.

GetLastChangedDate()

This action returns the date the font file was last changed.

Example Code

use Libraries.Game.Graphics.Fonts.all
        use Libraries.Game.Game
        use Libraries.Compute.BigInteger

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                BigInteger date
                date = information:GetLastChangedDate()
            end
        end

Return

Libraries.Compute.BigInteger: Returns the date the font file was last changed.

GetLineGap()

This action returns the line gap value to use when creating space between two lines of text.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                information:GetLineGap()
            end
        end

Return

integer: Returns the line gap value to use when creating space between two lines of text.

GetLowestRecommendedPixelsPerEm()

This action returns the lowest recommended pixels per EM of the font.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                output information:GetLowestRecommendedPixelsPerEm()
            end
        end

Return

integer: Returns the lowest recommended pixels per EM of the font.

GetMaximumAscent()

This action returns the maximum ascent, the distance from the baseline of the font to the highest point of the tallest glyph of the font, of the font, in pixels.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                output information:GetMaximumAscent()
            end
        end

Return

integer: Returns the maximum ascent of the font, in pixels.

GetMaximumDescent()

This action returns the maximum descent, the distance from the baseline of the font to the lowest point of the lowest glyph of the font, of the font, in pixels.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                output information:GetMaximumDescent()
            end
        end

Return

integer: Returns the maximum descent of the font, in pixels.

GetNumberOfTables()

This action returns the number of tables in the font file.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                output information:GetNumberOfTables()
            end
        end

Return

integer: Returns the number of tables in the font file.

GetRangeShift()

This action returns how much the index of a table has to be shifted by to move to the next location in the table.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                output information:GetRangeShift()
            end
        end

Return

integer: Returns how much the index of a table has to be shifted by to move to the next location in the table.

GetScalerType()

This action returns the scaler type of the font file. Some font files use certain scaler values, like TrueType files, and others that are supported by TrueType may use different scaler values. This determines how the file is read.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                output information:GetScalerType()
            end
        end

Return

integer: Returns the scaler type of the font file.

GetSearchRange()

This action returns the maximum index range for reading a table in the font file.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                output information:GetSearchRange()
            end
        end

Return

integer: Returns the maximum index range for reading a table in the font file.

GetTrueTypeCollectionFlag()

This action returns the flag which determines if the font file is a TrueTypeCollection (.ttc) file or not.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end
            
            action CreateGame
                TrueTypeFileInformation fileInformation
                output fileInformation:GetTrueTypeCollectionFlag()
            end
        end

Return

boolean: Returns true if the file is a TrueTypeCollection (.ttc) file and false if not.

GetTrueTypeCollectionRecords()

This action returns the TrueTypeCollectionRecords for the font file.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end
            
            action CreateGame
                TrueTypeFileInformation fileInformation
                TrueTypeCollectionRecords records = fileInformation:GetTrueTypeCollectionRecords()
            end
        end

Return

Libraries.Game.Graphics.Fonts.TrueTypeCollectionRecords: Returns the name table records for the font file.

GetUnitsPerEm()

This action returns the units per EM of the font.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                output information:GetUnitsPerEm()
            end
        end

Return

integer: Returns the uits per EM of the font.

GetXMaximum()

This action returns the rightmost x-coordinate position of the font; no glyph in the font should be farther to the right than this point.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                Signed16BitFontUnit fontUnit
                fontUnit = information:GetXMaximum()
            end
        end

Return

Libraries.Game.Graphics.Fonts.Signed16BitFontUnit: Returns the rightmost x-coordinate position of the font.

GetXMinimum()

This action returns the leftmost x-coordinate position of the font; no glyph in the font should be father left than this point.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                Signed16BitFontUnit fontUnit
                fontUnit = information:GetXMinimum()
            end
        end

Return

Libraries.Game.Graphics.Fonts.Signed16BitFontUnit: Returns the leftmost x-coordinate position of the font.

GetYMaximum()

This action returns the uppermost y-coordinate position of the font; no glyph in the font should be above this point.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                Signed16BitFontUnit fontUnit
                fontUnit = information:GetYMaximum()
            end
        end

Return

Libraries.Game.Graphics.Fonts.Signed16BitFontUnit: Returns the uppermost y-coordinate position of the font.

GetYMinimum()

This action returns the lowermost y-coordinate position of the font; no glyph in the font should be below this point.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                Signed16BitFontUnit fontUnit
                fontUnit = information:GetYMinimum()
            end
        end

Return

Libraries.Game.Graphics.Fonts.Signed16BitFontUnit: Returns the lowermost y-coordinate position of the font.

SetAllTrueTypeInformation(Libraries.Game.Graphics.Fonts.TrueTypeCollectionData information)

This action sets all of the font file information using a TrueTypeCollectionData object. This is primarily used when dealing with TrueTypeCollection (.ttc) format font files and you need to swap between different styles for the font. Rather than reloading and rereading the font, we store all of the appropriate information for each font style and just swap out the values as they are needed.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end
            
            action CreateGame
                TrueTypeFileInformation fileInformation
                TrueTypeCollectionData data
                fileInformation:SetAllTrueTypeInformation(data)
            end
        end

Parameters

SetCharacterMapFormat(integer format)

This action sets the format of the character map table of the font file.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                information:SetCharacterMapFormat(0)
            end
        end

Parameters

SetCharacterMapTablePosition(integer characterMapPosition, integer format)

This action sets the offset needed to access the character map table in the font file, as well as the format of the character map table.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                information:SetCharacterMapTablePosition(100, 0)
            end
        end

Parameters

SetCreatedDate(Libraries.Compute.BigInteger createdDate)

This action sets the date the font file was created.

Example Code

use Libraries.Game.Graphics.Fonts.all
        use Libraries.Game.Game
        use Libraries.Compute.BigInteger

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                BigInteger date
                date:SetValue("01012001")
                information:SetCreatedDate(date)
            end
        end

Parameters

SetEntrySelector(integer value)

This action sets the index of the current entry in a table from the font file.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                information:SetEntrySelector(200)
            end
        end

Parameters

SetFontDirectionHint(integer fontDirectionHint)

This action sets the direction to adjust pixels when performing hinting.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                information:SetFontDirectionHint(0)
            end
        end

Parameters

SetGlobalFontInformationFlags(integer flags)

This action sets the general flags of the font.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                // The flags will need to be properly read from the file, not
                // created arbitrarily.
                integer flags = 10111010
                information:SetGlobalFontInformationFlags(flags)
            end
        end

Parameters

SetGlyphDataLocationTablePosition(integer glyphDataLocationPosition)

This action sets the offset needed to access the glyph data table ("loca" table) in the font file.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                information:SetGlyphDataLocationTablePosition(200)
            end
        end

Parameters

SetGlyphOutlineTablePosition(integer glyfPosition)

This action sets the offset needed to access the glyph outline table in the font file.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                information:SetGlyphOutlineTablePosition(10)
            end
        end

Parameters

SetHorizontalHeaderTablePosition(integer horizontalPosition)

This action sets the offset needed to access the horizontal header table ("head" table) in the font file.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                information:SetHorizontalHeaderTablePosition(300)
            end
        end

Parameters

SetIndexToLocationTableFormat(integer indexToLocationFormat)

This action sets the format of the indecies used to access the location table.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                // The format will need to be properly read from the file, not
                // created arbitrarily.
                integer format = 10111010
                information:SetIndexToLocationTableFormat(format)
            end
        end

Parameters

SetKerningSubtablePosition(integer kernPosition)

This action sets the offset needed to access the kerning table ("kern" table) in the font file.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                information:SetKerningSubtablePosition(50)
            end
        end

Parameters

SetKerningValuesTablePosition(integer kerningValuesTablePosition)

This action sets the offset needed to access the kerning values table ("kerx" table) in the font file.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                information:SetKerningValuesTablePosition(60)
            end
        end

Parameters

SetLastChangedDate(Libraries.Compute.BigInteger lastChangedDate)

This action sets the date the font file was last changed.

Example Code

use Libraries.Game.Graphics.Fonts.all
        use Libraries.Game.Game
        use Libraries.Compute.BigInteger

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                BigInteger date
                date:SetValue("01012001")
                information:SetLastChangedDate(date)
            end
        end

Parameters

SetLineGap(integer value)

This action sets the line gap value to use when creating space between two lines of text. The value is in number of pixels.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                information:SetLineGap(1)
            end
        end

Parameters

SetLowestRecommendedPixelsPerEm(integer lowestRecommendedPixelsPerEm)

This action sets the lowest recommended pixels per EM of the font. Fonts displayed on screens that cannot meet this minimum are likely to look worse.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                information:SetLowestRecommendedPixelsPerEm(100)
            end
        end

Parameters

SetMacStyleFlags(integer flags)

This action sets the Mac style flags of the font.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                // The flags will need to be properly read from the file, not
                // created arbitrarily.
                integer flags = 10111010
                information:SetMacStyleFlags(flags)
            end
        end

Parameters

SetMaximumAscent(integer value)

This action sets the maximum ascent, the distance from the baseline of the font to the highest point of the tallest glyph of the font, of the font, in pixels.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                information:SetMaximumAscent(20)
            end
        end

Parameters

SetMaximumDescent(integer value)

This action sets the maximum descent, the distance from the baseline of the font to the lowest point of the lowest glyph of the font, of the font, in pixels.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                information:SetMaximumDescent(10)
            end
        end

Parameters

SetNumberOfTables(integer value)

This action sets the number of tables in the font file.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                information:SetNumberOfTables(5)
            end
        end

Parameters

SetRangeShift(integer value)

This action sets how much the index of a table has to be shifted by to move to the next location in the table.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                information:SetRangeShift(1)
            end
        end

Parameters

SetScalerType(integer value)

This action sets the scaler type of the font file. Some font files use certain scaler values, like TrueType files, and others that are supported by TrueType may use different scaler values. This determines how the file is read.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                information:SetScalerType(0)
            end
        end

Parameters

SetSearchRange(integer value)

This action sets the maximum index range for reading a table in the font file.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                information:SetSearchRange(500)
            end
        end

Parameters

SetTrueTypeCollectionFlag(boolean value)

This action sets the flag which determines if the font file is a TrueTypeCollection (.ttc) file or not.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end
            
            action CreateGame
                TrueTypeFileInformation fileInformation
                fileInformation:SetTrueTypeCollectionFlag(true)
            end
        end

Parameters

SetTrueTypeCollectionRecords(Libraries.Game.Graphics.Fonts.TrueTypeCollectionRecords table)

This action sets the TrueTypeCollectionRecords for the font file.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end
            
            action CreateGame
                TrueTypeFileInformation fileInformation
                TrueTypeCollectionRecords records
                fileInformation:SetTrueTypeCollectionRecords(records)
            end
        end

Parameters

SetUnitsPerEm(integer unitsPerEM)

This action sets the units per EM of the font.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                information:SetUnitsPerEm(10)
            end
        end

Parameters

SetXMaximum(Libraries.Game.Graphics.Fonts.Signed16BitFontUnit xMaximum)

This action sets the rightmost x-coordinate position of the font; no glyph in the font should be farther to the right than this point.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                Signed16BitFontUnit fontUnit
                fontUnit:SetFontUnit(100)
                information:SetXMaximum(fontUnit)
            end
        end

Parameters

SetXMinimum(Libraries.Game.Graphics.Fonts.Signed16BitFontUnit xMinimum)

This action sets the leftmost x-coordinate position of the font; no glyph in the font should be farther left than this point.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                Signed16BitFontUnit fontUnit
                fontUnit:SetFontUnit(0)
                information:SetXMinimum(fontUnit)
            end
        end

Parameters

SetYMaximum(Libraries.Game.Graphics.Fonts.Signed16BitFontUnit yMaximum)

This action sets the uppermost y-coordinate position of the font; no glyph in the font should be above this point.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                Signed16BitFontUnit fontUnit
                fontUnit:SetFontUnit(100)
                information:SetYMaximum(fontUnit)
            end
        end

Parameters

SetYMinimum(Libraries.Game.Graphics.Fonts.Signed16BitFontUnit yMinimum)

This action sets the lowermost y-coordinate position of the font; no glyph in the font should be below this point.

Example Code

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

        class Main is Game
            action Main
                StartGame()
            end

            action CreateGame
                TrueTypeFileInformation information
                Signed16BitFontUnit fontUnit
                fontUnit:SetFontUnit(-10)
                information:SetYMinimum(fontUnit)
            end
        end

Parameters