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

thanks, Red

i think you are on to something, there
that KB article gives 2 registry keys:
HKLM\Software\Microsoft\WindowsNT\CurrentVersion\Console\TrueTypeFont
HKLM\Software\Microsoft\WindowsNT\CurrentVersion\Fonts


that gives me a starting place  :U

GregL

Redskull is right, any font that meets that criteria can be used for the console font. I am using Consolas for my console font.

I wonder if the raster fonts that are available to use for the console font are the ones from the graphics adapter ROM?  Or, are the fonts in the graphics adapter ROM no longer used at all in 32-bit Windows?


dedndave

been doing a little research
from what i gather, the BIOS bitmap (aka rastor) fonts are emulated in win32
the filename may vary - 8514OEM.fon and VGAOEM.fon look like the candidates
these fonts do not show up in the Control Panel font list, as far as i can tell
but - i can tear into the files a little and see that they have point sizes like other fonts
also, i looked at the list of sizes available in a console window on Dad's machine
the list is indeed different than mine
so - without RE'ing CMD.exe, that remains a bit of a mystery to me
i am going to use a couple sizes for now
then come back to this issue later, after i have the rest of my little app up and running

redskull

dosapp.fon is sticking into my mind as the default raster font.  I don't know why.  It's probably changed since my knowledge was current.  But 'raster fonts' are those with .fon extensions, I don't think they have anything to do with the video card; if you select the 'raster' option in the console properties, mine actually shows it as the 'terminal' font.  Of course, the real question is what happens when you switch to fullscreen?  That uses drivers directly, so who knows.

-r
Strange women, lying in ponds, distributing swords, is no basis for a system of government

GregL

When I select the 'raster' option in the console properties, mine shows it as the 'Terminal' font too.

Keep in mind in Windows Vista and Seven fullscreen console is no longer allowed.

My guess is the fonts on the graphics adapter ROM are no longer used at all in Win32.

FORTRANS

Hi,

QuoteOf course, the real question is what happens when you switch to fullscreen?  That uses drivers directly, so who knows.

   A quick test will show that you have access to the VGA ports
and so can program the various options on a VGA.  Character
width, blinking characters versus bolding the background color,
and loading alternate fonts for instance.  See MichaelW's
example for one example.

http://www.masm32.com/board/index.php?topic=13612.msg106743#msg106743

   I have a program that displays graphics in a full screen
text mode session (that works on half of the machines I
tested) based on code from the Wilton book(1).  That shows
that what Windows allows is implementation dependant on
both software and hardware.  This machine requires full
screen and a MODE 80,25 to set things up.

   On this machine with Windows 2000 and Matrox graphics
use of VESA is not allowed.  With a Windows XP and ATI
graphics (no longer booting) VESA was allowed, but could
crash the system or corrupt video if you accidentally swapped
out of a full screen session.  So it looks like you get direct
control of your video card, to a possibly limited extent.

QuoteMy guess is the fonts on the graphics adapter ROM are no longer used at all in Win32.

   In Win32 proper almost certainly not. In a full screen
CMD/COMMAND session they probably are used.  Though
it may copy them to font RAM areas for a code page
modification.  (?)

   The older versions of Windows may allow direct access to
some parts of the VGA card.

Cheers,

Steve N.

1.   The program is loosely "adapted" from ALPHABLT.C
from "Programmer's Guide to PC Video Systems" by Richard
Wilton.  And his associated image and ASM files.  I don't
have a working DOS C currently and I wanted to see what
would happen.  I'm not sure about the code's copyright
though.  Reporting of success or failure might provide some
answers to the above musings.

dedndave

yes - i read somewhere that full-screen uses the VGA BIOS fonts and console window emulates them
but - i was shooting for enumerating the available X.Y pixel sizes in a GUI app
Alex showed me how to set the text size
when you do, it maps to the closest matching font
you can then fill the structure and see what's what
it really doesn't work for enumerating the "native" sizes, though
because the height and width are set to the values you requested   :P
just as a test, i set the pt size to 100, and it switched to a different font (lucida console or tahoma)

i may be able to find a more informative API function to do a better job of it
i did a quick disassembly of cmd.exe, just to see the list of functions used
i saw no function in the list with "font" in it - lol
of course, cmd.exe may reference the registry (or, perhaps, some file) for values that were found at OS installation

dedndave

#22
enumerated rastor-mode font sizes in a GUI app...



the first column is the height
the second column is the width
the third column is the charset (OEM_CHARSET EQU 255) (font set name=Terminal)

for some reason, it enumerates the first one a second time (one of them may be underlined or something)
other than that, it matches the list in my console window properties font-selection dialog

i made a simple EnumFontFamExProc callback proc that stores the 3 values in a table
then i used EnumFontFamiliesEx with a LOGFONT structure:
lf.lfCharSet = OEM_CHARSET
lf.lfFaceName = "Terminal",0
lf.lfPitchAndFamily = 0

after the function returned, i made the hexidecimal table that you see from the collected values

not bad fer a n00b, eh   :P