FBA The Creator
http://www.fbacreator.com/fbaforum/

DrawGfxText enhancement
http://www.fbacreator.com/fbaforum/viewtopic.php?f=3&t=77
Page 1 of 2

Author:  Boiled Sweets [ Wed Jul 02, 2008 11:13 am ]
Post subject:  DrawGfxText enhancement

Hi,

my gfxfont is like this...

Image

I would like to draw this *without* specifying the RGB values, can this be added to FBA? Yes I could load as a image and draw part of the image but working out which bit to draw is painful.

Would be nice to use the GFX Font capability...

Is it possible? TA!

Author:  evilmaio [ Wed Jul 02, 2008 12:49 pm ]
Post subject:  Re: DrawGfxText enhancement

It's pretty easy to accomplish this through drawimage functions;
btw..i'll consider this for next releases...

Author:  Boiled Sweets [ Wed Jul 02, 2008 12:57 pm ]
Post subject:  Re: DrawGfxText enhancement

well not too easy cos imagine a font gfx of 26+ characters all different widths, you have to have a table of each! Would be much nicer if the gfx fonts routines could do it as it currently works out the width from the masking line just needs to not colorize the image.

Any chance on this feature soon :roll: ;)

Author:  evilmaio [ Wed Jul 02, 2008 2:45 pm ]
Post subject:  Re: DrawGfxText enhancement

Mh yes, you're right..this would be really useful..
i hope to put it in next release, so ..very soon...
It would be very useful for me to have a gfx font in FBA format (with blank delimiters) ready to use in order to put it with a new fonts tutorial...
Can you provide me one of yours (copyright free of course :twisted: )?
This will help me to save lot of time to find/create a new one!
Of course i'll put your name in the tutorial comments :D
Thanks!

Author:  phrebh [ Wed Jul 02, 2008 3:20 pm ]
Post subject:  Re: DrawGfxText enhancement

You can use this one. It's not as cool as BoiledSweets', but it's complete.

Attachments:
arial12bold.png
arial12bold.png [ 2.71 KiB | Viewed 24439 times ]

Author:  phrebh [ Wed Jul 02, 2008 3:22 pm ]
Post subject:  Re: DrawGfxText enhancement

Here's the code for using it so you don't have to type in again.
Code:
-- fonts
FONTSTRING = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`~!@#$%^&*()-_=+[{]}\\|'\";:/?.>,<"
FONTARIAL12BOLD = loadgfxfont(IMGARIAL12BOLD, FONTSTRING, 2)

Author:  Boiled Sweets [ Wed Jul 02, 2008 3:31 pm ]
Post subject:  Re: DrawGfxText enhancement

Hi,

how about this (it's just the numbers but should a good enough for the example)

Image

Feel free to use as is, is copyright free because I just created it

Author:  evilmaio [ Wed Jul 02, 2008 8:59 pm ]
Post subject:  Re: DrawGfxText enhancement

Many thanks guys!

I just uploaded a new version (0.2.0.115). Give it a try and let me know!!

Thanks!

Author:  Boiled Sweets [ Wed Jul 02, 2008 9:10 pm ]
Post subject:  Re: DrawGfxText enhancement

COOL!!!

many thanks...works treat and is a super cool feature

Author:  Boiled Sweets [ Fri Jul 04, 2008 10:12 am ]
Post subject:  Re: DrawGfxText enhancement

The drawgfxfont routine doesn't seem to haandle the "space" character, i.e. doesn't draw one. If I stick a space character in the font and include in the mask when loading the font it still doesn't work, try this font

    Tahoma 12pt bold
    Image
    Code:
       local tahoma12_font_image = loadimage("font_tahoma12.jpg")
       tahoma12_font = loadgfxfont(tahoma12_font_image, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!\"£$%^&*()_+=-[]#~'@;:?.>,<1234567890", 1)


    This one doesn't have the space char but even if I add one it doesn't work - try drawing "Hello There!" - there is no space...

    Page 1 of 2 All times are UTC
    Powered by phpBB® Forum Software © phpBB Limited
    https://www.phpbb.com/