home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / at-inc-bin.lha / os-include / diskfont / diskfonttag.h < prev    next >
C/C++ Source or Header  |  1993-10-15  |  13KB  |  293 lines

  1. #ifndef  DISKFONT_DISKFONTTAG_H
  2. #define  DISKFONT_DISKFONTTAG_H
  3. /*
  4. **    $VER: diskfonttag.h 10.4 (14.7.92)
  5. **    Includes Release 40.15
  6. **
  7. **    diskfonttag.h -- tag definitions for .otag files
  8. **
  9. **    (C) Copyright 1990-1992 Robert R. Burns
  10. **        All Rights Reserved
  11. */
  12. #ifndef    EXEC_TYPES_H
  13. #include    "exec/types.h"
  14. #endif
  15.  
  16. #ifndef    UTILITY_TAGITEM_H
  17. #include    "utility/tagitem.h"
  18. #endif
  19.  
  20. /* Level 0 entries never appear in the .otag tag list, but appear in font
  21.  * specifications */
  22. #define  OT_Level0    TAG_USER
  23. /* Level 1 entries are required to exist in the .otag tag list */
  24. #define  OT_Level1    (TAG_USER | 0x1000)
  25. /* Level 2 entries are optional typeface metric tags */
  26. #define  OT_Level2    (TAG_USER | 0x2000)
  27. /* Level 3 entries are required for some OT_Engines */
  28. #define  OT_Level3    (TAG_USER | 0x3000)
  29. /* Indirect entries are at (tag address + data offset) */
  30. #define  OT_Indirect    0x8000
  31.  
  32.  
  33. /********************************************************************/
  34. /* font specification and inquiry tags */
  35.  
  36. /* !  tags flagged with an exclaimation mark are valid for
  37.  *    specification.
  38.  *  ? tags flagged with a question mark are valid for inquiry
  39.  *
  40.  * fixed binary numbers are encoded as 16 bits of integer and
  41.  * 16 bits of fraction.  Negative values are indicated by twos
  42.  * complement of all 32 bits.
  43.  */
  44.  
  45. /* !  OT_DeviceDPI specifies the target device dots per inch -- X DPI is
  46.  *    in the high word, Y DPI in the low word. */
  47. #define  OT_DeviceDPI    (OT_Level0 | 0x01)    /* == TA_DeviceDPI */
  48.  
  49. /* !  OT_DotSize specifies the target device dot size as a percent of
  50.  *    it's resolution-implied size -- X percent in high word, Y percent
  51.  *    in low word. */
  52. #define  OT_DotSize    (OT_Level0 | 0x02)
  53.  
  54. /* !  OT_PointHeight specifies the requested point height of a typeface,
  55.  *    specifically, the height and nominal width of the em-square.
  56.  *    The point referred to here is 1/72".  It is encoded as a fixed
  57.  *    binary number. */
  58. #define  OT_PointHeight    (OT_Level0 | 0x08)
  59.  
  60. /* !  OT_SetFactor specifies the requested set width of a typeface.
  61.  *    It distorts the width of the em-square from that specified by
  62.  *    OT_PointHeight.  To compensate for a device with different
  63.  *    horizontal and vertical resolutions, OT_DeviceDPI should be used
  64.  *    instead.    For a normal aspect ratio, set to 1.0 (encoded as
  65.  *    0x00010000).  This is the default value. */
  66. #define  OT_SetFactor    (OT_Level0 | 0x09)
  67.  
  68. /* !  OT_Shear... specifies the Sine and Cosine of the vertical stroke
  69.  *    angle, as two fixed point binary fractions.  Both must be specified:
  70.  *    first the Sine and then the Cosine.  Setting the sine component
  71.  *    changes the Shear to an undefined value, setting the cosine
  72.  *    component completes the Shear change to the new composite value.
  73.  *    For no shear, set to 0.0, 1.0 (encoded as 0x00000000, 0x00010000).
  74.  *    This is the default value. */
  75. #define  OT_ShearSin    (OT_Level0 | 0x0a)
  76. #define  OT_ShearCos    (OT_Level0 | 0x0b)
  77.  
  78. /* !  OT_Rotate... specifies the Sine and Cosine of the baselin rotation
  79.  *    angle, as two fixed point binary fractions.  Both must be specified:
  80.  *    first the Sine and then the Cosine.  Setting the sine component
  81.  *    changes the Shear to an undefined value, setting the cosine
  82.  *    component completes the Shear change to the new composite value.
  83.  *    For no shear, set to 0.0, 1.0 (encoded as 0x00000000, 0x00010000).
  84.  *    This is the default value. */
  85. #define  OT_RotateSin    (OT_Level0 | 0x0c)
  86. #define  OT_RotateCos    (OT_Level0 | 0x0d)
  87.  
  88. /* !  OT_Embolden... specifies values to algorithimically embolden -- or,
  89.  *    when negative, lighten -- the glyph.  It is encoded as a fixed point
  90.  *    binary fraction of the em-square.  The X and Y components can be
  91.  *    changed indendently.  For normal characters, set to 0.0, 0.0
  92.  *    (encoded as 0x00000000, 0x00000000).  This is the default value. */
  93. #define  OT_EmboldenX    (OT_Level0 | 0x0e)
  94. #define  OT_EmboldenY    (OT_Level0 | 0x0f)
  95.  
  96. /* !  OT_PointSize is an old method of specifying the point size,
  97.  *    encoded as (points * 16). */
  98. #define  OT_PointSize    (OT_Level0 | 0x10)
  99.  
  100. /* !  OT_GlyphCode specifies the glyph (character) code to use with
  101.  *    subsequent operations.  For example, this is the code for an
  102.  *    OT_Glyph inquiry */
  103. #define  OT_GlyphCode    (OT_Level0 | 0x11)
  104.  
  105. /* !  OT_GlyphCode2 specifies the second glyph code.  For example,
  106.  *    this is the right glyph of the two glyphs of an OT_KernPair
  107.  *    inquiry */
  108. #define  OT_GlyphCode2    (OT_Level0 | 0x12)
  109.  
  110. /* !  OT_GlyphWidth specifies a specific width for a glyph.
  111.  *    It sets a specific escapement (advance) width for subsequent
  112.  *    glyphs.  It is encoded as a fixed binary fraction of the em-square.
  113.  *    To revert to using the font-defined escapement for each glyph, set
  114.  *    to 0.0 (encoded as 0x00000000).  This is the default value. */
  115. #define  OT_GlyphWidth    (OT_Level0 | 0x13)
  116.  
  117. /* !  OT_OTagPath and
  118.  * !  OT_OTagList specify the selected typeface.  Both must be specified:
  119.  *    first the Path and then the List.  Setting the path name changes
  120.  *    changes the typeface to an undefined value, providing the List
  121.  *    completes the typeface selection to the new typeface.  OTagPath
  122.  *    is the null terminated full file path of the .otag file associated
  123.  *    with the typeface.  OTagList is a memory copy of the processed
  124.  *    contents of that .otag file (i.e. with indirections resolved).
  125.  *    There are no default values for the typeface. */
  126. #define  OT_OTagPath    (OT_Level0 | OT_Indirect | 0x14)
  127. #define  OT_OTagList    (OT_Level0 | OT_Indirect | 0x15)
  128.  
  129. /*  ? OT_GlyphMap supplies a read-only struct GlyphMap pointer that
  130.  *    describes a bitmap for a glyph with the current attributes. */
  131. #define  OT_GlyphMap    (OT_Level0 | OT_Indirect | 0x20)
  132.  
  133. /*  ? OT_WidthList supplies a read-only struct MinList of struct
  134.  *    GlyphWidthEntry nodes for glyphs that are defined from GlyphCode
  135.  *    to GlyphCode2, inclusive.  The widths are represented as fixed
  136.  *    binary fractions of the em-square, ignoring any effect of
  137.  *    SetFactor or GlyphWidth.    A width would need to be converted to
  138.  *    a distance along the baseline in device units by the
  139.  *    application. */
  140. #define  OT_WidthList    (OT_Level0 | OT_Indirect | 0x21)
  141.  
  142. /*  ? OT_...KernPair supplies the kern adjustment to be added to the
  143.  *    current position after placement of the GlyphCode glyph and
  144.  *    before placement of the GlyphCode2 glyph.  Text kern pairs are
  145.  *    for rendering body text.    Display kern pairs are generally
  146.  *    tighter values for display (e.g. headline) purposes.  The
  147.  *    adjustment is represented as a fixed binary fraction of the
  148.  *    em-square, ignoring any effect of SetFactor.  This number would
  149.  *    need to be converted to a distance along the baseline in device
  150.  *    units by the application. */
  151. #define  OT_TextKernPair (OT_Level0 | OT_Indirect | 0x22)
  152. #define  OT_DesignKernPair (OT_Level0 | OT_Indirect | 0x23)
  153.  
  154. /*  ? OT_Underlined is an unsigned word which is used to request
  155.  *    algorithimic underlining for the engine when rendering the glyph.
  156.  *    Bullet.library currently does not support this tag, though it
  157.  *    may be used by other engines in the future.  The default for
  158.  *    any engine which supports this tag must be OTUL_None.  Engines which
  159.  *    do not support this tag should return an appropriate OTERR value.
  160.  *
  161.  *    As of V39, diskfont.library will request underlining if specified
  162.  *    in the TextAttr, or TTextAttr passed to OpenDiskFont().  Diskfont
  163.  *    will first request Broken underlining (like the Text() function
  164.  *    does when SetSoftStyle() is used), and then Solid underlining if
  165.  *    the engine returns an error.  If the engine returns an error for
  166.  *    both, then diskfont.library attempts to find, or create the best
  167.  *    non-underlined font that it can. */
  168. #define  OT_UnderLined        (OT_Level0 | 0x24)
  169.  
  170. #define  OTUL_None        0
  171. #define  OTUL_Solid        1
  172. #define  OTUL_Broken        2
  173. #define  OTUL_DoubleSolid    3
  174. #define  OUTL_DoubleBroken    4
  175.  
  176. /*  ? OT_StrikeThrough is a boolean which is used to request
  177.  *    algorithimic strike through when rendering the glyph.
  178.  *    Bullet.library currently does not support this tag, though it
  179.  *    may be used by other engines in the future.  The default for
  180.  *    any engined which supports this tag must be FALSE.  Engines which
  181.  *    do not support this tag should return an appropriate OTERR value. */
  182. #define  OT_StrikeThrough    (OT_Level0 | 0x25)
  183.  
  184.  
  185. /********************************************************************/
  186. /* .otag tags */
  187.  
  188. /* suffix for files in FONTS: that contain these tags */
  189. #define  OTSUFFIX    ".otag"
  190.  
  191. /* OT_FileIdent both identifies this file and verifies its size.
  192.  * It is required to be the first tag in the file. */
  193. #define  OT_FileIdent    (OT_Level1 | 0x01)
  194.  
  195. /* OT_Engine specifies the font engine this file is designed to use */
  196. #define  OT_Engine    (OT_Level1 | OT_Indirect | 0x02)
  197. #define  OTE_Bullet    "bullet"
  198.  
  199. /* OT_Family is the family name of this typeface */
  200. #define  OT_Family    (OT_Level1 | OT_Indirect | 0x03)
  201.  
  202. /* The name of this typeface is implicit in the name of the .otag file */
  203. /* OT_BName is used to find the bold variant of this typeface */
  204. #define  OT_BName    (OT_Level2 | OT_Indirect | 0x05)
  205. /* OT_IName is used to find the italic variant of this typeface */
  206. #define  OT_IName    (OT_Level2 | OT_Indirect | 0x06)
  207. /* OT_BIName is used to find the bold italic variant of this typeface */
  208. #define  OT_BIName    (OT_Level2 | OT_Indirect | 0x07)
  209.  
  210. /* OT_SymSet is used to select the symbol set that has the OT_YSizeFactor
  211.  * described here.  Other symbol sets might have different extremes */
  212. #define  OT_SymbolSet    (OT_Level1 | 0x10)
  213.  
  214. /* OT_YSizeFactor is a ratio to assist in calculating the Point height
  215.  * to BlackHeight relationship -- high word: Point height term, low
  216.  * word: Black height term -- pointSize = ysize*<high>/<low> */
  217. #define  OT_YSizeFactor    (OT_Level1 | 0x11)
  218.  
  219. /* OT_SpaceWidth specifies the width of the space character relative
  220.  * to the character height */
  221. #define  OT_SpaceWidth    (OT_Level2 | 0x12)
  222.  
  223. /* OT_IsFixed is a boolean indicating that all the characters in the
  224.  * typeface are intended to have the same character advance */
  225. #define  OT_IsFixed    (OT_Level2 | 0x13)
  226.  
  227. /* OT_SerifFlag is a boolean indicating if the character has serifs */
  228. #define  OT_SerifFlag    (OT_Level1 | 0x14)
  229.  
  230. /* OT_StemWeight is an unsigned byte indicating the weight of the character */
  231. #define  OT_StemWeight    (OT_Level1 | 0x15)
  232.  
  233. #define  OTS_UltraThin      8    /*   0- 15 */
  234. #define  OTS_ExtraThin     24    /*  16- 31 */
  235. #define  OTS_Thin     40    /*  32- 47 */
  236. #define  OTS_ExtraLight     56    /*  48- 63 */
  237. #define  OTS_Light     72    /*  64- 79 */
  238. #define  OTS_DemiLight     88    /*  80- 95 */
  239. #define  OTS_SemiLight    104    /*  96-111 */
  240. #define  OTS_Book    120    /* 112-127 */
  241. #define  OTS_Medium    136    /* 128-143 */
  242. #define  OTS_SemiBold    152    /* 144-159 */
  243. #define  OTS_DemiBold    168    /* 160-175 */
  244. #define  OTS_Bold    184    /* 176-191 */
  245. #define  OTS_ExtraBold    200    /* 192-207 */
  246. #define  OTS_Black    216    /* 208-223 */
  247. #define  OTS_ExtraBlack    232    /* 224-239 */
  248. #define  OTS_UltraBlack    248    /* 240-255 */
  249.  
  250. /* OT_SlantStyle is an unsigned byte indicating the font posture */
  251. #define  OT_SlantStyle    (OT_Level1 | 0x16)
  252. #define  OTS_Upright    0
  253. #define  OTS_Italic    1    /* Oblique, Slanted, etc. */
  254. #define  OTS_LeftItalic    2    /* Reverse Slant */
  255.  
  256. /* OT_HorizStyle is an unsigned byte indicating the appearance width */
  257. #define  OT_HorizStyle    (OT_Level1 | 0x17)
  258. #define  OTH_UltraCompressed     16    /*   0- 31 */
  259. #define  OTH_ExtraCompressed     48    /*  32- 63 */
  260. #define  OTH_Compressed         80    /*  64- 95 */
  261. #define  OTH_Condensed        112    /*  96-127 */
  262. #define  OTH_Normal        144    /* 128-159 */
  263. #define  OTH_SemiExpanded    176    /* 160-191 */
  264. #define  OTH_Expanded        208    /* 192-223 */
  265. #define  OTH_ExtraExpanded    240    /* 224-255 */
  266.  
  267. /* OT_SpaceFactor specifies the width of the space character relative
  268.  * to the character height */
  269. #define  OT_SpaceFactor    (OT_Level2 | 0x18)
  270.  
  271. /* OT_InhibitAlgoStyle indicates which ta_Style bits, if any, should
  272.  * be ignored even if the font does not already have that quality.
  273.  * For example, if FSF_BOLD is set and the typeface is not bold but
  274.  * the user specifies bold, the application or diskfont library is
  275.  * not to use OT_Embolden to achieve a bold result. */
  276. #define  OT_InhibitAlgoStyle (OT_Level2 | 0x19)
  277.  
  278. /* OT_AvailSizes is an indirect pointer to sorted UWORDs, 0th is count */
  279. #define  OT_AvailSizes    (OT_Level1 | OT_Indirect | 0x20)
  280. #define  OT_MAXAVAILSIZES    20    /* no more than 20 sizes allowed */
  281.  
  282. /* OT_SpecCount is the count number of parameters specified here */
  283. #define  OT_SpecCount    (OT_Level1 | 0x100)
  284.  
  285. /* Specs can be created as appropriate for the engine by ORing in the
  286.  * parameter number (1 is first, 2 is second, ... up to 15th) */
  287. #define  OT_Spec    (OT_Level1 | 0x100)
  288. /* OT_Spec1 is the (first) parameter to the font engine to select
  289.  * this particular typeface */
  290. #define  OT_Spec1    (OT_Level1 | 0x101)
  291.  
  292. #endif     /* DISKFONT_DISKFONTTAG_H */
  293.