Seed7 - The extensible programming language
Seed7 FAQ Manual Screenshots Examples Libraries Algorithms Download Links
Libraries AES ARC4 Array ASN.1 Bigfile Bigint Bigrat Bin32 Bin64 Bitdata Bitmapfont Bitset Bitsetof Boolean Browser Bstring Bytedata Cards Category CC config Cgi Cgi dialog Char Charsets Cipher Clib_file Color CLI Commands Complex Console Crc32 Deflate DES Dialog Dir Draw Duration Echo Editline Enable_input Enable_io Enable_output Encoding Environment External_file File File system Float Font Forloop Ftp Getf Gethttp Gethttps Graph Graph_file Gzip Hash Hashsetof Hmac Html_ent Httpserv Idxarray Image Inflate Inflate file Inifile Integer Keybd Line Listener LZW Make Math Msgdigest Null_file Osfiles Picture utility Pixmap_file Pixmapfont PKCS #1 Poll Process Progs Propertyfile Rational Reference Ref_list Scanfile Scanstri Set Shell Smtp Sockbase Socket SQL base Stdio Strifile String Stritext Subrange Tar Text Time TLS/SSL Triple DES Unicode Utf16 Utf8 Vectorfont 3D Vector Window Wrinum X.509 Xmldom Xml_ent Zip
Libraries
Font Source Code
 previous   up   next 

Types
font
Interface type for fonts.
emptyFont
Font implementation type to represent an empty font.
fontProperties
Font implementation type to manage font properties.

font

const type: font

Interface type for fonts. The font interface is implemented with emptyFont, fontProperties, bitmapFont and vectorFont.


emptyFont

const type: emptyFont

Font implementation type to represent an empty font.


fontProperties

const type: fontProperties

Font implementation type to manage font properties.


Function Summary
integer
xHeight (in font: aFont)
Get the height of the letter 'x' for a given font.
integer
capHeight (in font: aFont)
Get the height of capital letters for a given font.
integer
lineHeight (in font: aFont)
Get the height of a font.
integer
ascent (in font: aFont)
Get the ascent of a font.
integer
descent (in font: aFont)
Get the descent of a font.
integer
columnWidth (in font: aFont)
Get the maximal column width of a font.
integer
characterSpacing (in font: aFont)
Get the spacing between the chars of a font.
integer
width (in font: aFont, in string: stri)
Get the pixel width of a string displayed with a font.
integer
numOfCharsInWidth (in font: aFont, in string: stri, in integer: allowedWidth)
When a string is displayed with a font, how many chars fit in a width.
integer
compare (in font: font1, in font: font2)
Compare two font values.
integer
hashCode (in font: aFont)
Compute the hash value of a font.

Function Detail

xHeight

const func integer: xHeight (in font: aFont)

Get the height of the letter 'x' for a given font. The height measured in pixels.

Returns:
the pixel height of 'x' for aFont.

capHeight

const func integer: capHeight (in font: aFont)

Get the height of capital letters for a given font. The height measured in pixels.

Returns:
the capital letter height of aFont.

lineHeight

const func integer: lineHeight (in font: aFont)

Get the height of a font. This is the height necessary to display a line with all chars of a font. The line height is measured in pixels.

Returns:
the line height of aFont.

ascent

const func integer: ascent (in font: aFont)

Get the ascent of a font. The ascent is the distance between xHeight and the height of the tallest lower-case letter. The ascent is measured in pixels.

Returns:
the ascent pixels of aFont.

descent

const func integer: descent (in font: aFont)

Get the descent of a font. The descent is the maximum distance that a letter extends below the baseline of a font. The descent is measured in pixels.

Returns:
the descent pixels of aFont.

columnWidth

const func integer: columnWidth (in font: aFont)

Get the maximal column width of a font. The width of all chars in a font is checked to get the maximal column width. The maximal column width is measured in pixels.

Returns:
the maximal column width of aFont.

characterSpacing

const func integer: characterSpacing (in font: aFont)

Get the spacing between the chars of a font. The character spacing is measured in pixels.

Returns:
the spacing between the chars of aFont.

width

const func integer: width (in font: aFont, in string: stri)

Get the pixel width of a string displayed with a font.

Returns:
the pixel width of stri displayed with aFont.

numOfCharsInWidth

const func integer: numOfCharsInWidth (in font: aFont, in string: stri, in integer: allowedWidth)

When a string is displayed with a font, how many chars fit in a width. The width is specified in pixels. The expression:

numOfCharsInWidth(aFont, stri, width(aFont, stri))

will always be equivalent to

length(stri);
Returns:
the number of chars from stri that fit into allowedWidth when stri is displayed with aFont.

compare

const func integer: compare (in font: font1, in font: font2)

Compare two font values. This function does neither compare font contents nor font names. The order of two fonts is determined by comparing the memory positions of their internal data representation. Therefore the result of compare is arbitrary and may change when the program is executed again. Inside a program the result of compare is consistent and can be used to maintain hash tables.

Returns:
-1, 0 or 1 if the first argument is considered to be respectively less than, equal to, or greater than the second.

hashCode

const func integer: hashCode (in font: aFont)

Compute the hash value of a font.

Returns:
the hash value.


 previous   up   next