English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   Coders. Blitz Basic (https://eab.abime.net/forumdisplay.php?f=126)
-   -   Topaz font and diskfont.library (https://eab.abime.net/showthread.php?t=112250)

madaxe 26 October 2022 18:44

Topaz font and diskfont.library
 
Hi there;


I'm using the PRINT command to write some text into a Bitmap. The only problem is when I boot from floppy without the WB it always ask for the diskfont.library file.
There is any way to force it to use the default ROM font Topaz and ending the need of having diskfont.library in the floppy?


Thanks.

Daedalus 26 October 2022 22:07

Not with the built-in commands, no. The problem is that Blitz will try to open any libraries needed by any used command libraries, so once you use any command from the Print library, regardless of whether you use a ROM font, or even if the command doesn't use a font, Blitz will try to open it. The ways around it would be either to roll your own font drawing routine, or maybe create shapes for each character you want to use and blit them as needed.

madaxe 27 October 2022 15:04

Thank you for your nice explanation, Daedalus.
In fact, in a more sophisticated program like a game or demo I use the method of creating shapes for each character.
In this case is just a simple control program that reads several values from a port and displays them on the screen.

Daedalus 27 October 2022 15:39

Fair enough. Well unless you were planning on selling the disk, the simplest option is probably to just stick diskfont.library on the disk with the program.

madaxe 27 October 2022 18:44

Yeap, it is just for home use :) No problem to copy diskfont.library to floppy.
The program itself plus diskfont.library leave about 80% of the disk free, lol!
Thanks again and have a nice weekend.

Galahad/FLT 27 October 2022 18:56

I presume you are using an earlier kickstart or later?

madaxe 27 October 2022 20:16

I tested on kickstart 1.2, 1.3, 2.04, 2.05, 3.0 and 3.1 and without diskfont.library placed on floppy the program doesn't work.

E-Penguin 01 November 2022 17:51

There's also the "FNS" font system as part of the Blitz Support Suite (RIFNSLib), I think it has its own print routines. I can't find any documentation on how to use it though

Daedalus 01 November 2022 19:22

Yep, the FNS system is excellent. It's fairly straightforward to use, but slightly more involved as you need to use a custom font format. Luckily, there's an editor included in the demo programs drawer that includes a decent font editor, and working example code. I used it for my Blitz Jam submission and once you get past the custom font data bit it's really nice to use.

Honitos 01 November 2022 22:30

The documentation for this lib is part of the AB3-distribution as a guide file that can be accessed from the IDE by Pressung Shift-help on an instruction or by using the Instruction Browser.

Honitos 02 November 2022 09:08

Quote:

Originally Posted by madaxe (Post 1571536)
I tested on kickstart 1.2, 1.3, 2.04, 2.05, 3.0 and 3.1 and without diskfont.library placed on floppy the program doesn't work.


I checked the fontlib, it always tries to open topaz.font using the diskfonts library function OpenDiskFont(). I could patch this, but problem is, the startup code opens all libraries, that *may* be needed, the patch would not change anything here.


I don't see any problems even if selling a game here. I remember some comercial games that booted to WB and had AmigaOS-components on disk.
Otherwise you could not provide any software that boots to WB - you need at least some DOS-Commands to be part of the disk.

Daedalus 02 November 2022 14:38

This is something that I looked into before, and OS components distributed on commercial releases are supposed to be licenced. In Commodore days, some of the licences were free (e.g. for including the Installer tool with your software), you just needed that permission. But in more recent times I had this issue with Dodgy Rocks, and Cloanto were asking for a $99 licence fee to include diskfont.library and the Assign command from OS 1.3... Hence it was released without being bootable.

In the past, even if Commodore charged a fee, it's likely that commercial publishers, magazines and so on had these licences in place.

Honitos 02 November 2022 22:30

I am shocked. This is really bad.

Photon 18 June 2023 14:13

Do you specify Topaz anywhere in the program or compile settings? If not, Blitz Basic itself forces it. Which hopefully should also let you specify a custom font. And it's not a bad idea to use a nice font when you make a release. :)

FastFonts 2.17 will open Topaz without diskfont.library AFAIK, and this will mean it's in memory according diskfont.library, but this might not prevent Blitz Basic from wanting diskfont.library. Worth a try maybe. Tested on 1.3-3.1, not lower.

If Blitz Basic can use graphics.library functions, then you can OpenFont() instead of OpenDiskFont(), then SetFont, then CloseFont. Also worth a try maybe.

But there would have to be some check in Blitz Basic that prevents it from opening diskfont.library if you already have the font you/it wants.

Daedalus 18 June 2023 21:04

Yeah, diskfont.library is opened by Blitz without any particular font being specified; it's part of the Blitz boilerplate code that's added whenever any text functions are used in the program, so the coder doesn't really have a lot of say in it unfortunately.

Honitos 06 September 2023 10:21

To complete this thread I want to admit that I patched the fontlib:
If the requested font is in ROM - that is "topaz.font" - it uses OpenFont(). Only if requested font is not in ROM, the lib uses OpenDiskFont() from diskfont.library.

So if no other font ist used, diskfont.library is not needed anymore.

This change is part of the release of AmiBlitz3 V3.9.9.

Daedalus 06 September 2023 10:31

Excellent work :D

redblade 06 September 2023 12:52

Quote:

Originally Posted by Daedalus (Post 1572528)
This is something that I looked into before, and OS components distributed on commercial releases are supposed to be licenced. In Commodore days, some of the licences were free (e.g. for including the Installer tool with your software), you just needed that permission. But in more recent times I had this issue with Dodgy Rocks, and Cloanto were asking for a $99 licence fee to include diskfont.library and the Assign command from OS 1.3... Hence it was released without being bootable.

In the past, even if Commodore charged a fee, it's likely that commercial publishers, magazines and so on had these licences in place.

Is the ARP (AmigaDOS Replacement Project) not good enough to use as a 'assign' replacement?

Daedalus 06 September 2023 13:55

Hmmm, I think that must have passed me by. I don't think I tried it - I'll check it out for the next time!

aNdy/AL/COS 26 October 2023 10:16

I'm soon releasing my puzzle game, Spheroid, which is on a booting disk. I've used 'ECHO' in the startup-sequence to print a 'loading' message to an AmigaOS window before the game takes over.

Would including 'ECHO' in my 'c' drawer be subject to possibly similar licensing issues as the 'diskfont.library' as described above? I never really thought about it before...

The game is being distributed for free on itch.io, but there will be a 'donation' type button to cover some costs I incurred in resurrecting my real hardware.


All times are GMT +2. The time now is 18:24.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.05368 seconds with 11 queries