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

Summary

Actions Summary Table

ActionsDescription
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.
GetArg1And2AreWords()This action returns the flag determining if the arguments are 16 bit values or 8 bit values.
GetArgsAreXYValues()This action returns the flag determining if the arguments are x/y offset values or if they are anchor points.
GetArgument1()This action returns the first argument for this component.
GetArgument2()This action returns the second argument for this component.
GetFlags()This action returns the 16 bit integer representing the flags for a compound glyph component.
GetGlyphIndex()This action returns the glyph index of the compound glyph component.
GetHashCode()This action gets the hash code for an object.
GetMoreComponents()This action returns the flag determining if there are more components in the compound glyph after this component.
GetOneZeroScaleTransform()This action returns the third entry of the transformation matrix.
GetOverlapCompound()This action returns the flag determning if components of the compound glyph overlap.
GetRoundXYToGrid()This action returns the flag determining whether or not the x/y values should be rounded to the nearest grid-line.
GetScale()This action returns the x/y scale for the glyph.
GetScaledComponentOffset()This action returns the flag determining whether or not the x/y offset values should be applied before scaling the component or after.
GetUnscaledComponentOffset()This action returns the flag determining whether or not the x/y offset values should be applied before scaling the component or after.
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.
GetWeHaveAScale()This action returns the flag determining if the compound glyph component has a simple scale.
GetWeHaveATwoByTwo()This action returns the flag determining if there is a 2x2 transformation matrix for this compound glyph component.
GetWeHaveAnXAndYScale()This action returns the flag determining if there is an x and a y scale for this compound glyph component.
GetWeHaveInstructions()This action returns the flag determining if there are instructions on how to hint the compound glyph.
GetXScale()This action returns the scale to be applied only to x-coordinates of this glyph.
GetXScaleTransform()This action returns the first entry of the transformation matrix.
GetYScale()This action returns the scale to be applied only to y-coordinates of this glyph.
GetYScaleTransform()This action returns the fourth entry of the transformation matrix.
GetZeroOneScaleTransform()This action returns the second entry of the transformation matrix.
SetArgument1(integer value)This action sets the first argument for this component.
SetArgument2(integer value)This action sets the second argument for this component.
SetFlags(integer newFlags)This action sets the flags of the compound glyph component.
SetGlyphIndex(integer index)This action sets the glyph index of the compound glyph component.
SetOneZeroScaleTransform(number value)This action sets the third entry of the transformation matrix.
SetScale(number value)This action sets the x/y scale for the glyph.
SetXScale(number value)This action sets the scale to be applied only to x-coordinates of this glyph.
SetXScaleTransform(number value)This action sets the first entry of the transformation matrix.
SetYScale(number value)This action sets the scale to be applied only to y-coordinates of this glyph.
SetYScaleTransform(number value)This action sets the fourth entry of the transformation matrix.
SetZeroOneScaleTransform(number value)This action sets the second entry of the transformation matrix.

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.

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.

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.

Example Code

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

Return

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

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.

Example Code

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

Return

boolean: Returns the flag determining the argument type.

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.

Example Code

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

Return

integer: Returns the first argument for this component.

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.

Example Code

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

Return

integer: Returns the second argument for this component.

GetFlags()

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

Example Code

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

Return

integer: Returns the flags for a compound glyph component.

GetGlyphIndex()

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

Example Code

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

Return

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

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.

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.

Example Code

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

Return

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

GetOneZeroScaleTransform()

This action returns the third entry of the transformation matrix.

Example Code

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

Return

number: Returns the third entry of the transformation matrix.

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.

Example Code

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

Return

boolean: Returns the flag determining if the components overlap.

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.

Example Code

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

Return

boolean: Returns the flag determining argument rounding.

GetScale()

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

Example Code

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

Return

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

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.

Example Code

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

Return

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

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.

Example Code

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

Return

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

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.

Example Code

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

Return

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

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.

Example Code

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

Return

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

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.

Example Code

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

Return

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

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.

Example Code

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

Return

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

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.

Example Code

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

Return

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

GetXScale()

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

Example Code

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

Return

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

GetXScaleTransform()

This action returns the first entry of the transformation matrix.

Example Code

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

Return

number: Returns the first entry of the transformation matrix.

GetYScale()

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

Example Code

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

Return

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

GetYScaleTransform()

This action returns the fourth entry of the transformation matrix.

Example Code

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

Return

number: Returns the fourth entry of the transformation matrix.

GetZeroOneScaleTransform()

This action returns the second entry of the transformation matrix.

Example Code

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

Return

number: Returns the second entry of the transformation matrix.

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.

Example Code

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

Parameters

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.

Example Code

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

Parameters

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.

Example Code

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

Parameters

SetGlyphIndex(integer index)

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

Example Code

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

Parameters

SetOneZeroScaleTransform(number value)

This action sets the third entry of the transformation matrix.

Example Code

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

Parameters

SetScale(number value)

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

Example Code

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

Parameters

SetXScale(number value)

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

Example Code

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

Parameters

SetXScaleTransform(number value)

This action sets the first entry of the transformation matrix.

Example Code

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

Parameters

SetYScale(number value)

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

Example Code

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

Parameters

SetYScaleTransform(number value)

This action sets the fourth entry of the transformation matrix.

Example Code

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

Parameters

SetZeroOneScaleTransform(number value)

This action sets the second entry of the transformation matrix.

Example Code

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

Parameters