I was just looking at some fonts and was thinkign it would be awesome if I could somehow have multiple fonts in a text mode even if it didn't really have any use
what I was thinking was that if somehow you changed fonts while it was drawing onto the screen but i'm quite sure there would be no way to specify x and y.
multiple fonts in text mode-is it possible
Re:multiple fonts in text mode-is it possible
I'm not sure if you could do it by changing the fonts in the middle of a refresh (and that would probably be harder than just going into graphics mode and drawing the text yourself), but there are 256 possible characters for the screen. There's no need for the 256 characters to use the normal ASCII code.
For example, you could load glyphs for 'a' to 'z' in one font as characters [0..26), and glyphs for 'a' to 'z' in the other font as characters [26..52). Then you will be able to use either font by choosing the right character code (0 for 'a' in font 1, 26 for 'a' in font 2, for example).
I suppose you could have your screen/console driver do the translating of ASCII codes to your character codes too, something like
if (using_font_1)
font_offset = 0;
else
font_offset = 26;
if ('a' <= character && character <= 'z')
translated_character = character - 'a' + font_offset
so that new text would appear in the right font.
EDIT: typo.
For example, you could load glyphs for 'a' to 'z' in one font as characters [0..26), and glyphs for 'a' to 'z' in the other font as characters [26..52). Then you will be able to use either font by choosing the right character code (0 for 'a' in font 1, 26 for 'a' in font 2, for example).
I suppose you could have your screen/console driver do the translating of ASCII codes to your character codes too, something like
if (using_font_1)
font_offset = 0;
else
font_offset = 26;
if ('a' <= character && character <= 'z')
translated_character = character - 'a' + font_offset
so that new text would appear in the right font.
EDIT: typo.
Re:multiple fonts in text mode-is it possible
hmmm yea probably should go with graphics
very smart idea with the different fonts in 1 character set though
very smart idea with the different fonts in 1 character set though
Re:multiple fonts in text mode-is it possible
http://www.acid.org/info/xbin/x_tut.htm
may help. not tested.
EDIT : and again, http://my.execpc.com/~geezer/osd/graphics/modes.c shows how to do that cleanly.
may help. not tested.
EDIT : and again, http://my.execpc.com/~geezer/osd/graphics/modes.c shows how to do that cleanly.
Re:multiple fonts in text mode-is it possible
I didn't know that was possible!Setting the VGA in 512 Character mode.
I gotz an idea on maybe how to display small icons and such and for more advanced stuff(am I the only person facinated with text art and want for my OS to have an optional text based gui)
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:multiple fonts in text mode-is it possible
there are several programs using such tricks, including "sourcer" (the famous BIOS disassembler) and "Impulse Tracker" (music editor for demosceners and gamemakers).
The main drawback with text-and-modified characters is that you are restricted to monochrom graphic (or at least per-character coloured stuff) and that you're better to opt for a video mode where there's no such thing like a "extra pixel column" between characters ...
Besides, modern laptop and TFT screens typically screw up the text display (at best )
The main drawback with text-and-modified characters is that you are restricted to monochrom graphic (or at least per-character coloured stuff) and that you're better to opt for a video mode where there's no such thing like a "extra pixel column" between characters ...
Besides, modern laptop and TFT screens typically screw up the text display (at best )
Re:multiple fonts in text mode-is it possible
Here's away you could hack what you want to do, when using ASCII fonts, half are not used, you could rewrite these with differant fonts, them use these fonts instead of normal fonts, then by add a set number eg: 128 + ascii code you would get what you want.
Here is a simple demo, to do this
Here is a simple demo, to do this
Re:multiple fonts in text mode-is it possible
I had that idea but I use some of the line drawing chars in the higher parts
Re:multiple fonts in text mode-is it possible
here is a small helper program i had quick-coded to make a Devanagari font for text modes.
it is compiled in TurboC and runs in DOS. :-[ but it works.
it is compiled in TurboC and runs in DOS. :-[ but it works.