SRL Archive - Jr. Member General Help and Discussion

Creating Custom Font Set


Foundry

2013-12-01 17:45:48

So I followed the guide to creating a custom font set located here and had no problems. It is all set up and put in a folder located in the Font directory of simba. When I try to run this:

program new;
{$i srl-6/srl.simba}
var
pnt : TPoint;
begin
if findText(pnt, ['xam'], [Rev1], intToBox(0, 0, 400, 400)) then
writeLn('woohoo');
end.

I get this:

Exception in Script: Unknown declaration "Rev1" at line 6, column 30

I think I have to load it somehow but I have no idea how to do that. I tried looking through some SRL files like text.simba but it didn't really help. Help?

bg5

2013-12-01 18:57:19

GetTextAtExWrap(xs, ys, xe, ye, MinVerticalSpacing, MaxVerticalSpacing, HorizontalSpacing, FontColor,FontColorTolerance,'FontName' );

for example:


GetClientDimensions(w,h); // so our searching area is whole client
text := GetTextAtExWrap(0, 0, w-1, h-1, 0, 4, 4, clwhite,0,'MyFont' );

@edit:

Now I see your question is SRL related. I don't have SRL6 , but I guess Rev1 should be between ' '

Foundry

2013-12-01 19:21:43

From: bg5
GetTextAtExWrap(xs, ys, xe, ye, MinVerticalSpacing, MaxVerticalSpacing, HorizontalSpacing, FontColor,FontColorTolerance,'FontName' );

for example:


GetClientDimensions(w,h); // so our searching area is whole client
text := GetTextAtExWrap(0, 0, w-1, h-1, 0, 4, 4, clwhite,0,'MyFont' );

@edit:

Now I see your question is SRL related. I don't have SRL6 , but I guess Rev1 should be between ' '


Yeah, I was wondering how to load the font, because it isn't accepting it as a string. It works with the other fonts that come with srl6, so it must mean they are defined or loaded somewhere.

bg5

2013-12-01 19:40:18

From: Foundry
Yeah, I was wondering how to load the font, because it isn't accepting it as a string. It works with the other fonts that come with srl6, so it must mean they are defined or loaded somewhere.


What it says when you put string?

Olly

2013-12-01 20:00:21

You have to load the font your self, loadFont('mychars') and then in findText put the parameter in string form ['mychars'].

xtrapsp

2013-12-02 09:22:59

From: Olly
You have to load the font your self, loadFont('mychars') and then in findText put the parameter in string form ['mychars'].


Just to note, do this in the main area, it only needs loading once.