TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: All
from: Mikko Hyvarinen
date: 1996-08-04 06:22:22
subject: OS/2 Full-Screen font

Hello All!

My apologies to those who sent me mail asking to post/send this thing.
First I couldn't find this, and then I had a bit of technical difficulties
when trying to send this thing via e-mail. But to the matter at hand:

=====cut=====
/*

A simple program that changes the OS/2 full-screen session font using the
16-bit VIO interface.

Reads font from file. The font is 16 bytes per character, and the file must
contain 256 characters (totalling 8192 bytes). Can be generated with almost
any DOS font editor (look for them at the Simtel archive, ftp.cdrom.com).

Released to the public domain by the author, Mikko Hyvarinen. 
This code is absolutely free, you may use it as you wish.

As always with free code, there's absolutely no guarantee whatsoever.
Use at your own risk.

*/
#include 
#define INCL_BASE
#define INCL_SUB
#define INCL_VIO
#include 

int main(int argc, char *argv[])
{
    FILE *fontfile;
    APIRET rc;
    char buffer[16*256];
    VIOFONTINFO myfont = {14, 0, 8, 16, &buffer[0], 16*256};
    VIOMODEINFO mymode = {12, 1, 4, 80, 25, 640, 400};

    if(argc != 2) {
        printf("Please supply font file name as parameter\n");
        return 255;
    }

    fontfile = fopen(argv[1], "rb");
    if(fontfile == NULL) {
        printf("Error opening file %s\n", argv[1]);
        return 1;
    }

    if(fread(&buffer[0], sizeof(char), FONT_SIZE*256, fontfile) !=
FONT_SIZE*256) {
        printf("Error reading from file %s\n", argv[1]);
        return 2;
    }

    fclose(fontfile);

    rc = VioSetFont(&myfont, 0);

    printf("VioSetFont returned %u\n", rc);

    /* You won't see this message because of the following: */

    rc = VioSetMode(&mymode, 0);

    printf("VioSetMode returned %u\n", rc);

    return rc;
}
=====cut=====

--- timEd/2 1.10+
* Origin: Uko (2:229/0)
SEEN-BY: 50/99 270/101 620/243 625/100 711/401 409 410 413 430 808 809 934
SEEN-BY: 711/955 712/407 515 624 628 713/888 800/1
@PATH: 229/0 270/101 712/515 711/808 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.