Inteface for fonts.
main
Font f = system.get default font
int height = f.get height
int ascent = f.get ascent
print "Default font properties. Height: " & height & " Ascent: " & ascent
string testData = "Amount of pixels needed to show this text on one line is: "
print testData & f.get width of testData in pixels
int screenWidth = screen.get size.get width
int amountOfData = f.get size of testData fitting into screenWidth pixels
print amountOfData & " characters of test data can be shown on one line."
Returns the height of the font in pixels.
main
Font f = system.get default font
print "System default font height: " & f.get height
Returns the distance from the top of the font to the base line.
main
Font f = system.get default font
print "System default font ascent: " & f.get ascent
Returns the width of a string in pixels when drawn, using this font.
main
Font f = system.get default font
int requiredWidth = f.get width of "Test data" in pixels
print "Required screen width in pixels to display text on one line: " & requiredWidth
Returns the width of a string in pixels when drawn, using this font.
main
Font f = system.get default font
int requiredWidth = f.get width of "Test data" range 0 size 2 in pixels
print "Required screen width in pixels to display 2 first characters of text: " & requiredWidth
Returns the count of characters that are fully visible when String str is
drawn using this font into a space that is width pixels wide.
main
Font f = system.get default font
int charactersDisplayed = f.get size of "Test data" fitting into 100 pixels
print "Amount of characters of text fitting into 100 pixels: " & charactersDisplayed
Returns the count of characters that are fully visible when part of String str is
drawn using this font into space that is width pixels wide. The sub-range is defined
by the Range strRange.
main
Font f = system.get default font
int charactersDisplayed = f.get size of "Test data" range 0 size 2 fitting into 10 pixels
print "Amount of characters of text fitting into 10 pixels: " & charactersDisplayed