News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Graphics Adapter Terminal Fonts

Started by dedndave, December 27, 2010, 03:30:18 PM

Previous topic - Next topic

dedndave

back in the day, i used to be able to find out which terminal mode fonts were available in the installed video adapter, at the current resolution setting
these fonts are in the video adapter ROM
is there a way to do this under win32 ?

MichaelW

I know you can do it from a DOS app running under Windows 2000. With the aid of WinIo, a Windows app running under Windows 2000 can read any location in the first MB of the RM address space (or at least what looks like the first MB of the RM address space). Doing the same thing under Windows XP you can read only the first page, and trying to read anything beyond that will trigger an exception. But even under Windows 2000 you can't get the addresses of the fonts because you can't call Interrupt 10h, function 1130h. I suspect that finding the fonts (reliably) without that function would be more than a little difficult.
eschew obfuscation

dedndave

actually - one of the high-numbered interrupts is a pointer to the table in BIOS
i'd have to search a little or look in Ralf's - as i don't remember
but - that doesn't help if i can't get there - lol

i was hoping there was an API that would simply tell me which sizes are available in the Terminal or OEM "font"
it isn't like most fonts, because the size isn't in "points" - it is X,Y pixels

GregL


dedndave

thanks Greg
from those functions, under See Also, i found GetConsoleFontSize
maybe i can use that to enumerate the list
hopefully, it doesn't have to be a console-mode program - lol

GregL

I assumed your program was Console-mode but that shouldn't matter. Those functions return the size of the font in pixels, X an Y in the CONSOLE_FONT_INFO(EX) structure.  If you want to enumerate the fonts installed on a system there is a way to do that, I have done it before, but I would have to look up how it's done.

dedndave

well - i have played with some of those functions
and, in fact, i have Terminal font text (OEM font) in my GUI app, like i want
this font isn't like the others, though
strange things happen when i change the size - lol
i think i have it figured out - i just need to know what's available on the current system
i dunno if i can GetStdHandle,STD_OUTPUT_HANDLE from a GUI app - never tried it - lol
when i get home, i will try it out

FORTRANS

Hi Dave,

   I checked some DOS and BIOS references and there are
functions and BIOS data to describe the current font, but no
"fonts available" information that I have found.  I think that
it was assumed that if you had a VGA card you have the VGA
fonts.  If you had a EGA card you have the EGA fonts.  If you
have a CGA...  And so forth.  Extra fonts would be manufacturer
specific anyway.

Regards,

Steve N.

dedndave

thanks Steve
yes - now that you mention it, the pointer they placed in the interrupt table
pointed to a table of the current high-end font (chars 128-255)
but, i seem to recall that there was a hard-coded address in BIOS that had the table
by poking around a little, you could get the entire fonts from BIOS ROM, if you wanted them
i don't remember the exact details - and i am trying not to   :lol
i just thought that someone may have run into this before

but - you do bring up a good point
and that is - there is a minimal set that is supported by all VGA's
that is what i need to look for
thanks   :U

FORTRANS

Hi,

   8 by 8, 8 by 14, 8 by 16, 9 by 14, and 9 by 16.  VGA has
all, EGA does not have the 16 high, CGA has only 8 by 8. and
MDA has 9 by 14.

Cheers,

Steve

dedndave

VERY cool
that is just what i needed, Steve
many thanks

i used to have a VGA programming book by Dr. Ray Duncan but, alas, i lent it to someone and never got it back   :'(

dedndave

well - that does help
but - i still have a small problem
these days, most of us run around in higher-than-VGA resolution modes
not all those formats are supported in high res - and others are added
if i open a console window - properties - font tab, i get the exact list that i want to have
thing is - the list is probably different from machine to machine, and for different resolution settings

maybe i will pick a few formats that seem to be in all places, and hope they work - lol
my machine has 5x12, 7x12, 8x12, 10x18, 12x16 and several unwanted ones

what does yours have?

MichaelW

There are several ways of getting the ROM fonts, but reading them directly from the ROM is problematic. In the original design the VGA included three full fonts (8x8, 8x14 and 8x16) and two supplements (9x14 and 9x16), each defined in a separate table. To create the default 16 scan line font, which had a 9x16 character box, you would need to combine the full font with the supplement. A better method is to get the VGA BIOS to load the target font and then read the bit patterns from the area of the display buffer where they are stored. The attachment contains the bit patterns for the default 9x16 font, captured using the above method.
eschew obfuscation

dedndave

thanks Michael
i think that looking at the BIOS is taking the wrong path
this morning, i have some things to take care of   :P
but, in a few hours or so, i should have time to really play
i want to dive into the API's a little deeper - try some console stuff in a GUI app - then see if i missed something else
maybe later today, i will post a little test piece to see how it flies on other machines

redskull

I don't think "console fonts" have anything to do with the fonts supported by the adapter, at least not when you are running in a window.  You can add/remove from this list using the registry.  Basically, any truetype font meeting the criteria can be used as a display font, regardless of the adapter.  Unless I am misunderstanding what you are saying...

http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q247815
Strange women, lying in ponds, distributing swords, is no basis for a system of government