BB2 C port
API reference: Blitz libraries in C and the shared code
Loading...
Searching...
No Matches
intuifontlib.c File Reference
#include "blitzlib.h"
#include "blitzobj.h"
#include <graphics/text.h>

Macros

#define LVO_OpenDiskFont   (-30) /* diskfont: a0 = TextAttr */
#define LVO_CloseFont   (-78) /* graphics: a1 = font */

Functions

void dosetifont (void)
void dosetifont2 (void)
void intuifontlib_codeinit (void)
void douseifont (void)
void dofreeifont (void)
void loadchk (void)
static ULONG codeinit_c (void)
 The library's init: the default object topaz 8 becomes the current IntuiFont (the pad is not cleared).
static void freeifont (struct bb_intuifont *f, const void *gfx)
static void dofreeifont_c (const void *gfx)
 Free IntuiFont#: the object's free routine (_free): close its font (CloseFont), if one is open.
static void douseifont_c (void)
 Use IntuiFont#: the object's use routine (_use): the object (a3) becomes the current IntuiFont (MOVE.l a3,textattr).
static ULONG setifont (const UBYTE *name, UWORD ysize, UWORD style, const ULONG *lens, WORD used, const void *gfx, const void *diskfont)
static ULONG dosetifont_c (const UBYTE *name, UWORD ysize, const ULONG *lens, WORD used, const void *gfx, const void *diskfont)
 LoadFont IntuiFont#,Fontname.font$,Y size: load a font into an IntuiFont object (style 0).
static ULONG dosetifont2_c (const UBYTE *name, UWORD ysize, UWORD style, const ULONG *lens, WORD used, const void *gfx, const void *diskfont)
 LoadFont IntuiFont#,Fontname.font$,Y size,style: LoadFont with a style.
 BLITZ_ERRCHK_ASM (loadchk, " .globl _loadchk\n" "_loadchk:\n" " beq.s 1f\n" " rts\n" "1: move.l #_mess1,d0\n" " trap #0")

Variables

struct { 
   struct bb_intuifont *   textattr 
   struct bb_intuifont   defattr 
   char   defname [12] 
} fd = { .defname = "topaz.font" }

Macro Definition Documentation

◆ LVO_CloseFont

#define LVO_CloseFont   (-78) /* graphics: a1 = font */

◆ LVO_OpenDiskFont

#define LVO_OpenDiskFont   (-30) /* diskfont: a0 = TextAttr */

Function Documentation

◆ BLITZ_ERRCHK_ASM()

BLITZ_ERRCHK_ASM ( loadchk ,
" .globl _loadchk\n" "_loadchk:\n" " beq.s 1f\n" " rts\n" "1: move.l # _mess1,
d0\n" " trap #0"  )

◆ codeinit_c()

ULONG codeinit_c ( void )
static

The library's init: the default object topaz 8 becomes the current IntuiFont (the pad is not cleared).

Returns
d0: &textattr, the library's init value (other libraries read the current IntuiFont through it)

◆ dofreeifont()

void dofreeifont ( void )

◆ dofreeifont_c()

void dofreeifont_c ( const void * gfx)
static

Free IntuiFont#: the object's free routine (_free): close its font (CloseFont), if one is open.

The name copy stays (the object remains a valid TextAttr; the next LoadFont frees it, #198, memlib at the end). The object comes in a3.

Parameters
gfxa6: graphics.library

◆ dosetifont()

void dosetifont ( void )

◆ dosetifont2()

void dosetifont2 ( void )

◆ dosetifont2_c()

ULONG dosetifont2_c ( const UBYTE * name,
UWORD ysize,
UWORD style,
const ULONG * lens,
WORD used,
const void * gfx,
const void * diskfont )
static

LoadFont IntuiFont#,Fontname.font$,Y size,style: LoadFont with a style.

ta_Style = the style's low byte, ta_Flags = 0. Fixed (#197): the original wrote the style as a WORD to +6: ta_Style = the upper byte of the argument (0 for 0..255), ta_Flags = the style.

Parameters
named1: the font name
ysized2: the height
styled3: the style
lensa2: the stack with the name's length
usedd5: the offset of the used variable from a5
gfxd6: graphics.library
diskfonta6: diskfont.library
Returns
d0: the font, 0 if it could not be opened (CCR Z then)

◆ dosetifont_c()

ULONG dosetifont_c ( const UBYTE * name,
UWORD ysize,
const ULONG * lens,
WORD used,
const void * gfx,
const void * diskfont )
static

LoadFont IntuiFont#,Fontname.font$,Y size: load a font into an IntuiFont object (style 0).

The object (a3) becomes the used and the current IntuiFont; its old font is closed, the name copied with maxslib allocst (Fixed (#198): the copy of a previous LoadFont is freed first; the original never freed it), then OpenDiskFont. Amiga mode only. DIFF: a2 stays unchanged (the original pops the name length). Errors (debugger only): "Can't Open Font" - loadchk tests the Z flag the routine leaves.

Parameters
named1: the font name
ysized2: the height
lensa2: the stack with the name's length
usedd5: the offset of the used variable from a5
gfxd6: graphics.library
diskfonta6: diskfont.library
Returns
d0: the font, 0 if it could not be opened (CCR Z then)

◆ douseifont()

void douseifont ( void )

◆ douseifont_c()

void douseifont_c ( void )
static

Use IntuiFont#: the object's use routine (_use): the object (a3) becomes the current IntuiFont (MOVE.l a3,textattr).

◆ freeifont()

void freeifont ( struct bb_intuifont * f,
const void * gfx )
static

◆ intuifontlib_codeinit()

void intuifontlib_codeinit ( void )

◆ loadchk()

void loadchk ( void )

◆ setifont()

ULONG setifont ( const UBYTE * name,
UWORD ysize,
UWORD style,
const ULONG * lens,
WORD used,
const void * gfx,
const void * diskfont )
static

Variable Documentation

◆ defattr

struct bb_intuifont defattr

◆ defname

char defname[12]

◆ [struct]

struct { ... } fd

◆ textattr

struct bb_intuifont* textattr