home *** CD-ROM | disk | FTP | other *** search
- unit Diskfont;
-
- INTERFACE
- uses Exec, AmigaDOS, Graphics;
-
-
- type
- pAvailFonts = ^tAvailFonts;
- tAvailFonts = record
- af_Type: word;
- af_Attr: tTextAttr;
- end;
-
- pFontContentsHeader = ^tFontContentsHeader;
- tFontContentsHeader = record
- fch_FileID: word;
- fch_NumEntries: word;
- end;
-
- pFontContents = ^tFontContents;
- tFontContents = record
- fc_FileName: array [0..255] of byte;
- fc_YSize: word;
- fc_Style: byte;
- fc_Flags: byte;
- end;
-
- pDiskFontHeader = ^tDiskFontHeader;
- tDiskFontHeader = record
- dfh_DF: tNode;
- dfh_FileID: word;
- dfh_Revision: word;
- dfh_Segment: longint;
- dfh_Name: array [0..31] of byte;
- dfh_TF: tTextFont;
- end;
-
- pAvailFontsHeader = ^tAvailFontsHeader;
- tAvailFontsHeader = record
- afh_NumEntries: word;
- end;
-
-
-
- var
- DiskfontBase: pLibrary;
-
-
- const
- MAXFONTNAME = $20;
- MAXFONTPATH = $100;
- FCH_ID = $F00;
- DFH_ID = $F80;
- AFB_MEMORY = 0;
- AFF_MEMORY = 1;
- AFB_DISK = 1;
- AFF_DISK = 2;
-
-
- function OpenDiskFont (textAttr: pTextAttr): pTextFont;
- function AvailFonts
- (buffer: pAvailFontsHeader;
- bufBytes: longint;
- flags: long): longint;
-
- function NewFontContents
- (fontsLock: BPTR;
- fontName: STRPTR): pFontContentsHeader;
-
- procedure DisposeFontContents (fontContentsHeader: pFontContentsHeader);
-
-
- IMPLEMENTATION
- function OpenDiskFont; xassembler;
- asm
- move.l a6,-(sp)
- move.l 8(sp),a0
- move.l DiskfontBase,a6
- jsr -$1E(a6)
- move.l d0,$C(sp)
- move.l (sp)+,a6
- end;
-
- function AvailFonts; xassembler;
- asm
- move.l a6,-(sp)
- lea 8(sp),a6
- move.l (a6)+,d1
- move.l (a6)+,d0
- move.l (a6)+,a0
- move.l DiskfontBase,a6
- jsr -$24(a6)
- move.l d0,$14(sp)
- move.l (sp)+,a6
- end;
-
- function NewFontContents; xassembler;
- asm
- move.l a6,-(sp)
- lea 8(sp),a6
- move.l (a6)+,a1
- move.l (a6)+,a0
- move.l DiskfontBase,a6
- jsr -$2A(a6)
- move.l d0,$10(sp)
- move.l (sp)+,a6
- end;
-
- procedure DisposeFontContents; xassembler;
- asm
- move.l a6,-(sp)
- move.l 8(sp),a1
- move.l DiskfontBase,a6
- jsr -$30(a6)
- move.l (sp)+,a6
- end;
-
- end.
-