home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d3xx
/
d339
/
pcq.lha
/
PCQ
/
Include
/
DiskFont.i
< prev
next >
Wrap
Text File
|
1990-03-19
|
3KB
|
114 lines
{
DiskFont.i (of PCQ Pascal)
Copyright 1990 Patrick Quaid
This file contains most of the definitions you'll need
to mess around with fonts on the Amiga. Note that in
order to use any of the four function listed at the
bottom of the file, you'll have to open the diskfont.library.
Since NewFontContents and DisposeFontContents were only
included as of version 34, you should specify a minimum
version number of 34 in the OpenLibrary call.
}
{$I "Include/Ports.i"}
{$I "Include/Graphics.i"}
Var
DiskFontBase : Address;
Const
MAXFONTPATH = 256;
Type
FontContents = Record
fc_FileName : Array [0..MAXFONTPATH] of Char;
fc_YSize : Short;
fc_Style : Byte;
fc_Flags : Byte;
end;
FontContentsPtr = ^FontContents;
Const
FCH_ID = $0f00;
Type
FontContentsHeader = Record
fch_FileID : Short; { FCH_ID }
fch_NumEntries : Short; { the number of FontContents elements }
fch_FC : Array [0..1] of FontContents;
{ This array will have fch_NumEntries fields }
end;
FontContentsHeaderPtr = ^FontContentsHeader;
Const
DFH_ID = $0f80;
MAXFONTNAME = 32; { font name including ".font\0" }
Type
DiskFontHeader = Record
{ the following 8 bytes are not actually considered a part of the }
{ DiskFontHeader, but immediately preceed it. The NextSegment is }
{ supplied by the linker/loader, and the ReturnCode is the code }
{ at the beginning of the font in case someone runs it... }
{ dfh_NextSegment : Address; { actually a BPTR }
{ dfh_ReturnCode : Address; { MOVEQ #0,D0 : RTS }
{ here then is the official start of the DiskFontHeader... }
dfh_DF : Node; { node to link disk fonts }
dfh_FileID : Short; { DFH_ID }
dfh_Revision : Short; { the font revision }
dfh_Segment : Address; { the segment address when loaded }
dfh_Name : Array [0..MAXFONTNAME] of Char;
{ the font name (null terminated) }
dfh_TF : TextFont; { loaded TextFont structure }
end;
DiskFontHeaderPtr = ^DiskFontHeader;
Const
AFB_MEMORY = 0;
AFF_MEMORY = 1;
AFB_DISK = 1;
AFF_DISK = 2;
FPF_ROMFONT = $0001;
FPF_DISKFONT = $0002;
FPF_REVPATH = $0004;
FPF_TALLDOT = $0008;
FPF_LONGDOT = $0010;
FPF_PROPORTIONAL = $0020;
FPF_DESIGNED = $0040;
FPF_REMOVED = $0080;
Type
{ This structure is called AvailFonts in the C includes,
but had to be renamed here because of the name conflict }
AvailFont = Record
af_Type : Short; { MEMORY or DISK }
af_Attr : TextAttr; { text attributes for font }
end;
AvailFontPtr = ^AvailFont;
AvailFontsHeader = Record
afh_NumEntries : Short; { number of AvailFonts elements }
afh_AF : Array [0..1] of AvailFont;
{ This array actually has afh_NumEntries elements }
end;
AvailFontsHeaderPtr = ^AvailFontsHeader;
Function AvailFonts(buffer : Address;
bufBytes : Integer; types : Integer) : Integer;
External;
Procedure DisposeFontContents(FCH : FontContentsHeaderPtr);
External; { version 34 }
Function NewFontContents(fontsLock : Address { Lock };
fontName : String) : FontContentsHeaderPtr;
External; { version 34 }
Function OpenDiskFont(TA : TextAttrPtr) : TextFontPtr;
External;