Libraries
Vectorfont Source Code
 previous   up   next 

Types
vectorFont
Font implementation type for vector fonts.

vectorFont

const type: vectorFont

Font implementation type for vector fonts. The following vector fonts are available: vecfont10.s7i, vecfont18.s7i, cronos16.s7i, cronos27.s7i, modern27.s7i


Function Summary
integer
width (in vectorFont: vecFont, in string: stri)
Determine the pixel width of a string displayed with a font.
integer
numOfCharsInWidth (in vectorFont: vecFont, in string: stri, in integer: allowedWidth)
Compute how many chars fit in a width, if stri is displayed.
PRIMITIVE_WINDOW
genPixmap (in vectorFont: vecFont, in charVectorType: charVectors, in color: foreground, in color: background, in integer: scale)
Create a pixmap from charVectors.
pixmapFontType
genPixmapFont (in vectorFont: vecFont, in integer: fontSize, in integer: scale, in color: foreground, in color: background)
Create a pixmap font from a vector font.
PRIMITIVE_WINDOW
getFontCharPixmap (in vectorFont: vecFont, inout pixmapFontType: pixmapFont, in char: ch)
Get the pixmap of a given vectorFont and char.
integer
columnWidth (in fontVectorType: fontVectors)
Determine the maximum column width of all chars in a fontVectorType.

Function Detail

width

const func integer: width (in vectorFont: vecFont, in string: stri)

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

Returns:
the pixel width of stri displayed with vecFont.

numOfCharsInWidth

const func integer: numOfCharsInWidth (in vectorFont: vecFont, in string: stri, in integer: allowedWidth)

Compute how many chars fit in a width, if stri is displayed. This is done for the given vecFont. 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 if stri is displayed with vecFont.

genPixmap

const func PRIMITIVE_WINDOW: genPixmap (in vectorFont: vecFont, in charVectorType: charVectors, in color: foreground, in color: background, in integer: scale)

Create a pixmap from charVectors. The charVectorType describes an array of filled polygons. Together the filled polygons define a pixmap. The background is used as background of the pixmap and the foreground is used as color for the filled polygons. The scale parameter is used to scale the pixmap, but does not scale the polygons.

Returns:
the created pixmap.

genPixmapFont

const func pixmapFontType: genPixmapFont (in vectorFont: vecFont, in integer: fontSize, in integer: scale, in color: foreground, in color: background)

Create a pixmap font from a vector 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 vectorFont: vecFont, inout pixmapFontType: pixmapFont, in char: ch)

Get the pixmap of a given vectorFont 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 fontVectorType: fontVectors)

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

Returns:
the maximum column width of all chars in fontVectorType.


 previous   up   next