Code:
function LoadCharsFromFont2(fontname: string; fontsize: Integer; fontbold, fontitalic, fontunderline, fontstrike: Boolean): Integer;
sooo........
you might use
c:=LoadCharsFromFont2('Veranda',10,true,false,fals e,false);
ive never really used it, but you can experiment with it a bit
you need to test to make sure that the font will work, and find some coordinates for you to use with gettextatex
Code:
function IsTextInAreaEx(x1, y1, x2, y2: Integer; var x, y: Integer; S: String; Tolerance: Integer; Chars: Integer; CheckShadow, CheckOutline: Boolean; MinSpacing, MaxSpacing: Integer; TextColor: Integer) : Boolean;
should work for that, again, tweak the parameters (ex you wont need shadow)
if that works, and you get an x and y returned, you can use
Code:
function GetTextAtEx(x, y: Integer; Tolerance: Integer; Chars: Integer; CheckShadow, CheckOutline: Boolean; MinSpacing, MaxSpacing: Integer; TextColor: Integer; TextLength: Integer; Strict: Boolean; Range: TCharRange) : String;
those are the the three functions you will need to work with (read the manual
)
i modded scripts/test/fonttest2 to give you an example
Code:
//drag crosshair to script box
program New;
var
c: Integer;
x, y: Integer;
text:string;
begin
Sleep(100);
c:= LoadCharsFromFont2('Courier New', 10, False, False, False, False);
if(IsTextInAreaEx(0, 0, 545, 160, x, y, 'Sleep', 10, c, False, True, 0, 0, -1))then
begin
Writeln('yay, found "Sleep" at x=' + IntToStr(x) + ', y=' + IntToStr(y));
text:= GetTextAtEx(x, y, 0, c, False, False, 0, 0, -1, 20, True, tr_NormalChars)
writeln('text is : '+text);
end else
Writeln('nay');
end.
good luck