gfxgfxFreeBASIC Games Directory Forumgfxgfx
gfx gfx
gfx
Welcome, Guest. Please login or register. May 20, 2013, 07:56:20 AM

Login with username, password and session length
11.5.2013 - Added a webpage for the latest FBGD competition.

13.3.2013 - Members registrations temporary disabled. For all membership requests, please email me: lachie13@yahoo.com

30.11.2012 - The ninth issue of BASIC Gaming is out! Read it here: http://games.freebasic.net/forum/index.php?topic=560.0

22.11.2012 - Be sure to check our currently running annual FBGD game making competition. This year's theme is SEASONS OF THE YEAR, 300 $ first place prize, and the competition runs till 18th of February. Link: http://games.freebasic.net/forum/index.php?topic=559.0
gfx
gfx
*
gfxgfx
gfxgfx gfxgfx
gfxgfx Home Help Search Login Register   gfxgfx
gfx gfx
gfx
Poll
Question: Did you like this abfont lib?
Good work! I love it! - 4 (80%)
How the font-format like? - 1 (20%)
Keep it up! - 0 (0%)
Just nice... nothing else. - 0 (0%)
Bad! It was garbage! - 0 (0%)
Total Voters: 4

Pages: 1 [2] 3
Print
Author Topic: Smooth font render in graphic screen mode (no OpenGL! no DX!)  (Read 5600 times)
hd_
Recruit
**
Posts: 35


View Profile
« Reply #15 on: July 03, 2008, 04:37:03 PM »

He is busy too. Geez, don't pressure the guy- he offers a service for free, but being abused isn't one of them.
Logged
Leonheart
Novice
***
Posts: 54


tenchu_shinobi_taizen
View Profile WWW
« Reply #16 on: July 03, 2008, 07:26:50 PM »

OK Kris, the source code is send to ur email. And now, Is became the public code under GNU. Wink
Logged

Even just one flap of butterfly can make storm in the world.
KristopherWindsor
Forum Sage
*****
Gender: Male
Posts: 363


The Thirsty Smiley


View Profile WWW Email
« Reply #17 on: July 03, 2008, 07:50:42 PM »

Thanks. Smiley
It's 800 lines of code, so I should be able to rewrite it today. :--]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
Tongue

EDIT: check your email; I have questions. Wink
« Last Edit: July 03, 2008, 08:36:45 PM by KristopherWindsor » Logged

Leonheart
Novice
***
Posts: 54


tenchu_shinobi_taizen
View Profile WWW
« Reply #18 on: July 03, 2008, 08:57:01 PM »

That ur answer, check your email.
I try online on YIM all this day, you can ask anything there.
« Last Edit: July 03, 2008, 09:21:32 PM by Leonheart » Logged

Even just one flap of butterfly can make storm in the world.
KristopherWindsor
Forum Sage
*****
Gender: Male
Posts: 363


The Thirsty Smiley


View Profile WWW Email
« Reply #19 on: July 03, 2008, 10:08:52 PM »

Do you have IRC chat? I see you haven't been to freenode's ##freebasic channel. Wink
Logged

Leonheart
Novice
***
Posts: 54


tenchu_shinobi_taizen
View Profile WWW
« Reply #20 on: July 03, 2008, 10:34:37 PM »

I can't figure how to register on it Sad
Logged

Even just one flap of butterfly can make storm in the world.
KristopherWindsor
Forum Sage
*****
Gender: Male
Posts: 363


The Thirsty Smiley


View Profile WWW Email
« Reply #21 on: July 03, 2008, 10:57:47 PM »

I can't figure how to register on it Sad

You don't need to register.
After you connect to freenode, just type:
/join ##freebasic
Wink
Logged

Leonheart
Novice
***
Posts: 54


tenchu_shinobi_taizen
View Profile WWW
« Reply #22 on: July 03, 2008, 11:27:41 PM »

OK, I try to make it work on pidgin then Huh
Logged

Even just one flap of butterfly can make storm in the world.
KristopherWindsor
Forum Sage
*****
Gender: Male
Posts: 363


The Thirsty Smiley


View Profile WWW Email
« Reply #23 on: July 05, 2008, 01:32:28 AM »

I've got the lib working with my suggestions.
I'll make some final touch-ups and email soon (probably tomorrow). Cheesy
BTW, adding support for drawing to images was that easy.  Cool Cool Cool
Logged

Leonheart
Novice
***
Posts: 54


tenchu_shinobi_taizen
View Profile WWW
« Reply #24 on: July 05, 2008, 01:44:44 AM »

OK,
Logged

