Category : C Source Code
Archive   : LSPD05-2.ZIP
Filename : 097.C

 
Output of file : 097.C contained in archive : LSPD05-2.ZIP
/* Light Speed Reference Example Program */
/* Show all of the font styles */
#include "lspeed.h"

/* Define the various text styles as their names */
char *fontstyles[] = {
"Broad Text", "Computer Text",
"Plasma Display", "EGA Small Font",
"EGA Standard", "Tall Text",
"Script Flow", "Nice Font",
"Crisp Character", "Old English",
"Plain Text", "Italic Font" };

main()
{
/* Variables */
int loop;

/* Set graphics mode */
set640x350();

/* Install all of the fonts */
registerbroadfont();
registercomputerfont();
registertallfont();
registersmallfont();
registerscriptfont();
registerplasmafont();
registerplainfont();
registeroldenglishfont();
registernicefont();
registeritalicfont();
registerstandardfont();
registercrispfont();

/* Loop through all twelve fonts */
for (loop=1; loop<=12; loop++)
demonstrate_font(loop);

/* Close down the graphics and return */
set80x25();
}

/* DEMONSTRATE_FONT - called with the value of the font to use, */
/* this function will provide several */
/* graphics mode ouput tests. */
demonstrate_font(font)
int font;
{
/* Variables */
int foreloop, backloop;

/* Clear the graphics screen */
ega_clearpage();

/* Tell the user the font we are displaying */
ega_formattext(10, 10, LS_YELLOW, LS_BLACK, STANDARD_FONT,
"Demonstrating %s!", fontstyles[font-1]);

/* Print out the standard alphabet in the text style */
ega_writetext(20, 30, LS_WHITE, LS_BLACK, font,
"The standard character set:");
ega_formattext(25, 30+ega_fontheight(font), LS_CYAN, LS_BLACK, font,
" !%c#$%&'()*+,-./0123456789:;<=>?@", 34);
ega_writetext(25, 30+ega_fontheight(font)*2, LS_CYAN, LS_BLACK, font,
"ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`");
ega_writetext(25, 30+ega_fontheight(font)*3, LS_CYAN, LS_BLACK, font,
"abcdefghijklmnopqrstuvwxyz{|}~");

/* Tell a bit more about the text system */
ega_writetext(15, 120, LS_YELLOW, LS_BLACK, font,
"The above is only a demonstration of the font...");
ega_writetext(15, 120+ega_fontheight(font), LS_YELLOW, LS_BLACK, font,
"The real power lies in foreground/background colours!");
for (foreloop=0; foreloop<=15; foreloop++)
for (backloop=0; backloop<=7; backloop++)
ega_writetext(30+foreloop*32, 160+backloop*ega_fontheight(font),
foreloop, backloop, font, " WOW ");

/* Write a message and wait for the next keypress */
ega_writetext(15, 320, LS_WHITE, LS_BLUE, STANDARD_FONT,
" Press any key to continue... ");
getxch();
}



  3 Responses to “Category : C Source Code
Archive   : LSPD05-2.ZIP
Filename : 097.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/