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

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.

Parameters

  • text tag: The name of the table, such as "glyf".
  • integer checksum: An error-checking value to make sure the table is correct.
  • integer offset: The offset needed to access this table in the font file.
  • integer length: The size of the table.

Example

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

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.

Parameters

  • integer pixelSize: The point size to scale to.
  • integer emSize: The emSize of the font.

Return

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

Example

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

BoundingBoxToText()

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

Return

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

Example

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

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.

Parameters

Return

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

Example

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

Equals(Libraries.Language.Object object)

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

Parameters

Return

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

Example

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

GetCharacterMapFormat()

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

Return

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

Example

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

GetCharacterMapTablePosition()

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

Return

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

Example

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

GetCreatedDate()

This action returns the date the font file was created.

Return

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

Example

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

GetEntrySelector()

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

Return

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

Example

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

GetFontDirectionHint()

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

Return

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

Example

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

GetGlyphDataLocationTablePosition()

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

Return

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

Example

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

GetGlyphOutlineTablePosition()

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

Return

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

Example

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

GetHashCode()

This action gets the hash code for an object.

Return

integer: The integer hash code of the object.

Example

Object o
integer hash = o:GetHashCode()

GetHorizontalHeaderTablePosition()

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

Return

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

Example

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

GetIndexToLocationTableFormat()

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

Return

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

Example

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

GetKerningSubtablePosition()

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

Return

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

Example

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

GetKerningValuesTablePosition()

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

Return

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

Example

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

GetLastChangedDate()

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

Return

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

Example

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

GetLineGap()

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

Return

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

Example

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

GetLowestRecommendedPixelsPerEm()

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

Return

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

Example

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

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.

Return

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

Example

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

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.

Return

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

Example

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

GetNumberOfTables()

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

Return

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

Example

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

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.

Return

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

Example

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

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.

Return

integer: Returns the scaler type of the font file.

Example

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

GetSearchRange()

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

Return

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

Example

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

GetTrueTypeCollectionFlag()

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

Return

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

Example

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

GetTrueTypeCollectionRecords()

This action returns the TrueTypeCollectionRecords for the font file.

Return

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

Example

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

GetUnitsPerEm()

This action returns the units per EM of the font.

Return

integer: Returns the uits per EM of the font.

Example

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

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.

Return

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

Example

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

GetXMinimum()

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

Return

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

Example

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

GetYMaximum()

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

Return

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

Example

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

GetYMinimum()

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

Return

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

Example

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

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.

Parameters

Example

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

SetCharacterMapFormat(integer format)

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

Parameters

  • integer format: The format of the character map table of the font file.

Example

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

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.

Parameters

  • integer characterMapPosition: The offset of the character map table in the font file.
  • integer format: The format of the character map table in the font file.

Example

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

SetCreatedDate(Libraries.Compute.BigInteger createdDate)

This action sets the date the font file was created.

Parameters

Example

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

SetEntrySelector(integer value)

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

Parameters

  • integer value: The index of the current entry in a table from the font file.

Example

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

SetFontDirectionHint(integer fontDirectionHint)

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

Parameters

  • integer fontDirectionHint: The direction to adjust pixels when performing hinting.

Example

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

SetGlobalFontInformationFlags(integer flags)

This action sets the general flags of the font.

Parameters

  • integer flags: The general flags of the font.

Example

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

SetGlyphDataLocationTablePosition(integer glyphDataLocationPosition)

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

Parameters

  • integer glyphDataLocationPosition: The offset needed to access the glyph data table ("loca" table) in the font file.

Example

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

SetGlyphOutlineTablePosition(integer glyfPosition)

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

Parameters

  • integer glyfPosition: The offset of the glyph outline table in the font file.

Example

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

SetHorizontalHeaderTablePosition(integer horizontalPosition)

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

Parameters

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

Example

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

SetIndexToLocationTableFormat(integer indexToLocationFormat)

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

Parameters

  • integer indexToLocationFormat: The format of the indecies used to access the location table.

Example

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

SetKerningSubtablePosition(integer kernPosition)

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

Parameters

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

Example

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

SetKerningValuesTablePosition(integer kerningValuesTablePosition)

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

Parameters

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

Example

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

SetLastChangedDate(Libraries.Compute.BigInteger lastChangedDate)

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

Parameters

Example

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

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.

Parameters

  • integer value: The number of pixels to use as the line gap between two lines of text.

Example

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

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.

Parameters

  • integer lowestRecommendedPixelsPerEm: The lowest recommended pixels per EM of the font.

Example

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

SetMacStyleFlags(integer flags)

This action sets the Mac style flags of the font.

Parameters

  • integer flags: The Mac style flags of the font.

Example

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

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.

Parameters

  • integer value: The maximum ascent of the font, in pixels.

Example

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

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.

Parameters

  • integer value: The maximum descent of the font, in pixels.

Example

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

SetNumberOfTables(integer value)

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

Parameters

  • integer value: The number of tables in the font file.

Example

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

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.

Parameters

  • integer value: How much the index of a table has to be shifted by to move to the next location in the table.

Example

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

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.

Parameters

  • integer value: The scaler type of the font file.

Example

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

SetSearchRange(integer value)

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

Parameters

  • integer value: The maximum index range for reading a table in the font file.

Example

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

SetTrueTypeCollectionFlag(boolean value)

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

Parameters

  • boolean value: True if the file is a TrueTypeCollection (.ttc) file and false if not.

Example

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

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

This action sets the TrueTypeCollectionRecords for the font file.

Parameters

Example

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

SetUnitsPerEm(integer unitsPerEM)

This action sets the units per EM of the font.

Parameters

  • integer unitsPerEM

Example

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

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.

Parameters

Example

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

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.

Parameters

Example

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

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.

Parameters

Example

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

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.

Parameters

Example

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