doom0791
2014-11-09 22:02:15
Greetings,
It has been a couple years since I have posted here and things seem to have changed a bit and I can't seem to find a "scripting help" section. If this is the wrong place to post a help request please forgive me. I am delighted to see that the community is still active.
Anyhow, I'm having some troubles with custom fonts. I'm certain that it's the way I'm creating the bitmap font files because if I copy all of the bitmap files from an already existing font it works. Unfortunately, the best guide that I can find on creating custom fonts is so old that the images associated with the thread are long gone.
My custom font folder is: C:\Simba\Fonts\Arial
I've tried a couple of different things to create the bitmap images:
1. Using Microsoft Paint
I created a copy of the capital letter 'A' pixel-by-pixel in paint, black and white, and saved it as 65.bmp within the Arial folder. I then copy+paste all of the other characters from an already existing font and attempt to run the following script:
This script returns Error: The Points you passed to DrawATPA exceed the bitmap's bounds at line 6
2. Using Adobe Photoshop
Once again I create the character 'A', this time in photoshop, in black and white. I make it a 1-bit image and save it to the Arial folder as 65.bmp. I ran the same script as above and received the same error.
Does anyone have any ideas for what I can do? I'm trying to read fonts in a web browser. Attached is one of the bitmaps I created.
Thank you all,
DooM
Edit: After playing with it for awhile I realized that Simba automatically loads all of the fonts in the Fonts folder upon opening. Restarting Simba stopped this error from occurring. Is there something wrong with the LoadFont function or was I using it incorrectly?
It has been a couple years since I have posted here and things seem to have changed a bit and I can't seem to find a "scripting help" section. If this is the wrong place to post a help request please forgive me. I am delighted to see that the community is still active.
Anyhow, I'm having some troubles with custom fonts. I'm certain that it's the way I'm creating the bitmap font files because if I copy all of the bitmap files from an already existing font it works. Unfortunately, the best guide that I can find on creating custom fonts is so old that the images associated with the thread are long gone.
My custom font folder is: C:\Simba\Fonts\Arial
I've tried a couple of different things to create the bitmap images:
1. Using Microsoft Paint
I created a copy of the capital letter 'A' pixel-by-pixel in paint, black and white, and saved it as 65.bmp within the Arial folder. I then copy+paste all of the other characters from an already existing font and attempt to run the following script:
program customFontTest;
var
bmp, x, y : integer;
begin
loadFont('Arial', False);
bmp := bitmapFromText('X', 'Arial');
if( findBitmapMaskTolerance(bmp, x, y, 20, 20, 400, 400, 5, 5) ) then
writeLn('Success!');
end.This script returns Error: The Points you passed to DrawATPA exceed the bitmap's bounds at line 6
2. Using Adobe Photoshop
Once again I create the character 'A', this time in photoshop, in black and white. I make it a 1-bit image and save it to the Arial folder as 65.bmp. I ran the same script as above and received the same error.
Does anyone have any ideas for what I can do? I'm trying to read fonts in a web browser. Attached is one of the bitmaps I created.
Thank you all,
DooM
Edit: After playing with it for awhile I realized that Simba automatically loads all of the fonts in the Fonts folder upon opening. Restarting Simba stopped this error from occurring. Is there something wrong with the LoadFont function or was I using it incorrectly?