SRL Archive - Help and Support

How I load a font?!


maxzzz

2006-05-08 14:34:57

How do I load a font?

And how do I name my fonts? Do I name the digit 0 "48" and the digit 9 "57"?

Thnx :)

phantombmx

2006-05-08 17:42:32

there are 4 fonts loaded with SRL already..altho there should be more :rolleyes: use the names there (look in SRL\SRL.scar for them)..

in srl\srl.scar, the font names have a loadfont or something like that there.. so it will be like this

UpText:= loadfont(blahblahblah)


you must name a letter or number based on its ASCII value.. zero's ascii value is 48, hence its name is 48..

maxzzz

2006-05-09 02:57:50

I want to use my own font to make a script that can read a security code for a small game on the internet. It's just for practice with some stuff, text and bitmaps etc.

I know how to name them, I looked in the folder with ChatChars and looked at zero and other digits. That's no problem anymore.
I go look at the srl code how the fonts are loaded but can someone post how I can do it?
I know it's sounds lazy but I'm not a developer or something and still need to learn, and srl is not commented how the code works.

So please post how to load my own font.

I'll explain what I want to do :p..
At www.crimeclub.nl you can register an account etc and then you can become gangster etc.
You can like they say in dutch "Hoeren Pimpen" and for that you need to write a code in a box and the code is displayed left of the box. I've been told that I can get the code returned in a string with the GetTextAtEx function. I've been told also that I need to make my own font for that, that's what I did and I used Drigers Scar tutorial to know how to do that.
Now I have done that I need to load the font so I can use GetTextAtEx with my own created font. Well that's it I think, that's all I need to do and please just help me out with it.

Thnx :) (already)

driger1592

2006-05-09 08:02:16

Check out my tutorial (link is in my sig). You should find at least some of what you're looking for. To load a font do something like:
var myFont: integer;
begin
myFont := LoadChars2(AppPath+'\New Font\');
end.
Except replace the '\New Font\' part with '\My Font Folder Name Goes Here\'.

When you read my tutorial, it will ask you to get as many letters as you can, but all you need to get to use digits is the digits. Getting numbers into their own font is pretty easy. If you want more help, you're welcome to ask ;)

Hope this helps :D

maxzzz

2006-05-09 13:15:42

:D I'll take a look at this tomorow,
one question, I make the new folder in the Scar folder?! I did that, just want to know I did it right :D…

I think I know enough, I'll try it these days and will tell if it does :D

driger1592

2006-05-09 16:10:01

Yup :p Just make a folder like the other fonts that were included for SCAR. You can name the folder whatever you want, just make sure you get the location correctly like I showed in the previous post :p

maxzzz

2006-05-10 13:09:39

So if I would to return the numbers I could do something like this:


var myFont, TheCode : integer;

procedure Loadfont;
begin
myFont := LoadChars2(AppPath+'\New Font\');
end.

procedure GetTheCode;
begin
TheCode := GetTextAtEx(blablabla);
Writeln(TheCode);
end;

begin
Loadfont;
GetTheCode
end;

Just simple and just the main line how to do it, is it right?