home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD2.bin
/
bbs
/
dev
/
oberon-a-1.4ß.lha
/
Oberon-A
/
source
/
amiga
/
DiskFont.mod
< prev
next >
Wrap
Text File
|
1994-08-08
|
22KB
|
589 lines
(***************************************************************************
$RCSfile: DiskFont.mod $
Description: Interface to diskfont.library
Created by: fjc (Frank Copeland)
$Revision: 3.2 $
$Author: fjc $
$Date: 1994/08/08 01:09:10 $
Includes Release 40.15
(C) Copyright 1985-1993 Commodore-Amiga, Inc.
All Rights Reserved
Oberon-A interface Copyright © 1994, Frank Copeland.
This file is part of the Oberon-A Interface.
See Oberon-A.doc for conditions of use and distribution.
***************************************************************************)
MODULE DiskFont;
(*
** $C- CaseChk $I- IndexChk $L+ LongAdr $N- NilChk
** $P- PortableCode $R- RangeChk $S- StackChk $T- TypeChk
** $V- OvflChk $Z- ZeroVars
*)
IMPORT
E := Exec, D := Dos, U := Utility, G := Graphics, SYS := SYSTEM;
(*
** $VER: diskfont.h 38.0 (18.6.92)
**
** diskfont library definitions
**
** (C) Copyright 1990 Robert R. Burns
** All Rights Reserved
*)
CONST
maxFontPath * = 256; (* including null terminator *)
TYPE
FontContentsPtr * = CPOINTER TO FontContents;
FontContents * = RECORD
fileName * : ARRAY maxFontPath OF CHAR;
ySize * : E.UWORD;
style * : E.BSET;
flags * : E.BSET;
END; (* FontContents *)
TFontContentsPtr * = CPOINTER TO TFontContents;
TFontContents * = RECORD
fileName * : ARRAY maxFontPath - 2 OF CHAR;
tagCount * : E.UWORD; (* including the tagDONE tag *)
(*
* if tagCount is non-zero, fileName is overlayed with
* Text Tags starting at: SYS.VAL (U.TagItemPtr,
* SYS.ADR (fileName[maxFontPath-(tagCount*SIZE (U.TagItem))]))
*)
ySize * : E.UWORD;
style * : E.BSET;
flags * : E.BSET;
END; (* TFontContents *)
CONST
fchId * = 0F00H; (* FontContentsHeader, then FontContents *)
tfchId * = 0F02H; (* FontContentsHeader, then TFontContents *)
ofchId * = 0F03H; (* FontContentsHeader, then TFontContents,
* associated with outline font *)
TYPE
FontContentsHeaderPtr * = CPOINTER TO FontContentsHeader;
FontContentsHeader * = RECORD
fileID * : E.UWORD; (* fchID *)
numEntries * : E.UWORD; (* the number of FontContents elements *)
(**fc * : ARRAY numEntries OF FontContents or
tfc * : ARRAY numEntries OF TFontContents *)
END; (* FontContentsHeader *)
CONST
dfhId * = 0F80H;
maxFontName * = 32; (* font name including ".font\0" *)
TYPE
DiskFontHeaderPtr * = CPOINTER TO DiskFontHeader;
(* 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... *)
(* nextSegment : E.ULONG; (* actually a BPTR *) *)
(* returnCode : E.ULONG; (* MOVEQ #0,D0 : RTS *) *)
(* here then is the official start of the DiskFontHeader... *)
DiskFontHeader * = RECORD (E.Node) (* node to link disk fonts *)
fileID * : E.UWORD; (* dfhID *)
revision * : E.UWORD; (* the font revision *)
segment * : SYS.BPTR; (* the segment address when loaded *)
dfhName * : ARRAY maxFontName OF CHAR; (* the font name (null terminated) *)
tf * : G.TextFont; (* loaded TextFont structure *)
END; (* DiskFontHeader *)
(* unfortunately, this needs to be explicitly typed *)
(* used only if tf.tfStyle fsTagged bit is set *)
(* DiskFontHeader.tagList = DiskFontHeader.segment; (* destroyed during loading *)*)
CONST
afMemory * = 0;
afDisk * = 1;
afScaled * = 2;
afBitmap * = 3;
afTagged * = 16; (* return TAvailFonts *)
TYPE
AvailFontPtr * = CPOINTER TO AvailFont;
AvailFont * = RECORD
type * : E.WSET; (* MEMORY, DISK, or SCALED *)
attr * : G.TextAttr; (* text attributes for font *)
END; (* AvailFont *)
TAvailFontPtr * = CPOINTER TO TAvailFont;
TAvailFont * = RECORD
Type * : E.WSET; (* MEMORY, DISK, or SCALED *)
Attr * : G.TTextAttr; (* text attributes for font *)
END; (* TAvailFont *)
AvailFontsHeaderPtr * = CPOINTER TO AvailFontsHeader;
AvailFontsHeader * = RECORD
numEntries * : E.UWORD; (* number of AvailFonts elements *)
(**af * : ARRAY numEntries OF AvailFont or
taf * : ARRAY numEntries OF TAvailFont*)
END; (* AvailFontsHeader *)
(*
** $VER: diskfonttag.h 10.4 (14.7.92)
**
** libraries/diskfonttag.h -- tag definitions for .otag files
**
** (C) Copyright 1990-1992 Robert R. Burns
** All Rights Reserved
*)
CONST
(* Level 0 entries never appear in the .otag tag list, but appear in font
* specifications *)
otLevel0 * = U.tagUser;
(* Level 1 entries are required to exist in the .otag tag list *)
otLevel1 * = U.tagUser + 1000H;
(* Level 2 entries are optional typeface metric tags *)
otLevel2 * = U.tagUser + 2000H;
(* Level 3 entries are required for some otEngines *)
otLevel3 * = U.tagUser + 3000H;
(* Indirect entries are at (tag address + data offset) *)
otIndirect * = 8000H;
(********************************************************************)
(* font specification and inquiry tags *)
(* ! tags flagged with an exclaimation mark are valid for
* specification.
* ? tags flagged with a question mark are valid for inquiry
*
* fixed binary numbers are encoded as 16 bits of integer and
* 16 bits of fraction. Negative values are indicated by twos
* complement of all 32 bits.
*)
(* ! otDeviceDPI specifies the target device dots per inch -- X DPI is
* in the high word, Y DPI in the low word. *)
otDeviceDPI * = otLevel0 + 01H; (* == taDeviceDPI *)
(* ! OT_Dot_Size specifies the target device dot size as a percent of
* it's resolution-implied size -- X percent in high word, Y percent
* in low word. *)
otDotSize * = otLevel0 + 02H;
(* ! OT_Point_Height specifies the requested point height of a typeface,
* specifically, the height and nominal width of the em-square.
* The point referred to here is 1/72". It is encoded as a fixed
* binary number. *)
otPointHeight * = otLevel0 + 08H;
(* ! otSetFactor specifies the requested set width of a typeface.
* It distorts the width of the em-square from that specified by
* otPointHeight. To compensate for a device with different
* horizontal and vertical resolutions, otDeviceDpi should be used
* instead. For a normal aspect ratio, set to 1.0 (encoded as
* 0x00010000). This is the default value. *)
otSetFactor * = otLevel0 + 09H;
(* ! otShear... specifies the Sine and Cosine of the vertical stroke
* angle, as two fixed point binary fractions. Both must be specified:
* first the Sine and then the Cosine. Setting the sine component
* changes the Shear to an undefined value, setting the cosine
* component completes the Shear change to the new composite value.
* For no shear, set to 0.0, 1.0 (encoded as 0x00000000, 0x00010000).
* This is the default value. *)
otShearSin * = otLevel0 + 0AH;
otShearCos * = otLevel0 + 0BH;
(* ! otRotate... specifies the Sine and Cosine of the baselin rotation
* angle, as two fixed point binary fractions. Both must be specified:
* first the Sine and then the Cosine. Setting the sine component
* changes the Shear to an undefined value, setting the cosine
* component completes the Shear change to the new composite value.
* For no shear, set to 0.0, 1.0 (encoded as 0x00000000, 0x00010000).
* This is the default value. *)
otRotateSin * = otLevel0 + 0CH;
otRotateCos * = otLevel0 + 0DH;
(* ! otEmbolden... specifies values to algorithimically embolden -- or,
* when negative, lighten -- the glyph. It is encoded as a fixed point
* binary fraction of the em-square. The X and Y components can be
* changed indendently. For normal characters, set to 0.0, 0.0
* (encoded as 0x00000000, 0x00000000). This i