Modifying default graphic character set

General FreeBASIC programming questions.
Post Reply
xlucas
Posts: 334
Joined: May 09, 2014 21:19
Location: Argentina

Modifying default graphic character set

Post by xlucas »

When FreeBasic operates in console mode, characters are output by just issuing bytes in sequence and the system interprets them however it wants, typically as UTF-8 sequences. On the other hand, while in graphics mode, FreeBasic falls back to fixed with 8 bits per character using an encoding I recognise as codepage 437. This is nice because it's what one would find on a classic PC running DOS in the times when QuickBasic was very popular unless the text-mode character set were modified.

FreeBasic actually has two character tables, as far as I know: one for 8x16 character box and another for 8x8 and it selects between them when you use the Width sentence, but both represent codepage 437. Because Print and Draw String are so comfortable and a fixed-width 8bit per character is so convenient unless you need to support a large character set, I'd like to stick to these sentences, but modify the character set so that I can use a different encoding or simply incorporate a few characters of my own without having to implement my own font rendering subs or link 3rd party libraries. Is this possible in a portable way?

Oh... I forgot to add... I know that you can use a user font with Draw String, but this font does not work in the same way as the default font. It has fixed colours. I need something that works just like the one in Draw String.

Thanks, guys!
Post Reply