Jonathan,
Post by Jonathan RothwellI've used DOS-like command shells that allow you to change the
text-only-mode raster font. Is it possible to do this within VB/DOS? Or if
not, can you do it in standard DOS mode? <
I found some old code from a friend that shows how to load two fonts, so
hopefully you can cull what you need from this.
--Ethan
======================
'More info on Int 10h Fn 11h can be found in "PC Intern" by Michal Tischer
' **********************************
' DUALFONT.BAS
' **********************************
' Dual font demo for VBDOS
' Written by Steve York
' The following program is an example of how to use 2 fonts simultaneously
' on a VGA (or EGA) monitor.
' This example requires that VBDOS.QLB be loaded to run in the IDE or
' linking with VBDOS.LIB to create an executable.
' To run in the IDE, start with: VBDOS DUALFONT /L VBDOS.QLB
DEFINT A-Z
DECLARE SUB UnloadFont ()
DECLARE SUB LoadFont ()
TYPE RegTypeX
AX AS INTEGER
BX AS INTEGER
CX AS INTEGER
DX AS INTEGER
BP AS INTEGER
SI AS INTEGER
DI AS INTEGER
FLAGS AS INTEGER
DS AS INTEGER
ES AS INTEGER
END TYPE
CLS
LoadFont ' Load the font into memory.
PALETTE 15, 7 ' Set high intensity foreground to regular white
' so they look the same
COLOR 7, 0 ' regular white on black
PRINT "A"; ' character we programmed
COLOR 15, 0 ' high intensity changes to second font...
PRINT "A"; ' same character.
SLEEP ' wait for a keystroke.
UnloadFont ' Set back to normal
PALETTE ' Reset palette to default
SLEEP
SUB LoadFont
DIM InRegs AS RegTypeX
DIM OutRegs AS RegTypeX
DIM Table AS STRING
' First copy the ROM font as a starting point...
InRegs.AX = &H1104 ' Function 11h, sub function 04h, Load ROM 8x16
InRegs.BX = &H1 ' Font #1
CALL InterruptX(&H10, InRegs, OutRegs)
' Put character data into a string so it can be passed...
Table = "ABCDEFGHIJKLMNOP" 'these are the bytes of character data, and
' in this context create a "random" shape
' Program the character...
InRegs.AX = &H1100 ' Function 11h, sub function 00h, Load User Font
InRegs.BX = &H1001 ' 16 bytes/char, font #1
InRegs.CX = &H1 ' # of characters to program
InRegs.DX = 65 ' ASCII code of 1st char to program ('A')
InRegs.BP = SADD(Table) ' Offset of char data
'InRegs.ES = VARSEG(Table) ' Segment of char data -- use this line for QB
InRegs.ES = SSEG(Table) ' use this line for PDS and VB/DOS
CALL InterruptX(&H10, InRegs, OutRegs)
' Set the secondary font...
InRegs.AX = &H1103 ' Function 11h, sub function 03h, Set Display Fonts
InRegs.BX = &H4 ' Set secondary font to #1
CALL InterruptX(&H10, InRegs, OutRegs)
END SUB
SUB UnloadFont
DIM InRegs AS RegTypeX
DIM OutRegs AS RegTypeX
InRegs.AX = &H1103 ' Function 11h, sub function 03h, set display fonts
InRegs.BX = &H0 ' Back to Font #0
CALL InterruptX(&H10, InRegs, OutRegs)
END SUB