Libraries.Game.Graphics.Fonts.CompoundGlyphFlags Documentation

The CompoundGlyphFlags class is used to store and process the flags of components of compound glyphs, as well as maintain information about the components such as its location in the glyph table, any scale values, and any reposition/anchor point values. For more details on these flags and anything else, see the Microsoft documentation for the "glyf" table.

Example Code

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        flags:SetFlags(65536)   // maximum 16-bit number, this sets all flags to true
    end 
end

Inherits from: Libraries.Language.Object

Actions Documentation

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)

GetArg1And2AreWords()

This action returns the flag determining if the arguments are 16 bit values or 8 bit values. If this returns true they are 16 bit values, and they are 8 bit values otherwise.

Return

boolean: Returns the flag determining the size of the arguments.

Example

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        output flags:GetArg1And2AreWords()
    end
end

GetArgsAreXYValues()

This action returns the flag determining if the arguments are x/y offset values or if they are anchor points. If this returns true then they are x/y offset values, and they are anchor points otherwise.

Return

boolean: Returns the flag determining the argument type.

Example

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        output flags:GetArgsAreXYValues()
    end
end

GetArgument1()

This action returns the first argument for this component. This value can represent either an x-coordinate offset, or an anchor point, depending on the flags set for this component.

Return

integer: Returns the first argument for this component.

Example

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        output flags:GetArgument1()
    end
end

GetArgument2()

This action returns the second argument for this component. This value can represent either a y-coordinate offset, or an anchor point, depending on the flags set for this component.

Return

integer: Returns the second argument for this component.

Example

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        output flags:GetArgument2()
    end
end

GetFlags()

This action returns the 16 bit integer representing the flags for a compound glyph component.

Return

integer: Returns the flags for a compound glyph component.

Example

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        output flags:GetFlags()
    end
end

GetGlyphIndex()

This action returns the glyph index of the compound glyph component.

Return

integer: Returns the glyph index of the compound glyph component.

Example

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        output flags:GetGlyphIndex()
    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()

GetMoreComponents()

This action returns the flag determining if there are more components in the compound glyph after this component. If this returns true, there are more components, and if this returns false this is the last component.

Return

boolean: Returns the flag determining if there are more components.

Example

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        output flags:GetMoreComponents()
    end
end

GetOneZeroScaleTransform()

This action returns the third entry of the transformation matrix.

Return

number: Returns the third entry of the transformation matrix.

Example

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        output flags:GetOneZeroScaleTransform()
    end
end

GetOverlapCompound()

This action returns the flag determning if components of the compound glyph overlap. This flag will only ever be true for the first component of a compound glyph. If this returns true then components overlap, and if it returns false then the components do not overlap.

Return

boolean: Returns the flag determining if the components overlap.

Example

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        output flags:GetOverlapCompound()
    end
end

GetRoundXYToGrid()

This action returns the flag determining whether or not the x/y values should be rounded to the nearest grid-line. If this returns true, they should be rounded, otherwise they should remain as they are.

Return

boolean: Returns the flag determining argument rounding.

Example

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        output flags:GetRoundXYToGrid()
    end
end

GetScale()

This action returns the x/y scale for the glyph.

Return

number: Returns the x/y scale for the glyph.

Example

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        output flags:GetScale()
    end
end

GetScaledComponentOffset()

This action returns the flag determining whether or not the x/y offset values should be applied before scaling the component or after. If this returns true then they should be applied before scaling, and if this returns false they should be applied after scaling the component.

Return

boolean: Returns the flag determining if the x/y offsets should be scaled.

Example

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        output flags:GetScaledComponentOffset()
    end
end

GetUnscaledComponentOffset()

This action returns the flag determining whether or not the x/y offset values should be applied before scaling the component or after. If this returns true then they should be applied after scaling, and if this returns false they should be applied before scaling the component.

Return

boolean: Returns the flag determining if the x/y offsets should be scaled.

Example

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        output flags:GetUnscaledComponentOffset()
    end
end

GetUseMyMetrics()

This action returns the flag determining if the component should use its own metrics instead of those defined in the global font information "head" table. If this returns true then it should use its own metrics, otherwise it should use the global metrics.

Return

boolean: Returns the flag determining if the component should use its own metrics.

Example

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        output flags:GetUseMyMetrics()
    end
end

GetWeHaveAScale()

This action returns the flag determining if the compound glyph component has a simple scale. If this returns true, there is a scale that should be applied to all x/y coordinates of this glyph, otherwise there is no simple scale.

Return

boolean: Returns the flag determining if there is a simple scale.

Example

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        output flags:GetWeHaveAScale()
    end
end

GetWeHaveATwoByTwo()

