On Sunday, October 26, 2003, at 09:00 AM, Eric wrote:
To bad there wasn't a temporary font editor in RB. What I mean is an
editor in which you could change how the font looks by supplying a
font
pictures or actual text change, however it would only effect your app
not out side of it or RB. It wouldn't really change the text just
more of a "mask" or "cover" of the real fonts. The real fonts would
still be there, just it would be covered by the "mask" if that is
what you wanted.
Thats actually a neat idea. I'd imagine it would be quite a bit of
work. I can see this being written in REALbasic though. Make a module
which accepts the pictures along with a character, use a dictionary
for the map and draw it. You know what, give me just a second and I'll
write that up. It's pretty darn cool idea. I don't know much about
font metrics so we'll see how that part goes.
Ok. I've got a working version but I'm not going to release it yet.
You load a font like this:
LoadPictureFont FontName, CharactersInFont, CharactersPic,
CharactersMasksPic
CharactersInFont is something like: "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
CharactersPic is an image where all of the characters in the font are
laid out in the same order as in CharactersInFont and all characters
have the same width.
And draw it like this:
g.DrawStringWithPictureFont FontName, Text, x, y
Do we need kerning? It seems to be a semi-difficult thing to add for
little benefit. Players are going to be looking at your game, not your
font metrics. I could add proportional character widths, that wouldn't
be difficult at all, but does this suffice for you guys? Seems pretty
reasonable to me. If it was done, you'd also need to specify the widths
of each of individual character (unless they were all the same), or it
could be done by exception, i.e. if all characters but "i" "l" "j" and
"t" are the same width, then you'd simply specify the width of the
characters i, l, j, and t. Less typing. The methods could look like:
LoadPictureFont FontName, CharactersInFont, CharactersPic,
CharactersMasksPic, CharacterWidths()
LoadPictureFont FontName, CharactersInFont, CharactersPic,
CharactersMasksPic, ProportionalCharacters(), ProportionalWidths().
What do you think?
Seth Willits
------------------------------------------------------------------------
---
President and Head Developer of Freak Software - http://www.freaksw.com
REALbasic Guru at ResExcellence - http://www.resexcellence.com/realbasic
Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames
"Not everything that can be counted counts, and not everything that
counts
can be counted."
-- Albert Einstein
------------------------------------------------------------------------
---
- - -
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|