Representation of a TrueType font. More...
Public Member Functions | |
| decimal | GetPixelsPerUnit () |
| Gets the pixels per unit value of the font. The default for all fonts is 40. | |
| decimal | GetAscent () |
| Gets the distance in pixels above the baseline. | |
| decimal | GetDescent () |
| Gets the distance in pixels below the baseline. | |
| decimal | GetLeading () |
| Gets the distance between lines in pixels. | |
| decimal | GetSpaceWidth () |
| Gets the width of the space character. | |
| integer | GetOversampling () |
| Gets the oversampling value. The default is 1 for all fonts. | |
| decimal | GetPixelCoverageThreshold () |
| Gets the pixel coverage threshold value. Pixels with coverage under this value become fully transparent, and pixels with coverage equal to or above this value become fully opaque. The default is 0.5 for all fonts. | |
| decimal | GetGlyphAdvance (integer codepoint) |
| Gets the advance width of a given glyph through its code point, if it exists in the font. | |
| boolean | IsAntialiasingEnabled () |
| Gets whether the font has anti-aliasing enabled. | |
| boolean | HasGlyph (integer codepoint) |
| Checks if the font has a glyph for the given code point. | |
| void | SetPixelsPerUnit (number pixelsPerUnit) |
| Sets the pixels per unit value of the font. Higher values improve the clarity, at the cost of increased memory usage. Note that this causes all glyphs to be reloaded, so this should usually only be called once. | |
| void | SetAscent (number ascent) |
| Sets the distance in pixels above the baseline. | |
| void | SetDescent (number descent) |
| Sets the distance in pixels below the baseline. | |
| void | SetLeading (number leading) |
| Sets the distance between lines in pixels. | |
| void | SetSpaceWidth (number spaceWidth) |
| Sets the width of the space character. | |
| void | SetOversampling (integer oversampling) |
| Sets the oversampling value. Higher values increase font quality. Changing this value causes all font glyphs to be reloaded. | |
| void | SetPixelCoverageThreshold (decimal threshold) |
| Sets the pixel coverage threshold value. Pixels with coverage under this value become fully transparent, and pixels with coverage equal to or above this value become fully opaque. This only has an effect on fonts with anti-aliasing disabled. | |
| void | SetAntialiasing (boolean useAntialiasing) |
| Enables or disables anti-aliasing on the font. If disabling, you may want to increase the pixel coverage value with Font.SetPixelCoverageThreshold. | |
| Font (string font) | |
| Loads a font from the given resource path. | |
| Font (stream font) | |
| Loads a font from the given stream. | |
| Font (array font) | |
| Loads a font from the given array containing resource paths or streams. | |
Representation of a TrueType font.
| Font.Font | ( | string | font | ) |
Loads a font from the given resource path.
| font | The font. If this argument is not given, it will use font the application was built with, if one is present. |
| Font.Font | ( | stream | font | ) |
Loads a font from the given stream.
| font | The font. If this argument is not given, it will use font the application was built with, if one is present. |
| Font.Font | ( | array | font | ) |
Loads a font from the given array containing resource paths or streams.
| font | The list of fonts. If this argument is not given, it will use font the application was built with, if one is present. |
| decimal Font.GetAscent | ( | ) |
Gets the distance in pixels above the baseline.
| decimal Font.GetDescent | ( | ) |
Gets the distance in pixels below the baseline.
| decimal Font.GetGlyphAdvance | ( | integer | codepoint | ) |
Gets the advance width of a given glyph through its code point, if it exists in the font.
| codepoint | An Unicode code point. |
| decimal Font.GetLeading | ( | ) |
Gets the distance between lines in pixels.
| integer Font.GetOversampling | ( | ) |
Gets the oversampling value. The default is 1 for all fonts.
| decimal Font.GetPixelCoverageThreshold | ( | ) |
Gets the pixel coverage threshold value. Pixels with coverage under this value become fully transparent, and pixels with coverage equal to or above this value become fully opaque. The default is 0.5 for all fonts.
| decimal Font.GetPixelsPerUnit | ( | ) |
Gets the pixels per unit value of the font. The default for all fonts is 40.
| decimal Font.GetSpaceWidth | ( | ) |
Gets the width of the space character.
| boolean Font.HasGlyph | ( | integer | codepoint | ) |
Checks if the font has a glyph for the given code point.
| codepoint | An Unicode code point. |
| boolean Font.IsAntialiasingEnabled | ( | ) |
Gets whether the font has anti-aliasing enabled.
| void Font.SetAntialiasing | ( | boolean | useAntialiasing | ) |
Enables or disables anti-aliasing on the font. If disabling, you may want to increase the pixel coverage value with Font.SetPixelCoverageThreshold.
| useAntialiasing | Whether or not to use anti-aliasing. |
| void Font.SetAscent | ( | number | ascent | ) |
Sets the distance in pixels above the baseline.
| ascent | The distance. |
| void Font.SetDescent | ( | number | descent | ) |
Sets the distance in pixels below the baseline.
| descent | The distance. |
| void Font.SetLeading | ( | number | leading | ) |
Sets the distance between lines in pixels.
| leading | The distance. |
| void Font.SetOversampling | ( | integer | oversampling | ) |
Sets the oversampling value. Higher values increase font quality. Changing this value causes all font glyphs to be reloaded.
| oversampling | The oversampling value. |
| void Font.SetPixelCoverageThreshold | ( | decimal | threshold | ) |
Sets the pixel coverage threshold value. Pixels with coverage under this value become fully transparent, and pixels with coverage equal to or above this value become fully opaque. This only has an effect on fonts with anti-aliasing disabled.
| threshold | The threshold value, from 0.0 to 1.0. |
| void Font.SetPixelsPerUnit | ( | number | pixelsPerUnit | ) |
Sets the pixels per unit value of the font. Higher values improve the clarity, at the cost of increased memory usage. Note that this causes all glyphs to be reloaded, so this should usually only be called once.
| pixelsPerUnit | The pixels per unit value. |
| void Font.SetSpaceWidth | ( | number | spaceWidth | ) |
Sets the width of the space character.
| spaceWidth | The width. |