Sabzi
2011-02-12 07:00:06
Hi!
I have searched for it but I couldn't find a decent answer and I cbf to look trough every script hoping someone already done this :p.
So I have made the fonts already, named correctly, black/white.
I have written a tester script which is basically a GetTextAtEx using the font folder I made, but it never gives me anything. I tried changing spacings, tolerances, coords, colors, so I have came here to get answer.
If I have the correct bmps in the fonts folder(inside another folder just like other fonts) how do I use them?
tl;dr: A simple example of using self-made fonts in simba is enough. (without srl please)
Thanks!
Sabzi
p.s.: I have made this tiny script to make font making easier, thought I share it, nothing crazy tho:
I have searched for it but I couldn't find a decent answer and I cbf to look trough every script hoping someone already done this :p.
So I have made the fonts already, named correctly, black/white.
I have written a tester script which is basically a GetTextAtEx using the font folder I made, but it never gives me anything. I tried changing spacings, tolerances, coords, colors, so I have came here to get answer.
If I have the correct bmps in the fonts folder(inside another folder just like other fonts) how do I use them?
tl;dr: A simple example of using self-made fonts in simba is enough. (without srl please)
Thanks!
Sabzi
p.s.: I have made this tiny script to make font making easier, thought I share it, nothing crazy tho:
program FontMaker;
const
PIC_NAME = '';
COLOR = 10926007;
TOL = 28;
procedure BlackWhite;
var
bmp, W, H, i, j: Integer;
Mbmp: TMufasaBitmap;
begin
bmp := LoadBitmap(ScriptPath + PIC_NAME + '.bmp');
Mbmp := GetMufasaBitmap(bmp);
W := Mbmp.Width; H := Mbmp.Height;
for i := 0 to W-1 do
for j := 0 to H-1 do
if not SimilarColors(Mbmp.FastGetPixel(i, j), COLOR, TOL) then
Mbmp.FastSetPixel(i, j, clBlack)
else
Mbmp.FastSetPixel(i, j, clWhite);
Mbmp.SaveToFile(ScriptPath + PIC_NAME + '_BW.bmp');
Mbmp.Free;
//FreeBitmap(bmp); Gives exception,
//if I free MufasaBmp this one is freed too, right?
end;
begin
SetColorToleranceSpeed(2);
BlackWhite;
end.