## About PNGcustomfont

Most or all of this information is in the manual, but to make it easier to find I've placed it in it's own separate file here as well.

### Dependencies

PNGcustomfont uses the standard FreeBasic library and fbgfx; if you use another graphics library, you're kind of in trouble. I won't say it would be impossible to convert this code to something else, but it would probably be pretty hard.

PNGcustomfont also uses the fbpng library for loading PNGs. This is a great library which every FreeBasic programmer should have, but if you don't have it, don't want it, or don't need it you can remove it entirely simply by #defining NO_PNG. If you do this you won't be able to load PNG fonts, of course. You can get fbpng at http://www.streetcds.co.uk/fbpng_v1_8_4.tar.gz if you don't already have it.

### Screen mode and picture size

The main limitation so far as picture/screen is that you may not load 8-bit fonts in 32-bit mode or vice-versa. I'm not sure why you'd want to do this anyways, but you can't. You could of course change modes to load, but regardless you still won't be able to print the 8-bit font in 32-bit mode or vice-versa. This should be obvious, but if you don't believe me you can try it out yourself, by removing the two lines

>     ScreenInfo(,,cd)
>     If cd <> PrintSFont.cdepth Then Exit Sub

from the PrintFont and PrintUAlphaFont subs, then attempting to print an 8-bit font in 32-bit mode (or vice-versa). Basically, it'll look dumb.

Other than that, I'm not sure there are any limitations so far as screen resolution or image size, except if fbgfx or fbpng imposes any I'm not aware of (check their documentation to be sure). If you load a BMP font you should probably do it in a resolution higher than the width and height of the BMP, since the loader appears to use the screen as a buffer - however you might be able to do without, I haven't really tested this.

### Code and structure

If you bother to look at my code you'll probably be shocked by it's ugliness. That's because I'm not the best programmer in the world, I'm only 16 and still learning, but as far as I'm concerned it's fine so long as it works and doesn't run too slowly. I will note that the interface (that is, all the Subs and Functions you call) is a little bit inconsistent in some areas - some functions take a font as the parameter, others operate on the current font; horizontal spacing is done on a per-font basis, while vertical spacing is done within the context; stuff like that. I could probably go through and fix all that, but I've already been working on this library for some time and I'd like to get back to working on my game engine. I also want to create myself a website, and I also help out a bit with QBasic Express. Therefore, I think I'll leave these inconsistencies. They don't really hinder anyone from doing anything useful, and are for the most part small. If they bother you, you may fix them yourself! The library works, does what it's supposed to and more, so I'm happy.

### Oddities

I haven't really discovered a lot of strange things yet... for the most part the library seems to work pretty much as it should. One odd thing which you should be aware of was mentioned already - that BMPs load on the screen. I don't know why this is but it is. In 32-bit modes I create a buffer and save the screen before loading, then restore it afterwards, so you'll only see a flash (or if you use a work page, you won't see anything at all). In 8-bit modes, for some reason this doesn't work. Therefore, you'll need to figure out how to do this yourself. It shouldn't be too much of a problem, but it is a slight annoyance. I personally don't use 8-bit modes anyways, so I'm not going to go to the trouble to try to fix it (I already wasted some time on it and got nowhere).

Although PNGcustomfont is mainly intended for those who want to be able to load very fancy fonts and use them, the cursor system is designed to be usable without any setup at all. This means that you can use FPrint immediately after entering your graphics mode if you wish. The only downside is that a hack is used to make sure the colour of defaultFont is white (so it will show up on the black background) no matter which colour depth you're using. For more information on this hack, see the manual. If you wish to disable this hack (meaning that you would be unable to use FPrint without some prior setup, but also giving more consistency to the cursor system) you should #define NO_DEFAULT_FONT_HACK. Note that as the name implies, the hack only applies to the defaultFont, the font created by the library by default. It won't affect any of your other fonts.

### Getting Help

If you need help, don't hesitate to ask! My contact information is in the manual, and you could probably ask for help on the forums as well. I would recommend reading through at least the usage section of the manual first, any sections you don't understand, and look at the examples. The tutorial should also make it easier to understand, as it is much shorter and gives examples and demonstrations.