Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,561 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 4
Page 1 of 3 1 2 3
variable width bitmap font renderer - free (A6/A7) #152374
09/07/07 10:34
09/07/07 10:34
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904


A6 and A7 supports TrueType fonts as well as the good old bitmap based fixed width fonts. Bitmap fonts are faster and more customizable (because they are actually editable bitmaps), but they are not as looking good as TrueType fonts. To overcome this, I have written a library of functions which renders strings on a basis of bitmap fonts, but with a variable width for each letter.

text rendered with a fixed width bitmap font:



text rendered with a variable width bitmap font:



features:

  • Renders strings as bitmaps -> usable with panels, sprites and entity skins
  • Multiline strings are supported (seperated with \n)
  • Left, right and center alignment
  • auto-allocation of bigger canvas bitmaps if a already existing bitmap canvas is too small to fit the new string rendering
  • convenience functions for panel usage
  • Memory is only consumpted for letters which have any alpha information in their letter region in the font file: if you put no alpha for a letter, it isn't allocated (memory friendly)
  • Font creation is easier than making a native font definition!
  • Usable under A6 and A7 if you use it in a C-Script project


and the best of all: it's free!

You'll find the download on my page. The package contains a manual (as PDF file) with some examples and everything explained and a compiled demo with open source WDL, which explains very very easily how to integrate it and use it.

Please visit: http://www.christian-behrenberg.de

Thank you very much and have fun!
Cheers - Christian

Re: variable width bitmap font renderer - free (A6/A7) [Re: HeelX] #152375
09/07/07 12:38
09/07/07 12:38
Joined: Nov 2003
Posts: 1,659
San Francisco
JetpackMonkey Offline
Serious User
JetpackMonkey  Offline
Serious User

Joined: Nov 2003
Posts: 1,659
San Francisco


Thanks Christian!

Re: variable width bitmap font renderer - free (A6 [Re: JetpackMonkey] #152376
09/07/07 13:11
09/07/07 13:11
Joined: Jul 2004
Posts: 4,206
Innsbruck, Austria
sPlKe Offline
Expert
sPlKe  Offline
Expert

Joined: Jul 2004
Posts: 4,206
Innsbruck, Austria
that is very CONTEXT SENSITIVE

Re: variable width bitmap font renderer - free (A6 [Re: sPlKe] #152377
09/07/07 13:49
09/07/07 13:49

A
Anonymous
Unregistered
Anonymous
Unregistered
A



thx

Re: variable width bitmap font renderer - free (A6 [Re: ] #152378
09/07/07 15:36
09/07/07 15:36
Joined: Apr 2004
Posts: 516
USA
Trooper119 Offline
User
Trooper119  Offline
User

Joined: Apr 2004
Posts: 516
USA
Very cool, thanks bud.

I'd suggest directly linking the file to this post:
Text Minipulator

Last edited by Trooper119; 09/07/07 15:43.

A clever person solves a problem.
A wise person avoids it.
--Einstein

Currently Codeing: Free Lite-C
Re: variable width bitmap font renderer - free (A6 [Re: Trooper119] #152379
09/08/07 10:29
09/08/07 10:29
Joined: Jan 2007
Posts: 221
F
Fenriswolf Offline
Member
Fenriswolf  Offline
Member
F

Joined: Jan 2007
Posts: 221
Thank you, HeelX!
This renderer might become very useful for easily displaying a non pre-installed TrueType font on every system.

Re: variable width bitmap font renderer - free (A6 [Re: Fenriswolf] #152380
09/08/07 11:10
09/08/07 11:10
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Quote:

(...)useful for easily displaying a non pre-installed TrueType font on every system.




That was my intention thank you. Plus, your font is wrs enabled.

Re: variable width bitmap font renderer - free (A6 [Re: HeelX] #152381
10/13/07 11:25
10/13/07 11:25
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline
User
demiGod  Offline
User

Joined: Mar 2006
Posts: 752
Portugal
hey Christian,

very nice tool, thanks for the contribution, but i have two questions regarding fontRender, because i am trying to implement it in the xtreme paintball project:

1 - is there some problem with _align ? I have a panel and render the font this way:

Code:

RF_setFontRenderSettings(RF_CONSTANTS_CENTER, 0);
RF_pnlRenderString(infos, paintballFont, str_eliminatedPlayer);



but for some reason its not aligning correct in the panel center as you can see in the image below "slayer eliminated";


2 - Isnt possible to use inkey() ?



Thanks,
Jorge

Re: variable width bitmap font renderer - free (A6 [Re: demiGod] #152382
10/13/07 16:47
10/13/07 16:47
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
Always welcome such tools
Nice one HeelX !!

Cheers

Frazzle


Antec® Case
Intel® X58 Chipset
Intel® i7 975 Quad Core
8 GB RAM DDR3
SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
NVIDIA® GeForce GTX 295 Memory 1795GB
Re: variable width bitmap font renderer - free (A6 [Re: frazzle] #152383
10/13/07 19:37
10/13/07 19:37
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
DemiGod,

I cannot see any reason for an error: if you set the align-mode to center, the string is centered in the bitmap. That means: if you do not center the panel, the string won't be centred. The align flags is calculated on the basis of the target bitmap size. If the bitmap is LARGER than the actual rendered string width, the align values is evaluated.

Maybe you can post some code?

Page 1 of 3 1 2 3

Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1