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
Bitmapfont Source Code
 previous   up   next 

Types
bitmapFont
Font implementation type for bitmap fonts.

bitmapFont

const type: bitmapFont

Font implementation type for bitmap fonts. The following bitmap fonts are available: stdfont8.s7i, stdfont9.s7i, stdfont10.s7i, stdfont12.s7i, stdfont14.s7i, stdfont16.s7i, stdfont18.s7i, stdfont20.s7i, stdfont24.s7i


Function Summary
integer
width (in bitmapFont: bmpFont, in string: stri)
Determine the pixel width of a string displayed with a font.
integer
numOfCharsInWidth (in bitmapFont: bmpFont, in string: stri, in integer: allowedWidth)
Compute how many chars fit in a width, when stri is displayed.
PRIMITIVE_WINDOW
genPixmap (in array string: pattern, in color: foreground, in color: background, in integer: scale)
Create a pixmap from a pattern.
pixmapFontType
genPixmapFont (in bitmapFont: bmpFont, in integer: fontSize, in integer: scale, in color: foreground, in color: background)
Create a pixmap font from a bitmap font.
PRIMITIVE_WINDOW
getFontCharPixmap (in bitmapFont: bmpFont, inout pixmapFontType: pixmapFont, in char: ch)
Get the pixmap of a given bitmapFont and char.
integer
columnWidth (in fontPicType: fontPictures)
Determine the maximal column width of all chars in a fontPicType.

Function Detail

width

const func integer: width (in bitmapFont: bmpFont, in string: stri)

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

Returns:
the pixel width of stri displayed with bmpFont.

numOfCharsInWidth

const func integer: numOfCharsInWidth (in bitmapFont: bmpFont, in string: stri, in integer: allowedWidth)

Compute how many chars fit in a width, when stri is displayed. This is done for the given bmpFont. The allowedWidth 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 bmpFont.

genPixmap

const func PRIMITIVE_WINDOW: genPixmap (in array string: pattern, in color: foreground, in color: background, in integer: scale)

Create a pixmap from a pattern. A pattern is a rectangular grid of characters. It encodes the pixels of a pixmap with characters. The space (' ') encodes a background pixel and any other character encodes a foregound pixel. A scale of 1 describes an encoding with pixels. When scale is greater than 1 rectangles with side length scale are used instead of pixels.

Returns:
the created pixmap.

genPixmapFont

const func pixmapFontType: genPixmapFont (in bitmapFont: bmpFont, in integer: fontSize, in integer: scale, in color: foreground, in color: background)

Create a pixmap font from a bitmap font. The pixmapFont structure is set up and the pixmap for space (' ') is created. The pixmaps of other characters are created on demand with getFontCharPixmap.

Returns:
the created pixmap font.

getFontCharPixmap

const func PRIMITIVE_WINDOW: getFontCharPixmap (in bitmapFont: bmpFont, inout pixmapFontType: pixmapFont, in char: ch)

Get the pixmap of a given bitmapFont and char. This function is used to create character pixmaps on demand.

Returns:
the pixmap of the character ch.

columnWidth

const func integer: columnWidth (in fontPicType: fontPictures)

Determine the maximal column width of all chars in a fontPicType. This is used as helper function when a font is defined.

Returns:
the maximal column width of all chars in fontPictures.


 previous   up   next