English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 17 February 2017, 14:03   #1
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
Bitmap font library?

Can anyone recommend a good Blitz Basic bitmap font library? I'm after something with the following features:

- Supports the font graphics being in an IFF
- Supports proportional width with the character dimensions being in a data file (height would be a bonus but not totally necessary)


I'm currently using FNS, which would be fine other than we need to support fonts with multiple colors.

Thanks in advance.
earok is offline  
Old 17 February 2017, 19:05   #2
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
I was just going to recommend FNS.

The only font libraries supported by Blitz are the built-in one, OS calls and FNS. When using a custom colour font, I've just made it into a series of shapes and used the chr$ of the string as an offset into the shapes table.
idrougge is offline  
Old 21 February 2017, 04:48   #3
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
Cheers, I'll whip something up along those lines.
earok is offline  
Old 06 September 2017, 14:03   #4
MickGyver
Registered User
 
MickGyver's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 643
Old thread I know but FNS looks interesting. Is it possible to create your own fonts for that library and does anybody have an example how to use the library?

Last edited by MickGyver; 06 September 2017 at 21:13.
MickGyver is offline  
Old 06 September 2017, 17:57   #5
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
Check BUM 09. It contains both example code and an editor for FNS fonts.
idrougge is offline  
Old 06 September 2017, 21:07   #6
MickGyver
Registered User
 
MickGyver's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 643
Quote:
Originally Posted by idrougge View Post
Check BUM 09. It contains both example code and an editor for FNS fonts.
Thanks! The editor is actually quite convenient to use, didn't take long to convert a font I'm using for a PC game.
MickGyver is offline  
Old 15 January 2021, 15:29   #7
Amiga1992
Registered User
 
Join Date: May 2001
Location: ?
Posts: 19,645
Quote:
Originally Posted by idrougge View Post
When using a custom colour font, I've just made it into a series of shapes and used the chr$ of the string as an offset into the shapes table.
Is there a place where I can find a table of chr$ values?
Amiga1992 is offline  
Old 15 January 2021, 16:14   #8
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,893
Quote:
Originally Posted by idrougge View Post
Check BUM 09. It contains both example code and an editor for FNS fonts.
Wish I'd known this as I wanted to make an Invader font for my Space Invaders and even went as far as making one in an font maker (can't remember which one) but I'd obviously done something wrong and went down the shapes route.

Using shapes is possibly the most flexible option but you have sort out your own routine for printing to the screen.

You can of course use sprites - I did in my Flappy Bird game - and this has the added advantage of being able to print freely over scrolling backgrounds or moving objects.

I have yet to find a multiplexer in Blitz that works as well as I would like but Earok has one he wrote so maybe that will do what he wants?

I think in theory, if you multiplex sprites you can have a status bar/score/text out of sprites and still have sprites for your game but not sure the Amiga hardware is really up to this as not many games do it (or maybe it's just too complicated)?
Havie is offline  
Old 15 January 2021, 16:16   #9
Amiga1992
Registered User
 
Join Date: May 2001
Location: ?
Posts: 19,645
Quote:
Originally Posted by Akira View Post
Is there a place where I can find a table of chr$ values?
More importantly, where do i find this FNS library?
Amiga1992 is offline  
Old 15 January 2021, 20:22   #10
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,893
Quote:
Originally Posted by Akira View Post
Is there a place where I can find a table of chr$ values?
Do you mean ascii codes? Just type ascii into Google.
Havie is offline  
Old 16 January 2021, 18:10   #11
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
Quote:
Originally Posted by Akira View Post
Is there a place where I can find a table of chr$ values?
Sorry, that should have been Asc() values. Just use Asc(Mid$(your_text$,offset,1)) to get the ASCII value of a letter in your text and use that as the Shape number, optionally offsetting it to some other base number using subtraction.

Quote:
Originally Posted by Akira View Post
More importantly, where do i find this FNS library?
It’s preinstalled if you use Ultimate Blitz CD, otherwise it’s on one of the BUMs.
idrougge is offline  
Old 18 March 2021, 16:07   #12
Amiga1992
Registered User
 
Join Date: May 2001
Location: ?
Posts: 19,645
Quote:
Originally Posted by idrougge View Post
It’s preinstalled if you use Ultimate Blitz CD, otherwise it’s on one of the BUMs.
Well that took A WHILE to find, really tired of the organizational mess that is Blitz.

Now the problem is: how do you convert an IFF file to FNS? Or am I missing something here? I do not want to have to edit all fonts one by one again, I have them as bitmaps.
Amiga1992 is offline  
Old 19 March 2021, 10:37   #13
carrion
Registered User
 
carrion's Avatar
 
Join Date: Dec 2016
Location: Warsaw area
Posts: 152
I don't know what Fns is but in my project I just implemented it myself. It's really not that hard as it seams. I just copied letters as shapes.
I use normal strings like

mytxt$="abcdefghi"

and then access the letters in the loop and bit them on the screen:

i=0
letter.b = peek.b(&mytxt$+i)
block base+letter,......

it works well and I have full control over it and no mess with additional libs
carrion is offline  
Old 23 March 2021, 17:33   #14
Amiga1992
Registered User
 
Join Date: May 2001
Location: ?
Posts: 19,645
I went and made a parser myself too, similar to what idrougge did. Now I can even have color fonts.

Seriously, I find myself, most times, just making my own shit instead of using what comes with Blitz. Kinda lame
Amiga1992 is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bitmap... "shaking" when blitting shapes on it - Also problems with Display Library Shatterhand Coders. Blitz Basic 18 20 June 2016 19:26
Looking to convert bitmap - amiga font leathered request.Apps 2 02 May 2014 01:11
HELP: Opus5, KingCON, SysInfo.library (Sysmon.library) triangle Michael support.Apps 6 10 March 2014 14:08
Bitmap Font File Structure ant512 Coders. General 7 20 October 2007 08:33
Making a shared library from a gcc .a library JoJo Coders. General 1 10 March 2003 19:06

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 22:31.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.10261 seconds with 15 queries