Easy & Quick method of updating fonts!
As some of you know, OpenGL can be used to extract the RuneScape font as a single .png file:


Each time JaGeX deciedes to update their fonts, we go bananas and our OCR would be down for a day or two because it's kinda hard to update the fonts using our current method (which is manually grabbing each and every character we can find).
Now we don't have to do that anymore. Why not?
By using OpenGL and Simba, we can now automatically update the fonts in matter of seconds after RuneScape updates. All we need to do is to have a program hook RuneScape and get the fonts we need (like the ones I've added further up in this post). Once we have done that, we can then 'chop' this image into smaller cells.
Simba Code:
type
TCharSet = record
Path : String;
BMP : Integer;
Characters : array [0..255] of Integer;
Spacing : TPoint;
end;
const
FONT_PATH = '';
CHARSET_HIGH = 0;
var
CharSet : array [0..CHARSET_HIGH] of TCharSet;
function GetSpacing(var Bitmap : Integer) : TPoint;
var
W, H : Integer;
begin
GetBitmapSize(Bitmap, W, H);
Result := Point(W div 16, H div 16);
end;
procedure LoadCharsets;
var
I : Integer;
begin
for I := 0 to CHARSET_HIGH do
begin
with CharSet[I] do
begin
Path := FONT_PATH + IntToStr(I) + '.png';
if FileExists(Path) then
BMP := LoadBitmap(Path)
else
begin
WriteLn(FONT_PATH + IntToStr(I) + '.png, does not exist!');
TerminateScript;
end;
Spacing := GetSpacing(BMP);
end;
end;
end;
procedure ExtractCharacters;
var
I, C,
W, H,
X, Y, sX, sY,
Col, t : Integer;
begin
for I := 0 to CHARSET_HIGH do
begin
t := GetSystemTime;
GetBitmapSize(CharSet[I].BMP, W, H);
for C := 0 to 255 do // Extended ASCII Table.
begin
CharSet[I].Characters[C] := CreateBitmap(CharSet[I].Spacing.X, CharSet[I].Spacing.Y);
FastDrawClear(CharSet[I].Characters[C], clBlack);
for Y := 0 to CharSet[I].Spacing.X-1 do
for X := 0 to CharSet[I].Spacing.Y-1 do
begin
sX := ((C mod CharSet[I].Spacing.X)*CharSet[I].Spacing.X) + X;
sY := ((C div CharSet[I].Spacing.Y)*CharSet[I].Spacing.Y) + Y;
try
Col := FastGetPixel(CharSet[I].BMP, sX, sY);
FastSetPixel(Charset[I].Characters[C], X, Y, Col);
except end;
end;
end;
WriteLn(GetSystemTime - t);
end;
end;
procedure SaveCharacters;
var
I, J : Integer;
begin
if not DirectoryExists(FONT_PATH + 'Extracted') then
CreateDirectory(FONT_PATH + 'Extracted');
for I := 0 to CHARSET_HIGH do
begin
if not DirectoryExists(FONT_PATH + 'Extracted\' + IntToStr(I)) then
CreateDirectory(FONT_PATH + 'Extracted\' + IntToStr(I));
for J := 0 to 255 do
SaveBitmap(CharSet[I].Characters[J], FONT_PATH + 'Extracted\' + IntToStr(I) + '\' + IntToStr(J) + '.bmp');
end;
end;
procedure FreeCharsets;
var
I, J : Integer;
begin
for I := 0 to CHARSET_HIGH do
begin
FreeBitmap(CharSet[I].BMP);
for J := 0 to 255 do
FreeBitmap(CharSet[I].Characters[J]);
end;
end;
begin
LoadCharsets;
ExtractCharacters;
SaveCharacters;
FreeCharsets;
end.
Using this script, I've been able to turn the RuneScape UpText into a folder in only 3 seconds, and we might be able to make it even faster.
This is the images the script produced (put into a .rar file for easier uploading/downloading):
UpText, ChatChars or XPChars
Unfortunately we can't use those images just yet, as we have to trim those images a little more before Simba is able to handle them, but that would not be a big problem at all.
HOW-TO: Using the script:
First you have to create a folder named something like "Charsets", once you have done that, fill in the path to that folder into FONT_PATH. In my case it would be "C:\Users\User\Pictures\SRL\Charsets".
Next you download this image:

Save it as "0.png" inside the newly created folder.
Now you're done! Hit the run button and wait for the script to finish, then look inside your Charsets folder 


EDIT: Now this script doesn't produce bmps with different widths like we use in Simba, but it will be fairly easy to alter the bmps (using a script) to match the ones we're using with simba today.
EDIT2: I'll do that ^ in the weekend.