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 >
Text File  |  1994-08-08  |  22KB  |  589 lines

  1. (***************************************************************************
  2.  
  3.      $RCSfile: DiskFont.mod $
  4.   Description: Interface to diskfont.library
  5.  
  6.    Created by: fjc (Frank Copeland)
  7.     $Revision: 3.2 $
  8.       $Author: fjc $
  9.         $Date: 1994/08/08 01:09:10 $
  10.  
  11.   Includes Release 40.15
  12.  
  13.   (C) Copyright 1985-1993 Commodore-Amiga, Inc.
  14.       All Rights Reserved
  15.  
  16.   Oberon-A interface Copyright © 1994, Frank Copeland.
  17.   This file is part of the Oberon-A Interface.
  18.   See Oberon-A.doc for conditions of use and distribution.
  19.  
  20. ***************************************************************************)
  21.  
  22. MODULE DiskFont;
  23.  
  24. (*
  25. ** $C- CaseChk       $I- IndexChk  $L+ LongAdr   $N- NilChk
  26. ** $P- PortableCode  $R- RangeChk  $S- StackChk  $T- TypeChk
  27. ** $V- OvflChk       $Z- ZeroVars
  28. *)
  29.  
  30. IMPORT
  31.   E := Exec, D := Dos, U := Utility, G := Graphics, SYS := SYSTEM;
  32.  
  33.  
  34. (*
  35. **      $VER: diskfont.h 38.0 (18.6.92)
  36. **
  37. **      diskfont library definitions
  38. **
  39. **      (C) Copyright 1990 Robert R. Burns
  40. **          All Rights Reserved
  41. *)
  42.  
  43.  
  44. CONST
  45.  
  46.   maxFontPath * = 256;   (* including null terminator *)
  47.  
  48. TYPE
  49.  
  50.   FontContentsPtr * = CPOINTER TO FontContents;
  51.   FontContents * = RECORD
  52.     fileName * : ARRAY maxFontPath OF CHAR;
  53.     ySize *    : E.UWORD;
  54.     style *    : E.BSET;
  55.     flags *    : E.BSET;
  56.   END; (* FontContents *)
  57.  
  58.   TFontContentsPtr * = CPOINTER TO TFontContents;
  59.   TFontContents * = RECORD
  60.     fileName * : ARRAY maxFontPath - 2 OF CHAR;
  61.     tagCount * : E.UWORD;       (* including the tagDONE tag *)
  62.     (*
  63.      *  if tagCount is non-zero, fileName is overlayed with
  64.      *  Text Tags starting at:  SYS.VAL (U.TagItemPtr,
  65.      *    SYS.ADR (fileName[maxFontPath-(tagCount*SIZE (U.TagItem))]))
  66.      *)
  67.     ySize *    : E.UWORD;
  68.     style *    : E.BSET;
  69.     flags *    : E.BSET;
  70.   END; (* TFontContents *)
  71.  
  72.  
  73. CONST
  74.  
  75.   fchId *  = 0F00H;  (* FontContentsHeader, then FontContents *)
  76.   tfchId * = 0F02H;  (* FontContentsHeader, then TFontContents *)
  77.   ofchId * = 0F03H;  (* FontContentsHeader, then TFontContents,
  78.                       * associated with outline font *)
  79.  
  80. TYPE
  81.  
  82.   FontContentsHeaderPtr * = CPOINTER TO FontContentsHeader;
  83.   FontContentsHeader * = RECORD
  84.     fileID *     : E.UWORD; (* fchID *)
  85.     numEntries * : E.UWORD; (* the number of FontContents elements *)
  86.   (**fc *         : ARRAY numEntries OF FontContents or
  87.     tfc *        : ARRAY numEntries OF TFontContents *)
  88.   END; (* FontContentsHeader *)
  89.  
  90.  
  91. CONST
  92.  
  93.   dfhId *       = 0F80H;
  94.   maxFontName * =    32; (* font name including ".font\0" *)
  95.  
  96. TYPE
  97.  
  98.   DiskFontHeaderPtr * = CPOINTER TO DiskFontHeader;
  99.  
  100.     (* the following 8 bytes are not actually considered a part of the  *)
  101.     (* DiskFontHeader, but immediately preceed it. The nextSegment is   *)
  102.     (* supplied by the linker/loader, and the returnCode is the code    *)
  103.     (* at the beginning of the font in case someone runs it...          *)
  104.     (*   nextSegment : E.ULONG;              (* actually a BPTR *)      *)
  105.     (*   returnCode  : E.ULONG;              (* MOVEQ #0,D0 : RTS *)    *)
  106.     (* here then is the official start of the DiskFontHeader...         *)
  107.   DiskFontHeader * = RECORD (E.Node) (* node to link disk fonts *)
  108.     fileID *   : E.UWORD;            (* dfhID *)
  109.     revision * : E.UWORD;            (* the font revision *)
  110.     segment *  : SYS.BPTR;           (* the segment address when loaded *)
  111.     dfhName *  : ARRAY maxFontName OF CHAR; (* the font name (null terminated) *)
  112.     tf *       : G.TextFont;         (* loaded TextFont structure *)
  113.   END; (* DiskFontHeader *)
  114.  
  115. (* unfortunately, this needs to be explicitly typed *)
  116. (* used only if tf.tfStyle fsTagged bit is set *)
  117.  
  118. (*  DiskFontHeader.tagList = DiskFontHeader.segment; (* destroyed during loading *)*)
  119.  
  120.  
  121. CONST
  122.  
  123.   afMemory * = 0;
  124.   afDisk * =   1;
  125.   afScaled * = 2;
  126.   afBitmap * = 3;
  127.  
  128.   afTagged * = 16;      (* return TAvailFonts *)
  129.  
  130. TYPE
  131.  
  132.   AvailFontPtr * = CPOINTER TO AvailFont;
  133.   AvailFont * = RECORD
  134.     type * : E.WSET;        (* MEMORY, DISK, or SCALED *)
  135.     attr * : G.TextAttr;    (* text attributes for font *)
  136.   END; (* AvailFont *)
  137.  
  138.   TAvailFontPtr * = CPOINTER TO TAvailFont;
  139.   TAvailFont * = RECORD
  140.     Type * : E.WSET;       (* MEMORY, DISK, or SCALED *)
  141.     Attr * : G.TTextAttr;  (* text attributes for font *)
  142.   END; (* TAvailFont *)
  143.  
  144.   AvailFontsHeaderPtr * = CPOINTER TO AvailFontsHeader;
  145.   AvailFontsHeader * = RECORD
  146.     numEntries * : E.UWORD;      (* number of AvailFonts elements *)
  147.   (**af *         : ARRAY numEntries OF AvailFont or
  148.     taf *         : ARRAY numEntries OF TAvailFont*)
  149.   END; (* AvailFontsHeader *)
  150.  
  151.  
  152. (*
  153. **      $VER: diskfonttag.h 10.4 (14.7.92)
  154. **
  155. **      libraries/diskfonttag.h -- tag definitions for .otag files
  156. **
  157. **      (C) Copyright 1990-1992 Robert R. Burns
  158. **          All Rights Reserved
  159. *)
  160.  
  161. CONST
  162.  
  163. (* Level 0 entries never appear in the .otag tag list, but appear in font
  164.  * specifications *)
  165.    otLevel0 *   =   U.tagUser;
  166. (* Level 1 entries are required to exist in the .otag tag list *)
  167.    otLevel1 *   =   U.tagUser + 1000H;
  168. (* Level 2 entries are optional typeface metric tags *)
  169.    otLevel2 *   =   U.tagUser + 2000H;
  170. (* Level 3 entries are required for some otEngines *)
  171.    otLevel3 *   =   U.tagUser + 3000H;
  172. (* Indirect entries are at (tag address + data offset) *)
  173.    otIndirect * =   8000H;
  174.  
  175. (********************************************************************)
  176. (* font specification and inquiry tags *)
  177.  
  178. (* !  tags flagged with an exclaimation mark are valid for
  179.  *    specification.
  180.  *  ? tags flagged with a question mark are valid for inquiry
  181.  *
  182.  * fixed binary numbers are encoded as 16 bits of integer and
  183.  * 16 bits of fraction.  Negative values are indicated by twos
  184.  * complement of all 32 bits.
  185.  *)
  186.  
  187. (* !  otDeviceDPI specifies the target device dots per inch -- X DPI is
  188.  *    in the high word, Y DPI in the low word. *)
  189.   otDeviceDPI * = otLevel0 + 01H;                (* == taDeviceDPI *)
  190.  
  191. (* !  OT_Dot_Size specifies the target device dot size as a percent of
  192.  *    it's resolution-implied size -- X percent in high word, Y percent
  193.  *    in low word. *)
  194.   otDotSize * = otLevel0 + 02H;
  195.  
  196. (* !  OT_Point_Height specifies the requested point height of a typeface,
  197.  *    specifically, the height and nominal width of the em-square.
  198.  *    The point referred to here is 1/72".  It is encoded as a fixed
  199.  *    binary number. *)
  200.   otPointHeight * = otLevel0 + 08H;
  201.  
  202. (* !  otSetFactor specifies the requested set width of a typeface.
  203.  *    It distorts the width of the em-square from that specified by
  204.  *    otPointHeight.  To compensate for a device with different
  205.  *    horizontal and vertical resolutions, otDeviceDpi should be used
  206.  *    instead.  For a normal aspect ratio, set to 1.0 (encoded as
  207.  *    0x00010000).  This is the default value. *)
  208.   otSetFactor * = otLevel0 + 09H;
  209.  
  210. (* !  otShear... specifies the Sine and Cosine of the vertical stroke
  211.  *    angle, as two fixed point binary fractions.  Both must be specified:
  212.  *    first the Sine and then the Cosine.  Setting the sine component
  213.  *    changes the Shear to an undefined value, setting the cosine
  214.  *    component completes the Shear change to the new composite value.
  215.  *    For no shear, set to 0.0, 1.0 (encoded as 0x00000000, 0x00010000).
  216.  *    This is the default value. *)
  217.   otShearSin * = otLevel0 + 0AH;
  218.   otShearCos * = otLevel0 + 0BH;
  219.  
  220. (* !  otRotate... specifies the Sine and Cosine of the baselin rotation
  221.  *    angle, as two fixed point binary fractions.  Both must be specified:
  222.  *    first the Sine and then the Cosine.  Setting the sine component
  223.  *    changes the Shear to an undefined value, setting the cosine
  224.  *    component completes the Shear change to the new composite value.
  225.  *    For no shear, set to 0.0, 1.0 (encoded as 0x00000000, 0x00010000).
  226.  *    This is the default value. *)
  227.   otRotateSin * = otLevel0 + 0CH;
  228.   otRotateCos * = otLevel0 + 0DH;
  229.  
  230. (* !  otEmbolden... specifies values to algorithimically embolden -- or,
  231.  *    when negative, lighten -- the glyph.  It is encoded as a fixed point
  232.  *    binary fraction of the em-square.  The X and Y components can be
  233.  *    changed indendently.  For normal characters, set to 0.0, 0.0
  234.  *    (encoded as 0x00000000, 0x00000000).  This i