Outputting something other than the default graphics font

New to FreeBASIC? Post your questions here.
olympic sleeper
Posts: 41
Joined: Jun 07, 2020 15:47

Outputting something other than the default graphics font

Postby olympic sleeper » Aug 10, 2020 21:27

Hello,

While writing my text adventure I have put together a simple editor to allow me to build a large enough map to make it possible to test npc movement (once I have written that bit - my initial ideas on this are in the project thread). However as I did so I got somewhat frustrated with the default graphic font. Yes its monospaced which makes things a lot easier when you are throwing something together, but it does not look very nice.

Looking through these forums and elsewhere there are a lot of useful threads on using other fonts, but they appear to require a specific API (eg GTK+) or the windows headers, sorry if I have missed something obvious here. Being a bit lazy I don't really want to spend a lot of time learning a complete API to put some nice text on a screen, but equally would like to keep the code as OS independent as possible.

I confess that I got a bit lost in the threads here as I searched so have almost certainly missed some things. I did find this thread - viewtopic.php?f=14&t=25083 which looks perfect for what I need.
However I've not used libraries in fb before.

  • It is simply a case of copying the FBTrueType.bi from the zip to the same place as my code and adding #include once "FBTrueType.bi", or do I need the lib directory as well?
  • Does anyone know if the fonts included in the zips open source/GNU/CC?

Any other suggestions/tips?

Thanks in advance.

<edit>ideas on npcs are now in the project thread</edit>
Last edited by olympic sleeper on Aug 10, 2020 23:01, edited 2 times in total.
badidea
Posts: 2139
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: Outputting something other than the default graphics font

Postby badidea » Aug 10, 2020 21:44

olympic sleeper wrote:Any other suggestions/tips?

* ttf examples on 64-bit systems?
* My issues about freebasic

For games I have used bitmaps containing characters sets with mostly my own code.

olympic sleeper wrote:It is simply a case of copying the FBTrueType.bi from the zip to the same place as my code and adding #include once "FBTrueType.bi", or do I need the lib directory as well?

The lib directory contains the actual (compiled) code, you do need that. The libs are included from within the .bi file (#inclib ...). So a include .bi might[1] be sufficient.
[1] In practice, it is often more complicated. Try a see what happens...

Return to “Beginners”

Who is online

Users browsing this forum: No registered users and 4 guests