home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Pascal / HISOFTPASCAL2,0-2.DMS / in.adf / Units / Diskfont.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1992-05-20  |  1.9 KB  |  119 lines

  1. unit Diskfont;
  2.  
  3. INTERFACE
  4. uses Exec, AmigaDOS, Graphics;
  5.  
  6.  
  7. type
  8.     pAvailFonts = ^tAvailFonts;
  9.     tAvailFonts = record
  10.         af_Type: word;
  11.         af_Attr: tTextAttr;
  12.         end;
  13.  
  14.     pFontContentsHeader = ^tFontContentsHeader;
  15.     tFontContentsHeader = record
  16.         fch_FileID: word;
  17.         fch_NumEntries: word;
  18.         end;
  19.  
  20.     pFontContents = ^tFontContents;
  21.     tFontContents = record
  22.         fc_FileName: array [0..255] of byte;
  23.         fc_YSize: word;
  24.         fc_Style: byte;
  25.         fc_Flags: byte;
  26.         end;
  27.  
  28.     pDiskFontHeader = ^tDiskFontHeader;
  29.     tDiskFontHeader = record
  30.         dfh_DF: tNode;
  31.         dfh_FileID: word;
  32.         dfh_Revision: word;
  33.         dfh_Segment: longint;
  34.         dfh_Name: array [0..31] of byte;
  35.         dfh_TF: tTextFont;
  36.         end;
  37.  
  38.     pAvailFontsHeader = ^tAvailFontsHeader;
  39.     tAvailFontsHeader = record
  40.         afh_NumEntries: word;
  41.         end;
  42.  
  43.  
  44.  
  45. var
  46.     DiskfontBase: pLibrary;
  47.  
  48.  
  49. const
  50.     MAXFONTNAME = $20;
  51.     MAXFONTPATH = $100;
  52.     FCH_ID = $F00;
  53.     DFH_ID = $F80;
  54.     AFB_MEMORY = 0;
  55.     AFF_MEMORY = 1;
  56.     AFB_DISK = 1;
  57.     AFF_DISK = 2;
  58.  
  59.  
  60. function OpenDiskFont (textAttr: pTextAttr): pTextFont;
  61. function AvailFonts
  62.         (buffer: pAvailFontsHeader;
  63.         bufBytes: longint;
  64.         flags: long): longint;
  65.  
  66. function NewFontContents
  67.         (fontsLock: BPTR;
  68.         fontName: STRPTR): pFontContentsHeader;
  69.  
  70. procedure DisposeFontContents (fontContentsHeader: pFontContentsHeader);
  71.  
  72.  
  73. IMPLEMENTATION
  74. function OpenDiskFont; xassembler;
  75. asm
  76.     move.l    a6,-(sp)
  77.     move.l    8(sp),a0
  78.     move.l    DiskfontBase,a6
  79.     jsr        -$1E(a6)
  80.     move.l    d0,$C(sp)
  81.     move.l    (sp)+,a6
  82. end;
  83.  
  84. function AvailFonts; xassembler;
  85. asm
  86.     move.l    a6,-(sp)
  87.     lea        8(sp),a6
  88.     move.l    (a6)+,d1
  89.     move.l    (a6)+,d0
  90.     move.l    (a6)+,a0
  91.     move.l    DiskfontBase,a6
  92.     jsr        -$24(a6)
  93.     move.l    d0,$14(sp)
  94.     move.l    (sp)+,a6
  95. end;
  96.  
  97. function NewFontContents; xassembler;
  98. asm
  99.     move.l    a6,-(sp)
  100.     lea        8(sp),a6
  101.     move.l    (a6)+,a1
  102.     move.l    (a6)+,a0
  103.     move.l    DiskfontBase,a6
  104.     jsr        -$2A(a6)
  105.     move.l    d0,$10(sp)
  106.     move.l    (sp)+,a6
  107. end;
  108.  
  109. procedure DisposeFontContents; xassembler;
  110. asm
  111.     move.l    a6,-(sp)
  112.     move.l    8(sp),a1
  113.     move.l    DiskfontBase,a6
  114.     jsr        -$30(a6)
  115.     move.l    (sp)+,a6
  116. end;
  117.  
  118. end.
  119.