This action returns the flag determining if there is a 2x2 transformation matrix for this compound glyph component. If this returns true, there is a 2x2 transformation matrix that should be used to perform a linear transformation on the coordinates. If this returns false, there is no 2x2 transformation matrix.

Return

boolean: Returns the flag determining if there is a 2x2 transformation matrix.

Example

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        output flags:GetWeHaveATwoByTwo()
    end
end

GetWeHaveAnXAndYScale()

This action returns the flag determining if there is an x and a y scale for this compound glyph component. If this returns true, there is an x and a y scale that should be applied to all x and y coordinates of this component, respectively. If this returns false then there is no x and y scale.

Return

boolean: Returns the flag determining if there is a separate x and y scale.

Example

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        output flags:GetWeHaveAnXAndYScale()
    end
end

GetWeHaveInstructions()

This action returns the flag determining if there are instructions on how to hint the compound glyph. This flag will only ever be set for the last component of a compound glyph. If this returns true then there are instructions, and if it returns false then there are no instructions.

Return

boolean: Returns the flag determining if there are instructions for hinting the compound glyph.

Example

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        output flags:GetWeHaveInstructions()
    end
end

GetXScale()

This action returns the scale to be applied only to x-coordinates of this glyph.

Return

number: Returns the scale to apply only to x-coordinates of this glyph.

Example

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        output flags:GetXScale()
    end
end

GetXScaleTransform()

This action returns the first entry of the transformation matrix.

Return

number: Returns the first entry of the transformation matrix.

Example

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        output flags:GetXScaleTransform()
    end
end

GetYScale()

This action returns the scale to be applied only to y-coordinates of this glyph.

Return

number: Returns the scale to apply only to y-coordinates of this glyph.

Example

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        output flags:GetYScale()
    end
end

GetYScaleTransform()

This action returns the fourth entry of the transformation matrix.

Return

number: Returns the fourth entry of the transformation matrix.

Example

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        output flags:GetYScaleTransform()
    end
end

GetZeroOneScaleTransform()

This action returns the second entry of the transformation matrix.

Return

number: Returns the second entry of the transformation matrix.

Example

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        output flags:GetZeroOneScaleTransform()
    end
end

SetArgument1(integer value)

This action sets the first argument for this component. This value can represent either an x-coordinate offset, or an anchor point, depending on the flags set for this component.

Parameters

  • integer value: The first argument for this component.

Example

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        flags:SetArgument1(34)
    end
end

SetArgument2(integer value)

This action sets the second argument for this component. This value can represent either a y-coordinate offset, or an anchor point, depending on the flags set for this component.

Parameters

  • integer value: The second argument for this component.

Example

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        flags:SetArgument2(34)
    end
end

SetFlags(integer newFlags)

This action sets the flags of the compound glyph component. The flags themselves are stored if needed for use later, but setting the flags here also breaks them up and sets each boolean flag value appropriately.

Parameters

  • integer newFlags: The flags of this compound glyph component.

Example

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        flags:SetFlags(65536)
    end
end

SetGlyphIndex(integer index)

This action sets the glyph index of the compound glyph component.

Parameters

  • integer index: The glyph index of the glyph.

Example

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        flags:SetGlyphIndex(10)
    end
end

SetOneZeroScaleTransform(number value)

This action sets the third entry of the transformation matrix.

Parameters

  • number value: The third entry of the transformation matrix.

Example

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        flags:SetOneZeroScaleTransform(2.0)
    end
end

SetScale(number value)

This action sets the x/y scale for the glyph.

Parameters

  • number value: The scale to apply to all x/y coordinate positions.

Example

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        flags:SetScale(1.5)
    end
end

SetXScale(number value)

This action sets the scale to be applied only to x-coordinates of this glyph.

Parameters

  • number value: The scale to apply to x-coordinates of this glyph.

Example

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        flags:SetXScale(1.5)
    end
end

SetXScaleTransform(number value)

This action sets the first entry of the transformation matrix.

Parameters

  • number value: The first entry of the transformation matrix.

Example

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        flags:SetXScaleTransform(2.0)
    end
end

SetYScale(number value)

This action sets the scale to be applied only to y-coordinates of this glyph.

Parameters

  • number value: The scale to apply to x-coordinates of this glyph.

Example

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        flags:SetYScale(1.5)
    end
end

SetYScaleTransform(number value)

This action sets the fourth entry of the transformation matrix.

Parameters

  • number value: The fourth entry of the transformation matrix.

Example

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        flags:SetYScaleTransform(2.0)
    end
end

SetZeroOneScaleTransform(number value)

This action sets the second entry of the transformation matrix.

Parameters

  • number value: The second entry of the transformation matrix.

Example

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

class Main is Game
    action Main
        StartGame()
    end

    action CreateGame
        CompoundGlyphFlags flags
        flags:SetZeroOneScaleTransform(2.0)
    end
end