Fonts

[ Back ]

All fonts created in a program are converted to a bitmap format. This format is also used when saving and loading fonts.

Sub routines

procedure create font font_id, name$, s[, b[, i[, u[, smooth]]]]
procedure save font font_id, filename$
procedure load font font_id, filename$
procedure save font font_id, txt_filename$, img_filename$
procedure load font font_id, txt_filename$, img_filename$
procedure set font font_id
procedure free font font_id
function font(font_id)
function fheight(font_id)
function fwidth(font_id, txt$)


procedure create font font_id, name$, s[, b[, i[, u[, smooth]]]]

Create font font_id of size s from name name. The font will be bold, italic or underlined if b, i or u is set to true. If smooth is true the font's corners will be smoothened.


procedure save font font_id, filename$

Save font font_id to file filename.


procedure load font font_id, filename$

Load font font_id from file filename$.


procedure save font font_id, txt_filename$, img_filename$

Save font font_id into two files, the data file txt_filename and the image file (bmp) img_filename. If you want to edit the font image in some imaging software, you should know that each character in the bitmap has 4 pixels of extra space in all directions (for outlines, shadows etc).


procedure load font font_id, txt_filename$, img_filename$

Load font font_id from two files, the ascii txt_filename and the image img_filename. Note that you can use the single file version of save font to save both the data and the loaded image into one file.


procedure set font font_id

Use font font_id for write, wln, center and rln.


procedure free font font_id

Free font font_id. All fonts are automatically freed when the program exits.


function font(font_id)

Return true if font font_id exists.


function fheight(font_id)

Return the pixel line height of font font_id.


function fwidth(font_id, txt$)

Return the pixel width of txt if it was to be written with font font_id.


[ Back ]