Even just one flap of butterfly can make storm in the world.
KristopherWindsor
Forum Sage
*****
Gender: Male
Posts: 363


The Thirsty Smiley


View Profile WWW Email
« Reply #25 on: July 05, 2008, 04:05:13 PM »

Here's a fully working example with my version of the lib:
#Include Once "abfont.bas"
Dim Shared As abfont.alpha_font font
Screenres 640, 480, 32
Screenlock()
  font.draw(, 10, 10, "OOP XD... BBQ", &HFFFFFFFF)
Screenunlock()
Sleep

I made a lot changes beside OOP and support for drawing to images; I removed a fair amount of code, but the only functionality I removed was support for less than true color screen modes.

I made one bug fix here, for clipping the background color:
    m=GetTextWidth(ALPHA_ACTIVE_FONT, s)
    'note: this line added by Kristopher Windsor
    If x + m >= ALPHA_SCREEN_WIDTH Then m = ALPHA_SCREEN_WIDTH - x - 1

I also changed the error handling.
Now instead of a function returning a 0, 1, or 2 to report an error, it will just return true / false.
If you want to know the specific error, you can use the errorcheck() function:
If font.loadfont("myfont.abf", 2) then print font.errorcheck()

Some other changes include:
- Use of namespaces, overloaded functions, and a BI file for the BAS file
- There are now only 32 slots per font object, not 256. With 256 font slots, each font object was using > 1MB of memory.
- If you try to load a font into a slot where a font is already loaded, you will get an error.
- One or two subs were changed to functions which return error values; also there is more error checking with the font(slot).loaded flag.
- The screen size, current font, and font colors are not saved in the object; you have to specify them with each function call.
- I took the "revision" parameter out of GetAlphaBitmapFontLibVer() because I don't know what that is for. Tongue
- Functions that return error codes now return integers, not ubytes. (I think all parameters should be integer or string, but I won't bother to change any more.)
- I removed some functions that were only ~7 lines or less, IE the function to load the standard font (that is done directly by the constructor now).
- I removed a function to reload the standard font since it was never used
- All 5 examples updated to work with the new version
- More changes I forgot Tongue

I'll email the code to Leonheart now and hopefully he will let me post my version here.
The library is really nice now, weighing at only 470 (code) + 100 (header) lines, with OOP features, without the bloat of the features planned for future versions, such as scaling, rotation, compressed file formats, and then some. Cheesy
Logged

KristopherWindsor
Forum Sage
*****
Gender: Male
Posts: 363


The Thirsty Smiley


View Profile WWW Email
« Reply #26 on: July 05, 2008, 11:12:04 PM »

Here's a screenshot of my menu with the font library:

Cheesy Cheesy Cheesy

I am using a different font size for each screen size, so I won't need to scale the text (with multiput()) after all. Wink
This way, the fonts will never be pixelated or hard to read.
I really like the font smoothing. Cool Cool Cool Cool Cool Cool Cool Cool Cool Cool Cool Cool
Logged

Lachie Dazdarian
Double dipper
Administrator
Forum Sage
*****
Gender: Male
Posts: 1195


lachie13
View Profile WWW Email
« Reply #27 on: July 06, 2008, 06:32:25 AM »

Can I expect an OpenGL implementation?
Logged

"Things like Basic and Free Basic provide much-needed therapy and a return to sanity and a correct appreciation of people. The arrogant folk really hate a word like 'Basic' - fine, and good riddance." ~ pragmatist
KristopherWindsor
Forum Sage
*****
Gender: Male
Posts: 363


The Thirsty Smiley


View Profile WWW Email
« Reply #28 on: July 06, 2008, 02:03:16 PM »

Can I expect an OpenGL implementation?

For this font lib? Did you read the topic title? Tongue
But I do need some way to do that when I make my game work with OpenGL.
I might end up just drawing to an FBGFX buffer, than converting that to a texture; I'm not sure yet. Wink
Logged

Leonheart
Novice
***
Posts: 54


tenchu_shinobi_taizen
View Profile WWW
« Reply #29 on: July 06, 2008, 08:55:29 PM »

The screenshot is cool!

Remember, the code is now Public Release. You can contribute whatever you like. Yes, maybe another contributor will make version for OGL.

Where I must put the code? Since my site will updated about next month. @Kris, maybe you can put it for a while on your site. (While I make the X-Font).
Logged

Even just one flap of butterfly can make storm in the world.
Pages: 1 [2] 3
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
Cerberus design by Bloc
Valid XHTML 1.0! Valid CSS!
gfx
gfxgfx gfxgfx