🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.atari.st
Article #28346

Switching to a homemade font

#28346
From: Martin Minow
Date: Mon, 21 Sep 1987 22:28
65 lines
2542 bytes
#if 0
Many months ago, I asked the net (unsuccessfully) for information on
setting a font from memory.  I finally succeeded in decompiling enough
of the operating system to make it work.  The USE_LINEA stuff is only
needed if you want to do line-a text blit's.  Note that the font must
be mono-spaced with 8-bit wide characters.  I.e., you cannot use the
tiny icon font (6x6).

struct la_font is defined in linea.h on the Mark Williams C system.

If Atari ever gets around to documenting TOS, perhaps this routine
could be added.

Martin Minow
decvax!minow

#endif

#if USE_LINEA
char			scr_work[1024];	/* LineA work area		*/
int			scr_fat;	/* Max. width for underline	*/
int			scr_chi;	/* Underline displacement	*/
#endif

switch_font(fp)
register struct la_font		*fp;
/*
 * This code invokes VDI ESC 102 code (page 440 in the July '86
 * Abacus ST Internals BIOS listing).  I decompiled some library
 * routines to see how to make it work.  It may not work on new ROMS.
 * Martin Minow, Arlington MA 02174.  This routine is in the public domain.
 */
{
	contrl[0] = 5;			/* VDI escape function		*/
	contrl[1] = 0;			/* Things in ptsin[]		*/
	contrl[3] = 2;			/* Things in intin[]		*/
	contrl[5] = 102;		/* Subfun. from Abacus rom list	*/
	contrl[6] = vdi_handle;		/* vdi_handle set by v_opnvwk()	*/
	(*(long *) &intin[0]) = fp;	/* Put font info in intin[0]	*/
	vdi();				/* Execute vdi trap		*/
	/*
	 * That's all you need if you only want to use Cconws() (etc.)
	 * If you want to use the Line-A textblit routine, you should do
	 * the following, too.  See the Mark Williams C manual for info.
	 */
#if USE_LINEA
	FBASE = fp->font_data;
	FWIDTH = fp->font_width;
	TEXTFG = 1;			/* Text foreground, color 1	*/
	SRCY = 0;
	DELY = fp->font_height;
	scr_fat = fp->font_fat_cell;
	scr_chi = fp->font_height - 1;
	COLBIT0 = 1;
	COLBIT1 = 0;
	COLBIT2 = 0;
	COLBIT3 = 0;
	LITEMSK = 0x5555;
	SKEWMSK = 0x1111;
	SCRTCHP = scr_work;			
	WEIGHT = 1;
	LSTLIN = -1;
#endif
}
Technical Details
Message-ID: <153@decvax.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!rutgers!ucla-cs!zen!ucbvax!decvax!minow

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!rutgers!ucla-cs!zen!ucbvax!decvax!minow
From: minow@decvax.UUCP (Martin Minow)
Newsgroups: comp.sys.atari.st
Subject: Switching to a homemade font
Message-ID: <153@decvax.UUCP>
Date: Mon, 21-Sep-87 18:28:16 EDT
Article-I.D.: decvax.153
Posted: Mon Sep 21 18:28:16 1987
Date-Received: Wed, 23-Sep-87 02:05:19 EDT
Reply-To: minow@decvax.UUCP (Martin Minow)
Organization: Digital Eq. Corp. - Merrimack NH.
Lines: 65