Welcome Guest ( Log In | Register )

HOME FORUMS DISCORD GAMES RPG MAKER SEARCH




Post new topic Reply to topic  [ 8 posts ] 
    poccil
  Sun Jul 27, 2008 7:22 am
Sponsor

Bitmap Fonts

Peter O., July 27, 2008

Introduction

This script supports bitmap-based fonts.   Bitmap fonts are useful for text-based effects that are normally
impossible or slow to achieve using RGSS's text facility alone.   For instance, a bitmap font can depict
red letters with a fancy gold trim.

A bitmap font can be used like any other font, since such fonts are integrated into the project.   A bitmap
font consists of a bitmap (PNG) file with the characters that the font consists of, and a supplementary
text file that details where the characters are located and placed.

Bitmap fonts do not support color or font size changes.

Script

First, put the following script section before the last one in the script editor (normally called "Main").

Expand to see the code.


Defining Bitmap Fonts

After installing the script, you can now define the fonts for the system to use.

The following is an example of how a bitmap font would look:

http://upokecenter.com/projects/myfont.png[/img]

Bitmap fonts must be in PNG format and placed in the Graphics/Pictures/ folder of the project.

And here is an example of how the font's description would look.   The comments in each file
give further detail on the fields used in the description.   Note that the description corresponds
to the bitmap font above.

Expand to see the code.


Descriptions of bitmap fonts must be in TXT format and placed in the Graphics/Pictures/ folder of the project.

Bitmap fonts must be placed in the Graphics/Pictures/ folder of the project, and they must have the
same name except for the file extension. For instance, if the font was placed in
"Graphics/Pictures/MyFont.png" and "Graphics/Pictures/MyFont.txt", you would
use the name "MyFont" to refer to it.

Bitmap fonts override those installed in Windows.   For instance, a bitmap font named "Arial" will
take precedence over the installed font "Arial".

Details on the Font Description

The following picture will graphically demonstrate the meaning
of each field in the font description.  It illustrates a bitmap
font with two characters, an italic "f" and a regular "m".

http://upokecenter.com/projects/bmfont2.png[/img]

Fields A and C specify the starting point and the width of
a character in the bitmap font.  Fields B and D indicate where
the character begins and ends.  Notice that the "f" character
ends much earlier than its shape ends (field D).  This ending
will mark the beginning of the next character in the text. 
Notice also that the "f" character begins much later than its
shape begins (field B).

Notice that the "m" character has only two lines, the beginning
and the end.  This is so because fields A and B have the same
value and D is set to the sum of fields A and C (81 + 78 = 159),
making the presence of D optional in this case. Most unslanted
(non-italic) fonts will have such a configuration.

Notice that fields A, B, and D are specified relative to the
beginning of the bitmap font's image.  For example, fields A
and B for the character "m" are set to 81 pixels from the left
edge of the bitmap font.

Field C specifies the width of each character. (69 pixels for
"f" and 78 pixels for "m". Note that the character "m" is given
a little extra space after the end of its shape, to prevent the
text from appearing too tight.

_________________
Peter O.
Multiple Tilesets Discussion


Last edited by poccil on Mon Jul 28, 2008 5:25 am, edited 1 time in total.

Top Top
Profile      
 

    B1eed
  Sun Jul 27, 2008 12:04 pm
Member

It can be very useful but , do the AMS recognize it , i mean is it compatible with it commands ?


Top Top
Profile      
 

    BlueScope
  Sun Jul 27, 2008 12:22 pm
The Third Man
User avatar



Location: Germany
Reminds me of the way both professional typewriters create their fonts, I do my fonts (I'd dislike adding that to the first ;) ) and major font creating programs work... all you missed really is the 'Export as .ttf' option :p (which'd be totally unnecessary for a game, but yeah)

What can I say, bitmap fonts should be very useful if used correctly... the games running through my mind right now are Duke Nukem 64 (which bitmap font I always faved among all of those), and Banjo Kazooie... especially the shaking and slightly turning left and right letters are something I'm temped to resemble right now, but yeah... before that, I guess I'll work on my own scripts and let you implement this into your script ^^

I didn't test it, and you didn't write the RMversion one's gotta have, but it looks like a multicompatible thing from the quick look I had... excellent stuff either way!

_________________
Image

If you have a slightly positive memory of my Power Shift contest game,
you might be interested in this development screenshot...
More info about that soon!


Top Top
Profile      
 

    Harrybo21
  Sun Jul 27, 2008 8:01 pm
Member

This looks like a great script. Any chance of a demo or just some further instructions? i would really help thanks


Top Top
Profile      
 

    iqbal_0k
  Mon Jul 28, 2008 3:02 am
User avatar
Member


Location: Front of your monitor
Wow a bitmap font, did this script change the whole text or a specific text (i do prefer specific text), this reminds me like Picture damage display on RTAB.

if this script works with specific text, i need an better instruction to create bitmap fonts in specific scene or text.

Thanks for sharing this good script


Top Top
Profile      
 

    Harrybo21
  Mon Jul 28, 2008 11:19 am
Member

Hey guys, i worked out how to use this and i got all my text working except on character... the number 0? no matter what i do it will not display. any idea why?


Top Top
Profile      
 

    Harrybo21
  Mon Jul 28, 2008 11:22 am
Member

lol never mind i worked it out. i had a . insted of a , sorry. If anyone needs further instructions on how to use this post it here and ill tell ya from how i worked it out. great script Poccil


Top Top
Profile      
 

    Mikepjr
  Tue Dec 28, 2010 1:29 pm
Guy who knows less, than he thought he knew.
User avatar
Member


Location: North Carolina USA
Okay... i know this is an old topic, but the images at the top that help explain how to use this script are gone, and i'm trying to understand how this script works.
Is their a demo someplace that i can look at and see exactly how to implement this?
I can sit here and read his explanation until i'm blue in the face, and i still won't get it, i usually do better to look at a demo.. anyone got one?
I mean, i don't even see how the image should be laid out when drawing it in like photoshop or what ever.


Top Top
Profile      
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 


Who is online

Users browsing this forum: No users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

We are an independent, not-for-profit game making community.
Homepage
Board Index
About Us
Downloadable Games
Free Browser Games
Games in Development
RPG Maker Support
Game Maker Support
Construct 2 Support
HBGames the eZine
Advanced RPG Maker
Site Announcements
Powered by phpBB © phpBB Group