Hi,
I have an application I am porting to my OS that uses the ansi code \e[11m to switch to an alternate font and then \e[10m to switch back.
The application expects that this character (which is 'q' in the ordinary font - ie 0x71) in this alternate font is a horizontal line (similar to the lines in the IBM extended characters)
How do I enable and disable this font? I am using the text mode where i put characters at 0xb8000.
Thanks,
Andrew
ANSI alternate font..
- spix
- Member
- Posts: 128
- Joined: Mon Jun 26, 2006 8:41 am
- Location: Millicent, South Australia
- Contact:
Thanks for the links, they were helpful.
I'm not sure I understand it though,
This is my thinking,
To display a character in an alternate font, i need to outport to the correct register that when bit 3 of the attribute byte is set, it is meant to display font set B which is located at the address pointed according to this table:
Do I need to create a font and load it into those addresses or is there already a font in there?
this is the code i am attempting, it's wrong, but i haven't worked it out yet:
it doesn't seem to change anything, just prints bold characters.
I'm not sure I understand it though,
This is my thinking,
To display a character in an alternate font, i need to outport to the correct register that when bit 3 of the attribute byte is set, it is meant to display font set B which is located at the address pointed according to this table:
Code: Select all
* 000b -- Select font residing at 0000h - 1FFFh
* 001b -- Select font residing at 4000h - 5FFFh
* 010b -- Select font residing at 8000h - 9FFFh
* 011b -- Select font residing at C000h - DFFFh
* 100b -- Select font residing at 2000h - 3FFFh
* 101b -- Select font residing at 6000h - 7FFFh
* 110b -- Select font residing at A000h - BFFFh
this is the code i am attempting, it's wrong, but i haven't worked it out yet:
Code: Select all
// to change font
outportw(0x3c4, 0x304);
// to restore font
outportw(0x3c4, 0x300);
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Assume only the first font is there. Some programs might have loaded another font but thats hardware/software dependent.spix wrote:Do I need to create a font and load it into those addresses or is there already a font in there?
You reversed the byte order: word outputting 0x0304 will send value 0x03 to register 4 instead of value 4 to register 3spix wrote: this is the code i am attempting, it's wrong, but i haven't worked it out yet:
it doesn't seem to change anything, just prints bold characters.Code: Select all
// to change font outportw(0x3c4, 0x304); // to restore font outportw(0x3c4, 0x300);