'=========================================================================== ' Subject: CHANGE FONT IMAGE SIZE Date: 01-09-97 (16:15) ' Author: Thomas Matysik Code: QB, QBasic, PDS ' Origin: Check TEXT.ABC for BIGHIYA.BAS Packet: GRAPHICS.ABC '=========================================================================== 'After seeing the BIGHIYA.BAS program that Denis Boyles posted, I 'thought that it should be quite easy to change the program so that it 'would display text in different sizes anywhere on the graphics screen. 'This program will print text in any size that is a multiple of 8, with 'different possible sizes for x and y, in several different styles, and 'in any colour. '* TEXT.BAS *` '* by Thomas Matysik *` '* Released to Public Domain Jan 9, 1997 *` 'X version 1.0 X ' This program uses the BIOS's CGA ROM font to print out characters any ' size which is a multiple of 8 pixels, anywhere on the graphics screen. ' Based on Denis Boyles BIGHIYA.BAS program. DECLARE SUB PrintText (text$, x1%, y1%, horzsize%, vertsize%, Style%, colr%) SCREEN 12 CLS PrintText "Hello,world! style 0", 0, 0, 4, 4, 0, 9 PrintText "Hello,world! style 1", 0, 32, 4, 4, 1, 10 PrintText "Hello,world! style 2", 0, 64, 4, 4, 2, 11 PrintText "Hello,world! style 3", 0, 96, 4, 4, 3, 12 PrintText "Hello,world! style 4", 0, 128, 4, 4, 4, 14 DEFINT A-Z ' This routine prints the BIOS's CGA font on the screen in any size that ' is a multiple of 8, in any one of several different styles. The ' available styles are: ' ' 0 = normal solid font ' 1 = hollow squares for pixels ' 2 = diagonal lines (top left to bottom right) for pixels ' 3 = diagonal lines (top right to bottom left) for pixels ' 4 = single pixels, with big spaces between them if the font is big ' ' If you want to add more styles, put them in the SELECT CASE block. ' ' SUB PrintText (text$, x1%, y1%, horzsize%, vertsize%, Style%, colr%) DEF SEG = &HF000 bits$ = CHR$(128) + CHR$(64) + CHR$(32) + CHR$(16) + CHR$(8) + CHR$(4) + CHR$(2) + CHR$(1) slen = LEN(text$) FOR y = 0 TO 7 a$ = "" FOR ct = 1 TO slen byte = PEEK(&HFA6E + ASC(MID$(text$, ct, 1)) * 8 + y) FOR x = 1 TO 8 IF byte AND ASC(MID$(bits$, x, 1)) THEN xpixel% = x1% + (x - 1) * horzsize% + (ct - 1) * 8 * horzsize% ypixel% = y1% + y * vertsize% SELECT CASE Style% CASE 0 LINE (xpixel%, ypixel%)-(xpixel% + horzsize% - 1, ypixel% + vertsize% - 1), colr%, BF CASE 1 LINE (xpixel%, ypixel%)-(xpixel% + horzsize% - 1, ypixel% + vertsize% - 1), colr%, B CASE 2 LINE (xpixel%, ypixel%)-(xpixel% + horzsize% - 1, ypixel% + vertsize% - 1), colr% CASE 3 LINE (xpixel% + horzsize% - 1, ypixel%)-(xpixel%, ypixel% + vertsize% - 1), colr% CASE 4 PSET (xpixel%, ypixel%), colr% END SELECT END IF NEXT NEXT NEXT END SUB