home *** CD-ROM | disk | FTP | other *** search
- unit Diskfont;
-
- INTERFACE
- uses Exec, AmigaDOS, Graphics, Utility;
-
-
- type
- pAvailFonts = ^tAvailFonts;
- tAvailFonts = record
- af_Type: word;
- af_Attr: tTextAttr;
- end;
-
- pFontContentsHeader = ^tFontContentsHeader;
- tFontContentsHeader = record
- fch_FileID: word;
- fch_NumEntries: word;
- end;
-
- pTFontContents = ^tTFontContents;
- tTFontContents = record
- tfc_FileName: array [0..253] of byte;
- tfc_TagCount: word;
- tfc_YSize: word;
- tfc_Style: byte;
- tfc_Flags: byte;
- 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;
- case integer of
- 0: (
- dfh_TagList: tTagItem;
- );
- 1: (
- dfh_Segment: longint;
- dfh_Name: array [0..31] of byte;
- dfh_TF: tTextFont;
- );
- end;
-
- pAvailFontsHeader = ^tAvailFontsHeader;
- tAvailFontsHeader = record
- afh_NumEntries: word;
- end;
-
- pTAvailFonts = ^tTAvailFonts;
- tTAvailFonts = record
- taf_Type: word;
- taf_Attr: tTTextAttr;
- end;
-
-
-
- var
- DiskfontBase: pLibrary;
-
-
- const
- OT_Level0 = $80000000;
- OT_BName = $8000A005;
- OT_Level1 = $80001000;
- OT_Level2 = $80002000;
- OT_Level3 = $80003000;
- OT_IName = $8000A006;
- OTS_Black = $D8;
- OTS_SemiBold = $98;
- OTS_DemiLight = $58;
- AFB_SCALED = 2;
- AFB_TAGGED = $10;
- OTS_Bold = $B8;
- AFF_SCALED = 4;
- AFF_TAGGED = $10000;
- OTS_ExtraBlack = $E8;
- OTS_LeftItalic = 2;
- MAXFONTNAME = $20;
- OTH_SemiExpanded = $B0;
- TFCH_ID = $F02;
- OTS_UltraBlack = $F8;
- OTSUFFIX = '.otag';
- OTH_Expanded = $D0;
- OTS_Book = $78;
- OT_SerifFlag = $80001014;
- OTS_ExtraBold = $C8;
- OTS_Italic = 1;
- OT_FileIdent = $80001001;
- OTS_SemiLight = $68;
- OT_IsFixed = $80002013;
- OTH_Condensed = $70;
- MAXFONTPATH = $100;
- OTE_Bullet = 'bullet';
- OTS_Thin = $28;
- OTS_Light = $48;
- OTH_Normal = $90;
- OTH_ExtraExpanded = $F0;
- OT_MAXAVAILSIZES = $14;
- FCH_ID = $F00;
- OTS_Medium = $88;
- DFH_ID = $F80;
- OT_SpaceFactor = $80002018;
- OT_Spec = $80001100;
- OT_Engine = $80009002;
- OTS_ExtraThin = $18;
- OTS_ExtraLight = $38;
- OT_SpaceWidth = $80002012;
- OT_YSizeFactor = $80001011;
- OTS_UltraThin = 8;
- OT_DotSize = $80000002;
- OT_Family = $80009003;
- OT_DeviceDPI = $80000001;
- AFB_MEMORY = 0;
- OTH_Compressed = $50;
- OT_SpecCount = $80001100;
- OT_AvailSizes = $80009020;
- AFF_MEMORY = 1;
- OT_Indirect = $8000;
- OT_InhibitAlgoStyle = $80002019;
- OT_PointHeight = $80000008;
- OTS_Upright = 0;
- OT_StemWeight = $80001015;
- OTH_ExtraCompressed = $30;
- OT_BIName = $8000A007;
- OT_SymbolSet = $80001010;
- OTH_UltraCompressed = $10;
- OT_PointSize = $80000010;
- OT_SlantStyle = $80001016;
- AFB_DISK = 1;
- AFF_DISK = 2;
- OT_Spec1 = $80001101;
- OTS_DemiBold = $A8;
- OT_HorizStyle = $80001017;
-
-
- 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);
- function NewScaledDiskFont
- (sourceFont: pTextFont;
- destTextAttr: pTTextAttr): pDiskFontHeader;
-
-
-
- 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;
-
- function NewScaledDiskFont; xassembler;
- asm
- move.l a6,-(sp)
- lea 8(sp),a6
- move.l (a6)+,a1
- move.l (a6)+,a0
- move.l DiskfontBase,a6
- jsr -$36(a6)
- move.l d0,$10(sp)
- move.l (sp)+,a6
- end;
-
- end.
-