
-----------------------------------
zylum
Sat Feb 28, 2004 1:47 am

pixel font editor
-----------------------------------
i was bored an thougt it would be cool if i made a program that allows you to create your own pixel fonts and then use them. here's what i have so far

instructions: click on the grid to edit the letter. click outside the box to move on to the next letter... if you accidentaly click outside the box before you finish the current letter, tough lol... when naming, dont include any extension.


setscreen ("graphics:145;160")
var coords : array 1 .. 26, 1 .. 5, 1 .. 5 of int
var file : int
var fileName : string

put "what is the"
put "font name?"
get fileName
fileName += ".font"
cls
open : file, fileName, put

procedure reset (L : int)
    for x : 1 .. 5
        for y : 1 .. 5
            drawbox (x * 21 - 1, y * 21 - 1, x * 21 + 20, y * 21 + 20, black)
            drawfillbox (x * 21, y * 21, x * 21 + 19, y * 21 + 19, grey)
            coords (L, x, y) := 0
        end for
    end for
end reset

setscreen ("offscreenonly")

var letter : int := 65
var mx, my, md : int

for i : 1 .. 26
    reset (letter - 64)
    loop
        locate (1, 1)
        put "letter: ", chr (letter)
        mousewhere (mx, my, md)
        if md = 1 then
            mx := mx div 21
            my := my div 21
            if mx >= 1 and my >= 1 and mx = 65 and ord (letter) 