home *** CD-ROM | disk | FTP | other *** search
/ Encyclopedia of Graphics File Formats Companion / GFF_CD.ISO / formats / presman / spec / pm.txt
Text File  |  1994-06-01  |  77KB  |  2,364 lines

  1.                    OS/2 2.0 Technical Library
  2.  
  3.            Presentation Manager Programming Reference
  4.  
  5.                            Volume III
  6.  
  7.                        Part Number 1OG6272
  8.  
  9. Note
  10.  
  11. Before using this information and the product it supports, be sure
  12. to read the general information under "Notices" on page vii.
  13.  
  14.  
  15. First Edition (March 1992)
  16.  
  17. The following paragraph does not apply to the United Kingdom or
  18. any country where such provisions are inconsistent with local law:
  19. INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS
  20. PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
  21. OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  22. OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states
  23. do not allow disclaimer of express or implied warranties in certain
  24. transactions, therefore, this statement may not apply to you.
  25.  
  26. This publication could include technical inaccuracies or
  27. typographical errors. Changes are periodically made to the
  28. information herein; these changes will be incorporated in new
  29. editions of the publication. IBM may make improvements and/or
  30. changes in the product(s) and/or the program(s) described in this
  31. publication at any time.
  32.  
  33. It is possible that this publication may contain reference to, or
  34. information about, IBM products (machines and programs),
  35. programming, or services that are not announced in your country.
  36. Such references or information must not be construed to mean that
  37. IBM intends to announce such IBM products, programming, or services
  38. in your country.
  39.  
  40. Requests for technical information about IBM products should be
  41. made to your IBM Authorized Dealer or your IBM Marketing
  42. Representative.
  43.  
  44. COPYRIGHT LICENSE: This publication contains printed sample
  45. application programs in source language, which illustrate OS/2
  46. programming techniques. You may copy and distribute these sample
  47. programs in any form without payment to IBM, for the purposes of
  48. developing, using, marketing or distributing application programs
  49. conforming to the OS/2 application programming interface.
  50.  
  51. Each copy of any portion of these sample programs or any derivative
  52. work, which is distributed to others, must include a copyright
  53. notice as follows: "(c) (your company name) (year) All Rights
  54. Reserved."
  55.  
  56. (c) Copyright International Business Machines Corporation 1992. All
  57. rights reserved.
  58. Note to U.S. Government Users--Documentation related to restricted
  59. rights--Use, duplication or disclosure is subject to restrictions
  60. set forth in GSA ADP Schedule Contract with IBM Corp.
  61.  
  62.  
  63. Appendix D. Standard Bit-Map Formats
  64.  
  65. There are four standard bit-map formats. All device drivers have
  66. to be able to translate between any of these formats and their own
  67. internal formats. The standard formats are:
  68.  
  69. Bitcount  Planes
  70. 1         1
  71. 4         1
  72. 8         1
  73. 24        1
  74.  
  75. These formats are chosen because they are identical or similar to
  76. all formats commonly used by raster devices. Only single-plane
  77. formats are standard, but it is very easy to convert these to any
  78. multiple-plane format used internally by a device.
  79.  
  80. Bit-Map Data
  81. The pel data is stored in the bit map in the order that the
  82. coordinates appear on a display screen. That is, the pel in the
  83. lower-left corner is the first in the bit map. Pels are scanned to
  84. the right, and upward, from that position. The bits of the first
  85. pel are stored, beginning with the most significant bits of the
  86. first byte. The data for pels in each scan line is packed together
  87. tightly, but all scan lines are padded at the end, so that each one
  88. begins on a ULONG boundary.
  89.  
  90. Bit-Map Information Tables
  91. Each standard-format bit map must be accompanied by a bit-map
  92. information table. Because the standard-format bit maps are
  93. intended to be traded between devices, the color indexes in the bit
  94. map are meaningless without more information; for a description of
  95. this structure, see BITMAPINFO2.
  96.  
  97. Some calls use a structure that is similar to BITMAPINFO2 but does
  98. not have the color table array; for a description of this
  99. structure, see BITMAPINFOHEADER2. Wherever BITMAPINFO2 is shown,
  100. BITMAPINFO is also allowed. Similarly, wherever BITMAPINFOHEADER2
  101. is shown, BITMAPINFOHEADER is also allowed.
  102.  
  103. Bit-Map Example
  104. To make the ordering of all the bytes clear, consider this simple
  105. example of a 5-by-3 array of colored pels:
  106.  
  107. Red   Green  Blue   Red    Green
  108. Blue  Red    Green  Blue   Red
  109. Green Blue   Red    Green  Blue
  110.  
  111. ULONG ExampleBitmap[] {
  112.      0x23,0x12,0x30,0x00             /* bottom line */
  113.      0x31,0x23,0x10,0x00             /* middle line */
  114.      0x12,0x31,0x20,0x00             /* top line */
  115. };
  116.  
  117. #define BLACK     0X00000000L
  118. #define RED       0X00FF0000L
  119. #define GREEN     0X0000FF00L
  120. #define BLUE      0X000000FFL
  121.  
  122. struct BitmapInfoTable ExampleInfo
  123.        5,                       /* width       */
  124.        3,                       /* height      */
  125.        1,                       /* planes      */
  126.        4,                       /* bitcount    */
  127.        BLACK,RED,GREEN,BLUE,    /* color table */
  128.        BLACK,BLACK,BLACK,BLACK,
  129.        BLACK,BLACK,BLACK,BLACK,
  130.        BLACK,BLACK,BLACK,BLACK
  131. };
  132.  
  133. Bit-Map File Format
  134. The operating system uses the same file format for bit maps, icons,
  135. and pointers in resource files. in the following description, "bit
  136. map" refers to bit maps, icons, and pointers unless otherwise
  137. specified.
  138.  
  139. Two formats are supported. In the first, a single-size version of
  140. the bit map is defined. This is used whatever the target device.
  141.  
  142. The second format allows multiple versions of the bit map to be
  143. defined, including one or more device-independent versions, and a
  144. number of device-dependent versions, each intended for use with a
  145. particular device.
  146.  
  147. In the case of icons and pointers, when more than one version of
  148. the bit map exists, the preferred version is one that matches the
  149. device size of icon or pointer. Otherwise the device-independent
  150. version is used to scale a bit map to the required size.
  151.  
  152. The operating system provides pointers that match the requirements
  153. of the display device in use, typically pointers are 32x32 pels,
  154. one bit per plane.
  155.  
  156. Icons provided with the operating system are designed to match the
  157. requirements of the most common display devices. The following
  158. versions of each icon are included in each file:
  159.  
  160.      32x32 4 bpp (16 color)
  161.      40x40 4 bpp (16 color)
  162.      32x32 1 bpp (black and white)
  163.      20x20 1 bpp (black and white)
  164.      16x16 1 bpp (black and white)
  165.  
  166. The 32x32 versions are designed for VGA displays and for
  167. device-independent use.
  168.  
  169. The 40x40 version is for 8514/A and XGA displays.
  170.  
  171. The 20x20 and 16x16 are half-size icons designed for use as
  172. mini-icons.
  173.  
  174. For general bit maps, which may be of arbitrary size, the preferred
  175. version is one matching the requested bit map size; otherwise one
  176. matching the display size is selected. If neither is available, the
  177. device-independent version is used from which to scale a bit map.
  178.  
  179. For both formats, the definition consists of two sections. The
  180. first section contains general information about the type,
  181. dimensions, and other attributes of the resource. The second
  182. section contains data describing the pels that make up the bit
  183. map(s), and is in the format specified in "Bit-Map Data" on page
  184. D-1.
  185.  
  186. In the multiple-version format, the first section contains an array
  187. of BITMAPARRAYFILEHEADER structures. or BITMAPARRAYFILEHEADER2
  188. structures. The format of these is as follows:
  189.  
  190. typedef struct _BITMAPARRAYFILEHEADER {     /* bafh */
  191.       USHORT             usType;
  192.       ULONG              cbSize;
  193.       ULONG              offNext;
  194.       USHORT             cxDisplay;
  195.       USHORT             cyDisplay;
  196.       BITMAPFILEHEADER   bfh;
  197. } BITMAPARRAYFILEHEADER;
  198. typedef BITMAPARRAYFILEHEADER *PBITMAPARRAYFILEHEADER;
  199.  
  200. typedef struct _BITMAPARRAYFILEHEADER2 {    /* bafh */
  201.  
  202.       USHORT             usType;
  203.       ULONG              cbSize;
  204.       ULONG              offNext;
  205.       USHORT             cxDisplay;
  206.       USHORT             cyDisplay;
  207.       BITMAPFILEHEADER2  bfh2;
  208. } BITMAPARRAYFILEHEADER2;
  209. typedef BITMAPARRAYFILEHEADER2 *PBITMAPARRAYFILEHEADER2;
  210.  
  211. The fields in BITMAPARRAYFILEHEADER and BITMAPARRAYFILEHEADER2 have
  212. these meanings:
  213.  
  214. usType                   Type of structure. This is:
  215.  
  216.                          BFT_BITMAPARRAY (X'4142'--`BA'for
  217.                          BITMAPARRAYFILEHEADER or
  218.                          BITMAPARRAYFILEHEADER2)
  219.  
  220. cbSize                   Size of the BITMAPARRAYFILEHEADER or
  221.                          BITMAPARRAYFILEHEADER2 structure in bytes.
  222.  
  223. offNext                  Offset of the next BITMAPARRAYFILEHEADER
  224.                          or BITMAPARRAYFILEHEADER2 structure from
  225.                          the start of the file
  226.  
  227. cxDisplay, CyDisplay     Pel dimensions of the device for which
  228.                          this version is intended (for example,
  229.                          640 x 480 for VGA).
  230.  
  231. The device-independent version must be the first
  232. BITMAPARRAYFILEHEADER or BITMAPARRAYFILEHEADER2 defined.
  233.  
  234. In the single-size format, the BITMAPARRAYFILEHEADER or
  235. BITMAPARRAYFILEHEADER2 structure is not present. The definition
  236. consists of one or two BITMAPFILEHEADER or BITMAPFILEHEADER2
  237. structures.
  238.  
  239. The format of the BITMAPFILEHEADER and BITMAPFILEHEADER2 structure
  240. is:
  241.  
  242. typedef struct _BITMAPFILEHEADER {          /* bfh */
  243.  
  244.       USHORT             usType;
  245.       ULONG              cbSize;
  246.       SHORT              xHotspot;
  247.       SHORT              yHotspot;
  248.       ULONG              offBits;
  249.       BITMAPINFOHEADER   bmp;
  250. } BITMAPFILEHEADER;
  251. typedef BITMAPFILEHEADER *PBITMAPFILEHEADER;
  252.  
  253. typedef struct _BITMAPFILEHEADER2           /* bfh2 */
  254.  
  255.       USHORT             usType;
  256.       ULONG              cbSize;
  257.       SHORT              xHotspot;
  258.       SHORT              yHotspot;
  259.       ULONG              offBits;
  260.       BITMAPINFOHEADER2  bmp2;
  261. } BITMAPFILEHEADER2;
  262. typedef BITMAPFILEHEADER2 *PBITMAPFILEHEADER2;
  263.  
  264. BITMAPINFOHEADER2 is a standard data type (see above, and also
  265. BITMAPINFOHEADER2).
  266.  
  267. The fields in BITMAPFILEHEADER and BITMAPFILEHEADER2 have these
  268. meanings:
  269.  
  270. usType              Type of resource the file contains. The valid
  271.                     values are:
  272.  
  273.                     BFT_BMAP (X'4D42'--`BM' for bit maps)
  274.                     BFT_ICON (X'4349'--`IC' for icons)
  275.                     BFT_POINTER (X'5450'--`PT' for pointers).
  276.                     BFT_COLORICON (X'4943'--`CI' for color icons).
  277.                     BFT_COLORPOINTER (X'5043'--`CP' for color
  278.                     pointers).
  279.  
  280. cbSize              Size of the BITMAPFILEHEADER or
  281.                     BITMAPFILEHEADER2 structure in bytes.
  282.  
  283. xHotspot, yHotspot  Coordinates of the hotspot for icons and
  284.                     pointers. This field is ignored for bit maps.
  285.  
  286. offBits             Offset in bytes to the beginning of the bit-map
  287.                     pel data in the file, from the start of the
  288.                     definition.
  289.  
  290. For icons and pointers, the cy field in bmp is actually twice the
  291. pel height of the image that appears on the screen. This is because
  292. these types actually contain two full bit-map pel definitions. The
  293. first bit-map definition is the XOR mask, which contains invert
  294. information (0 = no invert, 1 = invert) for the pointer or icon.
  295. The second is the AND mask, which determines whether the pointer
  296. or the screen is shown (0 = black/white, 1 = screen/inverse
  297. screen).
  298.  
  299. For color icons or pointers, there are two bit-maps involved: one
  300. that is black and white and consists of an AND and an XOR mask,
  301. and one that is color that defines the color content.
  302.  
  303. The cy field in the BITMAPINFOHEADER2 structure for the color
  304. bit-map must be the real height, that is, half the value specified
  305. for the black and white bit-map. The cx fields must be the same.
  306.  
  307. The following table shows how these two bit-maps are used for a
  308. color icon or pointer:
  309.  
  310.      XOR     AND     COLOR
  311.       1       1        x         Invert screen
  312.       0       0        x         Use color x
  313.       0       1        x         Transparency
  314.       1       0        x         Use color x
  315.  
  316. For color icons or pointers, two BITMAPFILEHEADER or
  317. BITMAPFILEHEADER2 structures are therefore required:
  318.  
  319. BITMAPFILEHEADER2     with ustype BFT_COLORICON or BFT-COLORPOINTER
  320.    BITMAPINFOHEADER2 (part of BITMAPFILEHEADER2)
  321.    Color table
  322. BITMAPFILEHEADER2     with same ustype
  323.    BITMAPINFOHEADER2 (part of BITMAPFILEHEADER2)
  324.    Color table
  325. **
  326. bits for one bit-map
  327. **
  328. **
  329. bits for other bit-map
  330. **
  331.  
  332. The ustype for the first BITMAPFILEHEADER2 is either BFT_COLORICON
  333. or BFT_COLORPOINTER. This means that a second BITMAPFILEHEADER2 is
  334. present as part of the definition of a color icon or pointer. The
  335. first BITMAPFILEHEADER2 structure contains the information for the
  336. black and white AND and XOR masks, while the second
  337. BITMAPFILEHEADER2 structure contains the information for the color
  338. part of the pointer or icon.
  339.  
  340. BITMAPFILEHEADER and BITMAPINFOHEADER can occur in place of
  341. BITMAPFILEHEADER2 and BITMAPINFOHEADER2 in this example.
  342.  
  343. For the multiple version format, the file is as follows:
  344.  
  345. BITMAPARRAYFILEHEADER2    for device-independent version
  346.    BITMAPFILEHEADER2      (part of BITMAPARRAYFILEHEADER2)
  347.       BITMAPINFOHEADER2   (part of BITMAPFILEHEADER2)
  348.       Color table
  349.  
  350.     BITMAPFILEHEADER2     )
  351.        BITMAPINFOHEADER2  ) only if this is a color icon or pointer
  352.        Color table        )
  353.  
  354. BITMAPARRAYFILEHEADER2    for first device-dependent version
  355.    BITMAPFILEHEADER2      (part of BITMAPARRAYFILEHEADER2)
  356.       BITMAPINFOHEADER2   (part of BITMAPFILEHEADER2)
  357.       Color table
  358.  
  359.     BITMAPFILEHEADER2     )
  360.        BITMAPINFOHEADER2  ) only if this is a color icon or pointer
  361.        Color table        )
  362.  
  363.  
  364. Further BITMAPARRAYFILEHEADER2 groups occur here as required for
  365. additional device-dependent versions
  366.  
  367. **
  368. bits for one bit-map
  369. **
  370. **
  371. bits for next bit-map
  372. **
  373.  
  374. And so on for as many bit-maps as necessary.
  375.  
  376. As before, BITMAPARRAYFILEHEADER, BITMAPFILEHEADER and
  377. BITMAPINFOHEADER can occur in place of BITMAPARRAYFILEHEADER2,
  378. BITMAPFILEHEADER2 and BITMAPINFOHEADER2.
  379.  
  380.  
  381. Appendix F. The Font-File Format
  382.  
  383. The OS/2 font-file format consists of two sections. The first
  384. section contains the general attributes of the font, and describes
  385. features such as its typeface, style, and nominal size. The second
  386. section contains the actual definitions of the characters belonging
  387. to the font.
  388.  
  389. The font resource is a set of self-defining records of the form:
  390. typedef struct _RECORD {
  391.       ULONG     ulIdentity;        /* structure identity code */
  392.       ULONG     ulsize;            /* structure size in bytes */
  393.         .                          /*  data */
  394.         .
  395.         .
  396.       } RECORD;
  397.  
  398. A font starts with a special font-signature structure and ends with
  399. an ending structure. The font signature has the form:
  400.  
  401. typedef struct _FONTSIGNATURE
  402.         ULONG  ulIdentity;
  403.         ULONG  ulSize;
  404.         CHAR   achSignature [12]
  405.         } FONTSIGNATURE;
  406.  
  407. where:
  408.  
  409. ulIdentity     = X'FFFFFFFE'
  410. ulSize         = 20
  411. achSignature   = "OS/2 FONT"   for an OS/2 1.x format font, or
  412.                = "OS/2 FONT 2" for an OS/2 2.0 format font.
  413.  
  414. A 2.0 format font includes additional font description information
  415. in the PANOSE structure. This structure will be added to the end
  416. of the .FNT file (prior to the ENDFONT record).
  417.  
  418. The font end structure has the form:
  419.  
  420. typedef struct _ENDFONT{
  421.         ULONG   ulIdentity;
  422.         ULONG   ulSize;
  423.         }ENDFONT
  424.  
  425. where:
  426.  
  427. ulIdentity    = X'FFFFFFFFI
  428. ulSize        = 8
  429.  
  430. All records should be in the order of their identity fields.
  431.  
  432. There are three or four records in a font resource between the font
  433. signature and the font end:
  434.  
  435.   *  The font metrics
  436.   *  The font character definitions
  437.   *  The pair kerning table.
  438.   *  The PANOSE description (for "OS/2 FONT 2" fonts).
  439.  
  440. Following compilation, the records in the resource are in the order
  441. defined above.
  442.  
  443.  
  444. Metric Information Contained in Fonts
  445.  
  446. This section gives an explanation of how to set the fields of the
  447. FOCAMETRICS structure when developing:
  448.  
  449.   *  A bit map or outline font for general use by PM graphics
  450.      applications
  451.  
  452.   *  A description of a bit map or outline device font that is
  453.      built in to a device or can be downloaded to a device.
  454.  
  455. The following structure contains the physical font metrics used
  456. when creating fonts. It is defined in the file \INCLUDE\PMFONT.H.
  457.  
  458. typedef struct _FOCAMETRICS {
  459.      ULONG          ulIdentity;
  460.      ULONG          ulSize;
  461.      CHAR           szFamilyname[321;
  462.      CHAR           szFacename[321;
  463.      SHORT          usRegistryId;
  464.      SHORT          usCodePage;
  465.      SHORT          yEmHeight;
  466.      SHORT          yXHeight;
  467.      SHORT          yMaxAscender;
  468.      SHORT          yMaxDescender;
  469.      SHORT          yLowerCaseAscent;
  470.      SHORT          yLowerCaseDescent;
  471.      SHORT          yInternalLeading;
  472.      SHORT          yExternalLeading;
  473.      SHORT          xAveCharWidth;
  474.      SHORT          xMaxCharInc;
  475.      SHORT          xEmInc;
  476.      SHORT          yMaxBaselineExt;
  477.      SHORT          sCharSlope;
  478.      SHORT          sInlineDir;
  479.      SHORT          sCharRot;
  480.      USHORT         usWeightClass;
  481.      USHORT         usWidthClass;
  482.      SHORT          xDeviceRes;
  483.      SHORT          yDeviceRes;
  484.      SHORT          usFirstChar;
  485.      SHORT          usLastChar;
  486.      SHORT          usDefauItChar;
  487.      SHORT          usBreakChar;
  488.      SHORT          usNominalPointSize;
  489.      SHORT          usMinimumPointSize;
  490.      SHORT          usMaximumPointSize;
  491.      SHORT          fsTypeFlags;
  492.      SHORT          fsdefn;
  493.      SHORT          fsSelectionFlags;
  494.      SHORT          fscapabilities;
  495.      SHORT          ySubscriptXSize;
  496.      SHORT          ySubscriptYSize;
  497.      SHORT          ySubscriptXOffset;
  498.      SHORT          ySubscriptYOffset;
  499.      SHORT          ySuperscriptXSize;
  500.      SHORT          ySuperscriptYSize;
  501.      SHORT          ySuperscriptXOffset;
  502.      SHORT          ySuperscriptYOffset;
  503.      SHORT          yUnderscoreSize;
  504.      SHORT          yUnderscorePosition;
  505.      SHORT          yStrikeoutSize;
  506.      SHORT          yStrikeoutPosition;
  507.      SHORT          usKerningPairs;
  508.      SHORT          sFamilyClass;
  509.      PSZ            pszDeviceNameOffset;
  510.   }  FOCAMETRICS;
  511.  
  512. Note:  FOCAMETRICS is a parallel structure with FONTMETRICS as
  513.        returned to applications in the GpiQueryFonts and
  514.        GpiQueryFontMetrics function calls.
  515.  
  516. The FONTMETRICS fields are derived from FOCAMETRICS by the
  517. Presentation Manager graphics engine. Most values are passed though
  518. unchanged. The exceptions are:
  519.  
  520.   *  The identity field. This must be 1. This field is not a part
  521.      of the FONTMETRICS structure.
  522.  
  523.   *  The Size field. This must be set to the size of the
  524.      FOCAMETRICS structure. This field is not a part of the
  525.      FONTMETRICS structure.
  526.  
  527.   *  The Codepage field. Ignore the description in FONTMETRICS,
  528.      and use the following:
  529.  
  530.          Place 850 in this field if the font is intended to
  531.          support any PM supported code page. The list of
  532.          Presentation Manager supported code pages is given in
  533.          Chapter 34, "Code Pages" on page 34-1.
  534.  
  535.          Place 65400 in this field if the font has special glyphs,
  536.          for example if it is a Symbol font.
  537.  
  538.          Place other valid code pages in this field if the font is
  539.          specific to this code page. Do not place other values in
  540.          this field.
  541.  
  542.      * FONTMETRICS fields which contain values in world
  543.        coordinates. The corresponding field in FOCAMETRICS should
  544.        contain pel values for bit-map fonts, and notional units for
  545.        outline fonts.
  546.  
  547. See FONTMETRICS on page A-56 for a detailed explanation of the
  548. fields.
  549.  
  550.  
  551. Font Character Definitions
  552.  
  553. Two formats of font character definition are supported. These are:
  554.  
  555. Image format
  556.      The character glyphs are represented as pel images.
  557.  
  558. Outline format
  559.      The character glyphs are represented by vector data that
  560.      traces the outline of the character.
  561.  
  562.      Note: Intelligent Font Technology fonts (such as ATM Type-1
  563.      fonts) may be stored in a technology specific format, and thus
  564.      will not conform to this definition for outline fonts.
  565.  
  566. The definition consists of a header portion and a portion carrying
  567. the characters themselves.
  568.  
  569. The header portion contains information about the format of the
  570. character definitions and data about each character including width
  571. data and the offset into the definition section at which the
  572. character definition begins. (See "a-space, b-space, c-space" on
  573. page F-13.)
  574.  
  575.   1. Proportional characters (a + b+ c = character increment) for
  576.      each character:
  577.      a,b,c ***> 0
  578.  
  579.   2. Characters where a, b, and c are definitions for all
  580.      characters:
  581.  
  582.      b ***> 0
  583.      a, c any integer
  584.  
  585. Raster fonts contain a "null character." The character definition
  586. record for this occurs after the one for the last character. Thus
  587. the format has usLastChar + 2 characters, although the null
  588. character is not counted in the range returned. The null character
  589. is composed of zeros and is always eight pels wide.
  590.  
  591.  
  592. Font Definition Header
  593.  
  594. This structure defines the format or the character definition
  595. records that follow it:
  596.  
  597.     typedef struct_FONTDEFINITIONHEADER {
  598.      ULONG     ulIdentity;
  599.      ULONG     ulSize;
  600.      SHORT     fsfontdef;
  601.      SHORT     fschardef;
  602.      SHORT     usCellSize;
  603.      SHORT     xCellWidth;
  604.      SHORT     yCellHeight;
  605.      SHORT     xCellIncrement;
  606.      SHORT     xCellA;
  607.      SHORT     xCellB;
  608.      SHORT     xCellC;
  609.      SHORT     pCellBaseOffset;
  610.      } FONTDEFINITIONHEADER;
  611. typedef FONTDEFINITIONHEADER FAR *PFONTDEFINITIONHEADER;
  612.  
  613. ulIdentity       4 bytes.
  614.  
  615.                  Must be equal to 2.
  616.  
  617. ulSize           4 bytes.
  618.  
  619.                  Size of this structure in bytes.
  620.  
  621. fsFontdef        2 bytes of flags.
  622.  
  623.                  Indicates which fields are present in the font
  624.                  definition data in the header.
  625.  
  626.                  Type 1
  627.  
  628.                  Bit 0     1 = width defined in header
  629.                  Bit 1     1 = height defined in header
  630.                  Bit 2     1 = char increment same as width, so
  631.                            that it is defined for the whole font
  632.                  Bit 3     0 = a-space not defined
  633.                  Bit 4     0 = b-space not defined
  634.                  Bit 5     0 = c-space not defined
  635.                  Bit 6     1 = base offset same for all characters.
  636.  
  637.                  Type 2
  638.  
  639.                  Bit 0     0 = width for each character unique
  640.                  Bit 1     1 = height defined in header
  641.                  Bit 2     0 = char increment same as width, so
  642.                            that it is unique for each character
  643.                  Bit 3     0 = a-space not defined
  644.                  Bit 4     0 = b-space not defined
  645.                  Bit 5     0 = c-space not defined
  646.                  Bit 6     1 = base offset same for all characters.
  647.  
  648.                  Type 3
  649.  
  650.                  Bit 0     0 = width for each character unique
  651.                  Bit 1     1 = height defined in header
  652.                  Bit 2     0 = char increment same as width, so
  653.                            that it is unique
  654.                  Bit 3     0 = a-space not defined
  655.                  Bit 4     0 = b-space not defined
  656.                  Bit 5     0 = c-space not defined
  657.                  Bit 6     1 = base offset same for all characters.
  658.  
  659. FaChardef        2 bytes of flags.
  660.                  Indicates which fields are present on a per
  661.                  character basis.
  662.  
  663.                  Type 1
  664.  
  665.                  Bit 0     1 = width defined for each character
  666.                            (performance op)
  667.                  Bit 1     0 = height is in header
  668.                  Bit 2     0 = char increment is in header
  669.                  Bit 3     0 = a-space not defined
  670.                  Bit 4     0 = b-space not defined
  671.                  Bit 5     0 = c-space not defined
  672.                  Bit 6     0 = base offset defined in header
  673.                  Bit 7     1 = offset to glyph defined.
  674.  
  675.                  Type 2
  676.  
  677.                  Bit 0     1 = width defined for each character
  678.                  Bit 1     0 = height is in header
  679.                  Bit 2     0 = char increment same as width
  680.                  Bit 3     0 = a-space not defined
  681.                  Bit 4     0 = b-space not defined
  682.                  Bit 5     0 = c-space not defined
  683.                  Bit 6     0 = base offset defined in header
  684.                  Bit 7     1 = offset to glyph defined.
  685.  
  686.                  Type 3
  687.  
  688.                  Bit 0     1 = width not defined, use a, b, c
  689.                  Bit 1     0 = height is in header
  690.                  Bit 2     0 = char increment same as width
  691.                  Bit 3     1 = a-space defined
  692.                  Bit 4     1 = b-space defined
  693.                  Bit 5     1 = c-space defined
  694.                  Bit 6     0 = base offset defined in header
  695.                  Bit 7     1 = offset to glyph defined.
  696.  
  697. usCellSize       2-byte integer.
  698.  
  699.                  Indicates the length in bytes of each character
  700.                  definition record (the per character data).
  701.  
  702.                  Type 1    6 bytes
  703.                  Type 2    6 bytes
  704.                  Type 3    10 bytes.
  705.  
  706. xCellWidth       2-byte integer
  707.  
  708.                  The width of the characters, in pels for image
  709.                  fonts, and relative units for outline fonts.
  710.  
  711.                  Type 1    Width of the characters
  712.                  Type 2    Zero
  713.                  Type 3    Zero.
  714.  
  715. yCellHeight      2-byte integer.
  716.  
  717.                  The height of the characters, in pels for image
  718.                  fonts, and relative units for outline fonts.
  719.  
  720.                  Type 1    Height of the characters
  721.                  Type 2    Height of the characters
  722.                  Type 3    Height of the characters.
  723.  
  724. xCellincrement   2-byte integer.
  725.  
  726.                  The distance along the character baseline required
  727.                  to step from one character to the next (when
  728.                  forming a character string).
  729.  
  730.                  Type 1    Width of the characters
  731.                  Type 2    Zero
  732.                  Type 3    Zero.
  733.  
  734. xCellA           2-byte signed integer.
  735.  
  736.                  The width of the space before a character in the
  737.                  inline direction (the a-space).
  738.  
  739.                  Type 1    Zero
  740.                  Type 2    Zero
  741.                  Type 3    a-space for all characters.
  742.  
  743. xCellB           2-byte integer.
  744.  
  745.                  The width of a character (inline direction). The
  746.                  b-space.
  747.  
  748.                  Type 1    Zero
  749.                  Type 2    Zero
  750.                  Type 3    b-space for all characters.
  751.  
  752. xcellc           2-byte signed integer.
  753.  
  754.                  The width of the space after a character in the
  755.                  inline direction (the c-space).
  756.  
  757.                  Type 1    Zero
  758.                  Type 2    Zero
  759.                  Type 3    c-space for all characters.
  760.  
  761. pCellBaseOffset  2-byte signed integer.
  762.  
  763.                  The position of the top of a character definition
  764.                  relative to the baseline in the direction
  765.                  perpendicular to the baseline.
  766.  
  767.                  Type 1  Baseline offset for all characters
  768.                  Type 2  Baseline offset for all characters
  769.                  Type 3  Baseline offset for all characters.
  770.  
  771. Character Definition Record
  772.                  xCellSize bytes per record.
  773.  
  774.                  The following fields may or may not be present,
  775.                  according to the font character definition fields
  776.                  flags. if a field is present, it is present for
  777.                  each character and the value applies to that
  778.                  character only.
  779.  
  780.                  There are usLastChar+2 such records for raster
  781.                  fonts. The final one is for the null character.
  782.  
  783.                   * Character Definition Offset: 4-byte integer.
  784.  
  785.                     The offset into the Font File at which the
  786.                     character definition begins.
  787.  
  788.                     Data for a single character raster or vector
  789.                     should not span two segments; that is, if a
  790.                     character is too big to fit into a segment it
  791.                     should be put in the next segment.
  792.  
  793.                     This field should be set to zero if the
  794.                     character being defined is a blank character.
  795.  
  796.                   * Character Cell Width: 2-byte integer.
  797.  
  798.                     The width of the character definition in pels.
  799.  
  800.                   * Character Cell Height: 2-byte integer.
  801.  
  802.                     The height of the character definition in pels.
  803.  
  804.                   * Character Increment: 2-byte integer.
  805.  
  806.                     The length along the character baseline
  807.                     required to step from this character to the
  808.                     next (when forming a character string).
  809.  
  810.                   * Character a-space: 2-byte signed integer.
  811.  
  812.                     The width of the space before the character in
  813.                     the inline direction.
  814.  
  815.                   * Character b-space: 2-byte integer.
  816.  
  817.                     The width of the character shape (inline
  818.                     direction).
  819.  
  820.                   * Character c-space: 2-byte signed integer.
  821.  
  822.                     The width of the space after the character in
  823.                     the inline direction.
  824.  
  825.                   * Character Baseline Offset: 2-byte signed
  826.                     integer.
  827.  
  828.                     The position of the top of a character
  829.                     definition relative to the baseline in the
  830.                     direction perpendicular to the baseline.
  831.  
  832.      Note: Type 1 fonts have offset/width pairs (like type 2);
  833.      however, the usCellSize and xCellIncrement are nonzero. In
  834.      the fstype field of the font metrics, the proportional-space
  835.      flag, bit 0, is set.
  836.  
  837. Image Data Format
  838.   The bits for each character are stored separately, and start on
  839.   a byte boundary. Sequential bytes represent vertical pieces of
  840.   the character image. For example, a 15-bit-wide H is stored as
  841.   follows:
  842.  
  843. byte                    byte
  844.  1   00000000.0000000-.  13
  845.  2   01100000 0000110-   14
  846.  3   01100000 0000110-   15
  847.  4   01100000 0000110-   16
  848.  5   01100000 0000110-   17
  849.  6   01111111 1111110-   18
  850.  7   01111111 1111110-   19
  851.  8   01100000 0000110-   20
  852.  9   01100000 0000110-   21
  853. 10   01100000 0000110-   22
  854. 11   01100000 0000110-   23
  855. 12   00000000.0000000-.  24
  856.  
  857. Bytes 1 through 12 are composed of whole bytes of data stored row
  858. by row.
  859.  
  860. Bytes 13 through 24 are composed of bytes stored row by row, where
  861. each byte contains 7 bits of information and the last bit is
  862. unused.
  863.  
  864. Thus the character is laid down in byte-wide columns.
  865.  
  866. Notes:
  867.  
  868. 1. There is always an additional (null) character defined in an
  869.    image Font (defined at character position LastChar + 2) which
  870.    is 8 bits wide, the height of the font character, and set to all
  871.    zeros.
  872.  
  873. 2. The maximum size of each individual Image Font must not exceed
  874.    64KB.
  875.  
  876.  
  877. The Kerning Pair Table
  878.  
  879. The kerning pair table record is not present if the _KerningPairs
  880. record in the metrics is zero. If it is present, the code points
  881. are words, not bytes. This table should be sorted by kpChar1 and
  882. kpChar2 order to allow binary searches.
  883.  
  884. typedef struct_KERNPAIRTABLE
  885.         ULONG     ulIdentity;
  886.         ULONG     ulSize;
  887.         CHAR      cFirstpair;
  888. }KERNPAIRTABLE;
  889.  
  890. typedef struct _KERNPAIRS
  891.         SHORT  sFirstChar;
  892.         SHORT  sSecondChar;
  893.         SHORT  sKerningAmount;
  894. }KERNINGPAIRS;
  895.  
  896. where:
  897.  
  898.   ulIdentity      = 3
  899.   ulSize          = 10
  900.   sFirstChar      = First character of the kerning pair
  901.   sSecondChar     = Second character of the kerning pair
  902.   sKerningAmount  = Kerning value. Positive values increase the
  903.                     inter-character spacing while negative values
  904.                     bring the characters closer together.
  905.  
  906. Outline Data Format
  907.   Fonts defined by outlines (vectors) may contain any of these
  908.   graphics orders:
  909.  
  910.    * Line at given position (GLINE)
  911.    * Line at current position (GCLINE)
  912.    * Relative line at given position (GRLINE)
  913.    * Relative line at current position (GCRLINE)
  914.    * Fillet at given position (GFLT)
  915.    * Fillet at current position (GCFLT)
  916.    * Sharp fillet at given position (GSFLT)
  917.    * Sharp fillet at current position (GCSFLT)
  918.    * BΘzier curve at given position (GBEZ)
  919.    * BΘzier curve at current position (GCBEZ)
  920.    * No operation (GNOPL)
  921.    * Comment (GCOMT)
  922.    * End of symbol definition (GESD).
  923.  
  924. The maximum length of the data in these orders is 255 bytes. The
  925. drawing order code and the length fields are not included in the
  926. length count.
  927.  
  928. The size of each outline font definition must not be longer than
  929. 64KB.
  930.  
  931.  
  932. The Additional Metrics
  933.  
  934. The additional metrics structure extends the metrics describing the
  935. font to include the PANOSE fields. The fields allow for
  936. quantitative descriptions of the visual properties of font faces.
  937. The format of the ADDITIONALMETRICS structure is:
  938.  
  939.   typedef struct {
  940.         ULONG       ulIdentity;
  941.         ULONG       ulSize;
  942.         PANOSE      panose;
  943.   } ADDITIONALMETRICS;
  944.  
  945.   where:
  946.  
  947.     ulIdentity      = 4
  948.     ulSize          = 20
  949.     panose          = The ten digit PANOSE number with two bytes
  950.                       of padding.
  951.  
  952. The PANOSE definition consists of ten digits, each of which
  953. describes one of up to sixteen variations. The current digits are:
  954.  
  955. 1. Family Kind (6 variations)
  956.  
  957.    0     = Any
  958.    1     = No Fit
  959.    2     = Text and Display
  960.    3     = Script
  961.    4     = Decorative
  962.    5     = Pictorial
  963.  
  964. 2. Serif Style (16 variations)
  965.  
  966.    0     = Any
  967.    1     = No Fit
  968.    2     = Cove
  969.    3     = Obtuse Cove
  970.    4     = Square Cove
  971.    5     = Obtuse Square Cove
  972.    6     = Square
  973.    7     = Thin
  974.    8     = Bone
  975.    9     = Exaggerated
  976.    10    = Triangle
  977.    11    = Normal Sans
  978.    12    = Obtuse Sans
  979.    13    = Perp Sans
  980.    14    = Flared
  981.    15    = Rounded
  982.  
  983. 3. Weight (12 variations)
  984.  
  985.    0     = Any
  986.    1     = No Fit
  987.    2     = Very Light
  988.    3     = Light
  989.    4     = Thin
  990.    5     = Book
  991.    6     = Medium
  992.    7     = Demi
  993.    8     = Bold
  994.    9     = Heavy
  995.    10    = Black
  996.    11    = Nord
  997.  
  998. 4. Proportion (10 variations)
  999.  
  1000.    0     = Any
  1001.    1     = No Fit
  1002.    2     = Old Style
  1003.    3     = Modern
  1004.    4     = Even Width
  1005.    5     = Expanded
  1006.    6     = Condensed
  1007.    7     = Very Expanded
  1008.    8     = Very Condensed
  1009.    9     = Monospaced
  1010.  
  1011. 5. Contrast (10 variations)
  1012.  
  1013.    0     = Any
  1014.    1     = No Fit
  1015.    2     = None
  1016.    3     = Very Low
  1017.    4     = Low
  1018.    5     = Medium Low
  1019.    6     = Medium
  1020.    7     = Medium High
  1021.    8     = High
  1022.    9     = Very High
  1023.  
  1024. 6. Stroke Variation (9 variations)
  1025.  
  1026.    1     = Any
  1027.    2     = No Fit
  1028.    3     = Gradual/Diagonal
  1029.    4     = Gradual/Transitional
  1030.    5     = Gradual/Vertical
  1031.    6     = Gradual/Horizontal
  1032.    7     = Rapid/Vertical
  1033.    8     = Rapid/Horizontal
  1034.    9     = Instant/Vertical
  1035.  
  1036. 7. Arm Style (12 variations)
  1037.  
  1038.    0     = Any
  1039.    1     = No Fit
  1040.    2     = Straight Arms/Horizontal
  1041.    3     = Straight Arms/Wedge
  1042.    4     = Straight Arms/Vertical
  1043.    5     = Straight Arms/Single Serif
  1044.    6     = Straight Arms/Double Serif
  1045.    7     = Non-Straight Arms/Horizontal
  1046.    8     = Non-Straight Arms/Wedge
  1047.    9     = Non-Straight Arms/Vertical
  1048.    10    = Non-Straight Arms/Single Serif
  1049.    11    = Non-Straight Arms/Double Serif
  1050.  
  1051. 8. Letterform (16 variations)
  1052.  
  1053.    0     = Any
  1054.    1     = No Fit
  1055.    2     = Normal/Contact
  1056.    3     = Normal/Weighted
  1057.    4     = Normal/Boxed
  1058.    5     = Normal/Flattened
  1059.    6     = Normal/Rounded
  1060.    7     = Normal/Off Center
  1061.    8     = Normal/Square
  1062.    9     = Oblique/Contact
  1063.    10    = Oblique/Weighted
  1064.    11    = Oblique/Boxed
  1065.    12    = Oblique/Flattened
  1066.    13    = Oblique/Rounded
  1067.    14    = Oblique/Off Center
  1068.    15    = Oblique/Square
  1069.  
  1070. 9. Midline (14 variations)
  1071.  
  1072.    0     = Any
  1073.    1     = No Fit
  1074.    2     = Standard/Trimmed
  1075.    3     = Standard/Pointed
  1076.    4     = Standard/Serifed
  1077.    5     = High/Trimmed
  1078.    6     = High/Pointed
  1079.    7     = High/Serifed
  1080.    8     = Constant/Trimmed
  1081.    9     = Constant/Pointed
  1082.    10    = Constant/Serifed
  1083.    11    = Low/Trimmed
  1084.    12    = Low/Pointed
  1085.    13    = Low/Serifed
  1086.  
  1087. 10. X-height (8 variations)
  1088.  
  1089.     0    = Any
  1090.     1    = No Fit
  1091.     2    = Constant/Small
  1092.     3    = Constant/Standard
  1093.     4    = Constant/Large
  1094.     5    = Ducking/Small
  1095.     6    = Ducking/Standard
  1096.     7    = Ducking/Large
  1097.  
  1098. When using the PANOSE number to match fonts, the ordering of the
  1099. PANOSE digit is the key to finding the closest match. The most
  1100. significant digit is the first digit, and the least significant
  1101. digit is number ten. To find matches, the digits need to be
  1102. compared, in the order given. A font mapper may want to change the
  1103. precedence of the digits, to give higher weightings to other font
  1104. features.
  1105.  
  1106.  
  1107. Font Directory
  1108.  
  1109. This section describes the directory section of a font resource.
  1110. A font resource contains a directory consisting of a set of
  1111. structures each containing the metrics of a font and a pointer to
  1112. the font itself This font directory is generated by the resource
  1113. compiler.
  1114.  
  1115. The format of the font directory is:
  1116.  
  1117. typedef struct (
  1118.    USHORT      usHeaderSize;
  1119.    USHORT      usnFonts;
  1120.    USHORT      usiMETRICS;
  1121.    FONTENTRY   fntEntry[1];
  1122. } FONTDIRECTORY;
  1123.  
  1124. typedef struct {
  1125.    USHORT          usIndex;
  1126.    FONTFILEMETRICS metrics;
  1127. } FONTENTRY;
  1128.  
  1129. Where:
  1130.  
  1131. usHeaderSize     The size of the header, in bytes.
  1132.  
  1133. usnFonts         The number of fonts in the resource.
  1134.  
  1135. usiMetrics       The size of the FOCAMETRICS structures that follow
  1136.                  the header. Note that the set of metrics for all
  1137.                  the fonts in the resource follow the header.
  1138.  
  1139. usindex          The index of a particular font; an identifier
  1140.                  assigned to the font when the resource was created
  1141.                  (defined in the RC file).
  1142.  
  1143. metrics          The font metrics structure for the font. This is
  1144.                  identical to a FOCAMETRICS structure with the
  1145.                  addition of the PANOSE fields to the end.
  1146.  
  1147. Definitions of Terms Used When Describing Fonts
  1148.  
  1149. a-space, b-space, c-space
  1150. The a-space is the distance from the left of the character frame
  1151. to the left edge of the character. The b-space is the width of the
  1152. character. The c-space is the distance from the right edge of the
  1153. character to the right of the character frame. Negative values of
  1154. a and c allow adjacent character frames to overlap. See also
  1155. character increment, and space default values.
  1156.  
  1157. average char width
  1158. The average horizontal distance from the left edge of one character
  1159. to the left edge of the next. Contrast with max char increment.
  1160.  
  1161. baseline
  1162. The line on which the bottom of a character rests, and below which
  1163. a descender extends.
  1164.  
  1165. break char cade point
  1166. The code point of the space or break character. Contrast with
  1167. default char code point, first char code point, and last char code
  1168. point.
  1169.  
  1170. character increment
  1171. A set.of three values (a-space, b-space, and c-space) that define
  1172. the proportions of a character. The sum of the three values (a+b+c)
  1173. specifies only one value for the entire character increment.
  1174. See also font width and space default values.
  1175.  
  1176. character rotation
  1177. The angle by which each character is rotated around its own center,
  1178. increasing clockwise from vertical. Contrast with character slope
  1179. and inline direction.
  1180.  
  1181. character slope
  1182. The angle by which a character is slanted, increasing clockwise
  1183. from vertical. Contrast with character rotation and inline
  1184. direction.
  1185.  
  1186. default char code point
  1187. The code point of the character to be used if a code point outside
  1188. the range of a font is passed to an application using that font.
  1189. Contrast with break char code point, first char code point, and
  1190. last char code point.
  1191.  
  1192. em height
  1193. The maximum distance above the baseline reached by an uppercase
  1194. symbol. Contrast with x height.
  1195.  
  1196. external leading
  1197. The vertical distance from the bottom of one character to the top
  1198. of the character below it. Contrast with internal leading and max
  1199. baseline extent.
  1200.  
  1201. first char code point
  1202. The code point of the first character. All numbers between the
  1203. first char code point and the last char code point must represent
  1204. a character in the font. Contrast with break char code point,
  1205. default char code point, and last char code point.
  1206.  
  1207. fixed spacing
  1208. The same amount of space separates each character. Contrast with
  1209. proportional spacing.
  1210.  
  1211. font weight
  1212. The line-thickness of a character relative to its size. Contrast
  1213. with font width.
  1214.  
  1215. font width
  1216. The relative width of a character to its height; condensed fonts
  1217. are very narrow while expanded fonts are very wide. See also
  1218. character increment. Contrast with font weight.
  1219.  
  1220. Inline direction
  1221. The angle of a line of type, increasing clockwise from horizontal.
  1222. Contrast with character rotation and character slope.
  1223.  
  1224. Internal leading
  1225. The vertical distance from the top or bottom of a character to any
  1226. accent marks that may appear with it. Contrast with external
  1227. leading.
  1228.  
  1229. last char code point
  1230. The code point of the last character. All numbers between the first
  1231. char code point and the last char code point must represent a
  1232. character in the font. Contrast with break char code point, default
  1233. char code point, and first char code point.
  1234.  
  1235. lowercase ascent
  1236. The maximum distance above the baseline reached by any part of any
  1237. lowercase character. Contrast with maximum ascender and x height.
  1238.  
  1239. lowercase descent
  1240. The maximum distance below the baseline reached by any part of any
  1241. lowercase character. Contrast with maximum descender.
  1242.  
  1243. max baseline extent
  1244. The maximum space occupied by the font (typically, the sum of the
  1245. maximum ascender and maximum descender). Contrast with external
  1246. leading and max char increment.
  1247.  
  1248. max char increment
  1249. The maximum horizontal distance from the left edge of one character
  1250. to the left edge of the next character to the right. Contrast with
  1251. average char width and max baseline extent.
  1252.  
  1253. maximum ascender
  1254. The maximum distance that any part of any character may extend
  1255. above the x height of a font. Contrast with lowercase ascent and
  1256. maximum descender.
  1257.  
  1258. maximum descender
  1259. The maximum distance that any part of any character may extend
  1260. below the x height of a font. Contrast with lowercase descent and
  1261. maximum ascender.
  1262.  
  1263. maximum vert point size
  1264. The maximum vertical dimensions to which a font can be resized.
  1265. Contrast with minimum vert point size and nominal vert point size.
  1266.  
  1267. minimum vert point size
  1268. The minimum vertical dimensions to which a font can be resized.
  1269. Contrast with maximum vert point size and nominal vert point size.
  1270.  
  1271. nominal vert point size
  1272. The normal display size of a font. Contrast with maximum vert point
  1273. size and minimum vert point size.
  1274.  
  1275. pel
  1276. The smallest element of a display surface that can be independently
  1277. assigned color and density.
  1278.  
  1279. point
  1280. Printer's unit of measurement. There are 72 points to an inch
  1281. (approximately 3.5 points to a millimeter).
  1282.  
  1283. proportional spacing
  1284. The space that each character occupies is in proportion to its
  1285. width. See also font width, Contrast with fixed spacing.
  1286.  
  1287. Registry ID
  1288. A code number that Presentation Manager uses to register a font
  1289. file as a resource.
  1290.  
  1291. space default values
  1292. Values that specify the space to be left between characters. Once
  1293. defined, they are used for the entire font, and do not have to be
  1294. specified for each character. However, they can be changed for
  1295. characters that require more or less spacing than the defaults
  1296. provide, by giving values for the a Space and the c Space. See also
  1297. character increment.
  1298.  
  1299. strikeout position
  1300. The distance of the strikeout character above the baseline (in
  1301. pels). See also strikeout size and underscore position.
  1302.  
  1303. strikeout size
  1304. The size of the strikeout character (in points). See also strikeout
  1305. position and underscore size.
  1306.  
  1307. subscript position
  1308. The distance of a subscript character of a font below the baseline
  1309. (in pels). See also subscript size and superscript position.
  1310.  
  1311. subscript size
  1312. The size of a subscript character (in points). See also subscript
  1313. position and superscript size.
  1314.  
  1315. superscript position
  1316. The distance of a superscript character above the baseline (in
  1317. pels). See also subscript position and superscript size.
  1318.  
  1319. superscript size
  1320. The size of a superscript character (in points). See also subscript
  1321. size and superscript position.
  1322.  
  1323. target dev resolution X
  1324. The number of pels per inch in the horizontal axis of a display
  1325. device on which a font is to be displayed. Contrast with target dev
  1326. resolution Y.
  1327.  
  1328. target dev resolution Y
  1329. The number of pels per inch in the vertical axis of a display
  1330. device on which a font is to be displayed. Contrast with target dev
  1331. resolution X.
  1332.  
  1333. underscore position
  1334. The distance in pels of the first underscore stroke from the
  1335. baseline of a font. Successive strokes below this create a heavier
  1336. underscore. See also strikeout position and underscore size.
  1337.  
  1338. underscore size
  1339. The size of the underscore character measured in single strikeout
  1340. strokes. See also strikeout size and underscore position.
  1341.  
  1342. x height
  1343. The maximum distance above the baseline reached by a lowercase
  1344. character. Contrast with em height and lowercase ascent.
  1345.  
  1346.  
  1347. Appendix G. Format of Interchange Files
  1348.  
  1349. A metafile is a file in which graphics are stored. The file is
  1350. application-created, and it contains the graphics orders generated
  1351. from those GPI calls that are valid in a metafile. Metafiled
  1352. graphics can be reused by the application that created them. They
  1353. can also be made available to other applications at the same, or
  1354. at a different, workstation.
  1355.  
  1356. This chapter describes the restrictions which apply when generating
  1357. the metafile and gives detail of the overall structure. For the
  1358. graphics orders descriptions, see Chapter 33, "Graphics Orders" on
  1359. page 33-1.
  1360.  
  1361.  
  1362. Metafile Restrictions
  1363.  
  1364. The following restrictions apply to the generation of all
  1365. metafiles, and also to the generation of a PM_Q-STD print file to
  1366. a OD_QUEUED device:
  1367.  
  1368.   *  If GpiWCBitBit or GpiBitBit is used to copy a bit map to a
  1369.      device context in an application, the application should not
  1370.      delete that bit map handle with GpiDeleteBitmap before the
  1371.      device context is closed (metafile is closed).
  1372.  
  1373.   *  GpiSetPS must not be used.
  1374.  
  1375.   *  GpiSetPageViewport is ignored.
  1376.  
  1377. The following section lists some general rules that must be
  1378. followed when creating a metafile that is to be acceptable to
  1379. SAA-conforming implementations, or replayed into a presentation
  1380. space that is in draw-and-retain or retain mode (see
  1381. GpiSetDrawingMode).
  1382.  
  1383.  *  These items must be established or defaulted before any drawing
  1384.     occurs to the graphics presentation space, and not changed
  1385.     subsequently:
  1386.  
  1387.     --  The graphics field (GpiSetGraphicsField). For an
  1388.         SAA-conforming metafile, the graphics field must be
  1389.         defaulted or set to no clipping.
  1390.     --  The code page for the default character set (GpiSetCp).
  1391.     --  The color table or palette (GpiCreateLogColorTable or
  1392.         GpiCreatePalette). The size of the color table must not
  1393.         exceed 31 KB (KB equals 1024 bytes).
  1394.     --  The default viewing transform (GpiSetDefaultViewMatrix).
  1395.     --  The setting of the draw controls (GpiSetDrawControl).
  1396.         DCTL-DISPLAY must be defaulted or set ON.
  1397.     --  The default values of attributes (see GpiSetDefAttrs),
  1398.         viewing limits (see GpiSetDefViewingLimits), primitive tag
  1399.         (see GpiSetDefrag) and arc parameters (see
  1400.         GpiSetDefArcParams).
  1401.  
  1402.  *  These calls should not be used:
  1403.  
  1404.     --  GpiBitBit
  1405.     --  GpiDeleteSetId (note that this means that local identifiers
  1406.         cannot be used again within the picture)
  1407.     --  GpiErase
  1408.     --  GpiExcludeClipRectangle
  1409.     --  GpilntersectClipRectangle
  1410.     --  GpiOffsetClipRegion
  1411.     --  GpiPaintRegion
  1412.     --  GpiResetPS
  1413.     --  GpiSetClipRegion
  1414.     --  GpiSetPel
  1415.     --  GpiSetPS
  1416.     --  DevEscape (for an escape which is metafiled).
  1417.  
  1418.  *  GpiCreateLogFont must not redefine a local identifier that has
  1419.     previously been used within the picture.
  1420.  
  1421.  *  The metafile context must not be reassociated.
  1422.  
  1423.  *  If a bit map is used as the source of a GpiWCBitBit operation,
  1424.     or as an area-fill pattern, it must not be modified or deleted
  1425.     (GpiDeleteBitmap) before the metafile is closed.
  1426.  
  1427.  *  Only these foreground mixes must be used (see GpiSetMix):
  1428.  
  1429.     --FM_DEFAULT
  1430.     --FM_OR
  1431.     --FM_OVERPAINT
  1432.     --FM_LEAVEALONE.
  1433.  
  1434.  *  Only these background mixes must be used (see GpiSetBackMix):
  1435.  
  1436.     --BM_DEFAULT
  1437.     --BM_OVERPAINT
  1438.     --BM_LEAVEALONE.
  1439.  
  1440.  *  If palettes are used (see GpiCreatePalette), the palette that
  1441.     is metafiled is the one in force when the metafile device
  1442.     context is dissociated from the (final) presentation space. if
  1443.     the palette is changed during the course of the picture (using
  1444.     GpiSetPaletteEntries), it must therefore only be with
  1445.     incremental additions.
  1446.  
  1447. Note: There is no restriction concerning the use of primitives
  1448. outside segments. These are metafiled in segment(s) with zero
  1449. identifier.
  1450.  
  1451.  
  1452. Metafile Data Format
  1453.  
  1454. This section describes the format of the data in a metafile, as it
  1455. would be stored in an OS/2 Version 2.0 disk file.
  1456.  
  1457. Metafile data is stored as a sequence of structured fields. Each
  1458. structured field starts with an eight-byte header consisting of a
  1459. two-byte length field and a three-byte identifier field. These are
  1460. followed by a one-byte flags field and a two-byte segment sequence
  1461. number field.
  1462.  
  1463. The length field contains a count of the total number of bytes in
  1464. the structured field, including the length field. The identifier
  1465. field uniquely identifies the type of the structured field.
  1466.  
  1467. The flags and segment sequence number fields are always zero.
  1468.  
  1469. Following the header are positional parameters that are optional
  1470. and dependent on the particular structured field.
  1471.  
  1472. Following the positional parameters are non-positional parameters
  1473. called triplets. These are self-defining parameters and consist of
  1474. a one-byte length field, followed by a one-byte identifier field,
  1475. followed by the data of the parameter.
  1476.  
  1477. The length field contains a count of the total number of bytes in
  1478. the triplet, including the length and identifier fields. The
  1479. identifier field identifies uniquely the type of the triplet.
  1480.  
  1481. A metafile is structured into a number of different functional
  1482. components; for example, document and graphics object. Each
  1483. component comprises a number of structured fields, and is delimited
  1484. by "begin-component" and "end-component" structured fields.
  1485. Structured fields marked as required, inside an optional structured
  1486. field bracket, are required if the containing bracket is present.
  1487.  
  1488. The graphics orders that describe a picture occur in the graphics
  1489. data structured field. See page G-17.
  1490.  
  1491.  
  1492. Structured Field Formats
  1493.  
  1494. The format of the various structured fields is given below:
  1495.  
  1496. Begin Document
  1497.  
  1498. Structured Field Introducer (BDT): required
  1499. 0-1     Length X'n+1E'
  1500. 2-4     BDT X'D3A8AB'
  1501. 5       Flags X'00'
  1502. 6-7     Segment sequence number X'0000'
  1503.  
  1504. Parameters
  1505. 0-7     Document name C'0000 0001'
  1506. 8       Architecture version X'00'
  1507. 9       Document security X'00'
  1508.  
  1509. Triplets (all required)
  1510. 0       Length X'05'
  1511. 1       Triplet Id X'18'
  1512. 2       Interchange set type X'03' (resource document)
  1513. 3-4     Base set definition X'0C00' (level 12, version 0)
  1514.  
  1515. 0       Length X'06'
  1516. 1       Triplet Id X'01'
  1517. 2-5     GCID
  1518.  
  1519. 0       Length X'n+1'
  1520. 1       Triplet Id X'65'
  1521. 2-n     Comment, used for metafile description of up to 252 bytes.
  1522.  
  1523. Begin Resource Group (BRG): required
  1524.  
  1525.   Structured Field Introducer
  1526.   0-1   Length X'0010'
  1527.   2-4   BRG X'D3ABC6'
  1528.   5     Flags X'00'
  1529.   6-7   Segment sequence number X'0000'
  1530.  
  1531.   Parameters
  1532.   0-7   Resource group name    C'0000 0002'
  1533.  
  1534. Begin Color Attribute (BCA) Table: required
  1535.  
  1536.   Structured Field Introducer
  1537.   0-1   Length X'0010'
  1538.   2-4   BCA X'D3AB77'
  1539.   5     Flags X'00'
  1540.   6-7   Segment sequence number X'0000'
  1541.  
  1542.   Parameters
  1543.   0-7   Color table name C'0000 0004'
  1544.  
  1545. Color Attribute Table (CAT) required
  1546.   Structured Field Introducer
  1547.   0-1   Length X'n+B'
  1548.   2-4   CAT X'D3BO77'
  1549.   5     Flags X'00'
  1550.   6-7   Segment sequence number X'0000'
  1551.  
  1552.   Parameters
  1553.  
  1554.   Base Part (required)
  1555.   0     Flags
  1556.         0   Reserved B'0'
  1557.         1   Reset
  1558.             B'0' Do not reset to default
  1559.             B'1' Do reset to default
  1560.         2-7 Reserved B'000000'
  1561.   1     Reserved X'00'
  1562.   2     LCTID X'00'
  1563.  
  1564.   Element list(s) (triple generating) are mutually-exclusive. One
  1565.   or other is required.
  1566.  
  1567.   Element List (repeating)
  1568.   0     Length of this parameter
  1569.   1     Type X'01': element list
  1570.   2     Flags X'00': reserved
  1571.   3     Format
  1572.         X'01' RGB
  1573.   4-6   Starting Index
  1574.         (Top Byte Truncated)
  1575.   7     Size of RGB component1 X'08'
  1576.   8     Size of RGB component2 X'08'
  1577.   9     Size of RGB component3 X'08'
  1578.   10    Number of bytes in each
  1579.         following color triple X'04'
  1580.   11-m  Color triples
  1581.  
  1582. Triple Generating
  1583.   0     Length of this parameter X'OA'
  1584.   1     Type X'02': bit generator
  1585.   2     Flags
  1586.         0 ABFlag
  1587.          B'0' Normal
  1588.         1-7 Reserved B'0000000'
  1589.   3     Format
  1590.         X'01' RGB
  1591.   4-6   Starting index (top byte truncated)
  1592.   7     Size of RGB component1 X'08'
  1593.   8     Size of RGB component2 X'08'
  1594.   9     Size of RGB component3 X'08'
  1595.  
  1596. End Color Attribute (ECA) Table: required
  1597.  
  1598.   Structured Field Introducer
  1599.   0-1   Length X'0010'
  1600.   2-4   ECA X'D3A977'
  1601.   5     Flags '00'
  1602.   6-7   Segment sequence number X'0000'
  1603.  
  1604.   Parameters
  1605.   0-7   Color table name C'0000 0004'
  1606.  
  1607. Begin Image Object (BIM): optional, repeating
  1608.  
  1609.   Structured Field Introducer
  1610.   0-1   Length X'0010'
  1611.   2-4   BIM X'D3A8FB'
  1612.   5     Flags X'00'
  1613.   6-7   Segment sequence number X'0000'
  1614.  
  1615.   Parameters
  1616.   0-7   Image name C'xxxx xxxx'
  1617.  
  1618. Begin Resource Group (BRG): optional
  1619.  
  1620.     Structured Field Introducer
  1621.     0-1   Length X'9010'
  1622.     2-4   BRG X'D3A8C6'
  1623.     5     Flags X'00'
  1624.     6-7   Segment sequence number X'0000'
  1625.  
  1626.     Parameters
  1627.     0-7   Resource group name C'xxxx xxxx'
  1628.  
  1629. Color Attribute Table (BCA): optional
  1630.  
  1631.       Structured Field Introducer
  1632.       0-1   Length X'0010'
  1633.       2-4   BCA X'D3A877'
  1634.       5     Flags X'00'
  1635.       6-7   Segment sequence number X'0000'
  1636.  
  1637.       Parameters
  1638.       0-7   Color table name C'xxxx xxxx'
  1639.  
  1640. Color Attribute Table (CAT): required
  1641.  
  1642.         Structured Field Introducer
  1643.         0-1   Length
  1644.         2-4   CAT X'D3B077'
  1645.         5     Flags X'00'
  1646.         6-7   Segment sequence number X'0000'
  1647.  
  1648.         Parameters
  1649.  
  1650.         Base Part
  1651.         0     Flags X'00'
  1652.         1     Reserved X'00'
  1653.         2     LUTID
  1654.  
  1655.         Element List (repeating)
  1656.         0     Length of this parameter
  1657.         1     Type X'01': element list
  1658.         2     Flags X'00': reserved
  1659.         3     Format X'01': RGB
  1660.         4-6   Starting index
  1661.               (top byte truncated)
  1662.         7     Size of RGB component1 X'08'
  1663.         8     Size of RGB component2 X'08'
  1664.         9     Size of RGB component3 X'08'
  1665.         10    Number of bytes in each following color triple X'03'
  1666.         11-n  Color triples
  1667.  
  1668. End Color Attribute Table (ECA): required if BCA present
  1669.   Structured Field Introducer
  1670.   0-1   Length X'0010'
  1671.   2-4   ECA X'D3A977'
  1672.   5     Flags X'00'
  1673.   6-7   Segment sequence number X'0000'
  1674.  
  1675.   Parameters
  1676.   0-7   Color Table name C'xxxx xxxx'
  1677.  
  1678. End Resource Group (ERG): required if RG present
  1679.   Structured Field Introducer
  1680.   0-1   Length X'0010'
  1681.   2-4   ERG X'D3A9C6'
  1682.   5     Flags X'00'
  1683.   6-7   Segment sequence number X'0000'
  1684.  
  1685.   Parameters
  1686.   0-7 Resource Group name C'xxxx xxxx'
  1687.  
  1688. Begin Object Environment Group (BOG): optional
  1689.   Structured Field Introducer
  1690.   0-1   Length X'0010'
  1691.   2-4   BOG X'D3A8C7'
  1692.   5     Flags X'00'
  1693.   6-7   Segment sequence number X'0000'
  1694.  
  1695.   Parameters
  1696.   0-7   Object environment group
  1697.         name C'xxxx xxxx'
  1698.  
  1699. Map Color Attribute (MCA) Table: required
  1700.   Structured Field Introducer
  1701.   0-1   Length X'001A'
  1702.   2-4   MCA X'D3AB77'
  1703.   5     Flags '00'
  1704.   6-7   Segment sequence number X'0000'
  1705.  
  1706.   Parameters
  1707.   9-1   Length
  1708.  
  1709.   Triplet (required)
  1710.   0     Length X'0C'
  1711.   1     Triplet type:
  1712.         fully qualified name X'02'
  1713.   2     Type: ref to
  1714.         Begin Resource Object X'84'
  1715.   3     ID X'00'
  1716.   4-11  Color table name C'xxxx xxxx'
  1717.  
  1718.   lcid (required)
  1719.   0     Length X'04'
  1720.   1     Triplet type:
  1721.         resource local ID X'24'
  1722.   2     Type color table resource X'07'
  1723.   3     Local identifier (LUT-ID) X'01'
  1724.  
  1725. End Object Environment Group (EOG): required if BOG present
  1726.   Structured Field Introducer
  1727.   0-1   Length X'0010'
  1728.   2-4   EOG X'D3A9C7'
  1729.   5     Flags X'00'
  1730.   6-7   Segment sequence number X'0000'
  1731.  
  1732.   Parameters
  1733.   0-7   Object Environment Group
  1734.         name C'xxxx xxxx'
  1735.  
  1736. Image Data Descriptor (IDD): required
  1737.   Structured Field Introducer
  1738.   0-1   Length X'0011'
  1739.   2-4   IDD X'D3A6FB'
  1740.   5     Flags X'00'
  1741.   6-7   Segment sequence number X'0000'
  1742.  
  1743.   Parameters
  1744.   0     Unit of measure:
  1745.         X'00' tens of inches
  1746.         X'01' tens of centimeters
  1747.   1-2   X resolution image points / UOM
  1748.   3-4   Y resolution image points / UOM
  1749.   5-6   X extent of image PS
  1750.   7-8   Y extent of image PS
  1751.  
  1752. Image Picture Data (IPD): required
  1753.   Structured Field Introducer
  1754.   0-1   Length
  1755.   2-4   IPD XID3EEFB'
  1756.   5     Flags X'00'
  1757.   6-7   Segment sequence number X'0000'
  1758.  
  1759.   Parameters (all required and in this order, except that only one
  1760.   of image LUT-ID and IDE structure is present)
  1761.  
  1762.   Begin Segment
  1763.   0     Type X'70': begin segment
  1764.   1     Length of following X'00'
  1765.  
  1766.   Begin Image Content
  1767.   0     Type X'91': Begin Image Content
  1768.   1     Length of following X'01'
  1769.   2     Format X'FF'
  1770.  
  1771.   Image Size
  1772.   0     Type X'94': image size
  1773.   1     Length of following X'09'
  1774.   2     Units of measure X'02': logical
  1775.   3-4   Horizontal resolution
  1776.   5-6   Vertical resolution
  1777.   7-8   Height in pels
  1778.   9-10  Width in pels
  1779.  
  1780.   Image Encoding
  1781.   0     Type X'95': image encoding
  1782.   1     Length of following X'02'
  1783.   2     Compression algorithm X'03': none
  1784.   3     Recording algorithm X'03': bottom-to-top
  1785.  
  1786.   Image IDE-Size
  1787.   0     Type X'96': image IDE-Size
  1788.   1     Length of following X'0l'
  1789.   2     Number of bits per element
  1790.  
  1791.   Image LUT-ID
  1792.         (For bit maps with other than 24 bits per pel)
  1793.   0     Type X'97' Image LUT-ID
  1794.   1     Length of following X'Ol'
  1795.   2     LUT-ID
  1796.  
  1797.   IDE Structure
  1798.         (For bit maps with 24 bits per pel)
  1799.   0     Type X'9B': IDE structure
  1800.   1     Length of following X'08'
  1801.   2     Flags:
  1802.         0  ABFlag
  1803.            B'0' Normal (Additive)
  1804.         1-7 Reserved B'0000000'
  1805.   3     Format
  1806.         X'01' RGB
  1807.   4-6   Reserved X'000000'
  1808.   7     Size of element 1
  1809.   8     Size of element 2
  1810.   9     Size of element 3
  1811.  
  1812. Image Picture Data (IPD): required, repeating
  1813.   Structured Field Introducer
  1814.   0-1   Length
  1815.   2-4   IPD X'D3EEFB'
  1816.   5     Flags X'00'
  1817.   6-7   Segment sequence number X'0000'
  1818.  
  1819.   Parameters
  1820.  
  1821.   Image Data
  1822.   0-1   Type X'FE92': image data
  1823.   2-3   Length of following
  1824.   4-n   Image data (scan lines of bit maps)
  1825.  
  1826.   End Image Content
  1827.         (required, only present in last Image Picture Data)
  1828.   0     Type X'93': End Image Content
  1829.   1     Length of following X'00'
  1830.  
  1831.   End Segment
  1832.         (required, only present in last Image Picture Data)
  1833.   0     Type X'71': end segment
  1834.   1     Length of following X'00'
  1835.  
  1836. End Image Object (EIM): required if BIM present
  1837.   Structured Field Introducer
  1838.   0-1   Length X'0010'
  1839.   2-4   EIM X'D3A9FB'
  1840.   5     Flags X'00'
  1841.   6-7   Segment sequence number X'0000'
  1842.  
  1843.   Parameters
  1844.   0-7 Image name C'xxxx xxxx'
  1845.  
  1846. Begin Graphics Object (BGR): required
  1847.   Structured Field Introducer
  1848.   0-1   Length X'0010'
  1849.   2-4   BGR X'D3A8BB'
  1850.   5     Flags X'00'
  1851.   6-7   Segment sequence number X'0000'
  1852.  
  1853.   Parameters
  1854.   0-7   Graphics object name C'0000 0007'
  1855.  
  1856. Begin Object Environment Group (BOG): optional
  1857.   Structured Field Introducer
  1858.   0-1   Length X'0016'
  1859.   2-4   BOG X'D3A8C7'
  1860.   5       Flags X'00'
  1861.   6-7     Segment sequence number X'0000'
  1862.  
  1863.   Parameters
  1864.   0-7 Object Environment Group
  1865.       name C'0000 0007'
  1866.  
  1867. Map Color Attribute Table (MCA): required
  1868.   Structured Field Introducer
  1869.   0-1   Length X'0016'
  1870.   2-4   MCA X'D3AB77'
  1871.   5     Flags X'00'
  1872.   6-7   Segment sequence number X'0000'
  1873.  
  1874.   Parameters
  1875.   0-1 Length
  1876.  
  1877.   Triplet (required)
  1878.   0     Length X'0C'
  1879.   1     Triplet type:
  1880.         fully qualified name X'02'
  1881.   2     Type: ref to
  1882.         Begin Resource Object X'84'
  1883.   3     ID    X'00'
  1884.   4-11  Color table name C'0000 0004'
  1885.  
  1886. Map Coded Font (MCF): required, for default font
  1887.   Structured Field Introducer
  1888.   0-1   Length X'20'
  1889.   2-4   MCF X'D3AB8A'
  1890.   5     Flags X'00'
  1891.   6-7   Segment sequence number X'0000'
  1892.  
  1893.   Parameters
  1894.   0-1   Length
  1895.  
  1896.   Triplets (required)
  1897.  
  1898.   Font name
  1899.   0     Length X'0C'
  1900.   1     Triplet type:
  1901.         fully qualified name X'02'
  1902.   2     Type: ref to coded font X'84'
  1903.   3     ID  X'00'
  1904.   4-11  Coded font name: C'nnxx xxxx'
  1905.         where n is X'FF'
  1906.  
  1907.   lcid
  1908.   0     Length X'04'
  1909.   1     Triplet type:
  1910.         Resource Local ID X'24'
  1911.   2     Type: Coded Font Resource X'05'
  1912.   3     Local identifier (LCID) X'00'
  1913.  
  1914.   Font Binary GCID
  1915.   0     Length X'06'
  1916.   1     Triplet type: Font Binary GCID X'20'
  1917.   2-5   GCID
  1918.  
  1919. Map Coded Font (MCF): optional, repeating, for loaded fonts
  1920.   Structured Field Introducer
  1921.   0-1   Length X'58'
  1922.   2-4   MCF X'D3AB8A'
  1923.   5     Flags X'00'
  1924.   6-7   Segment sequence number X'0000'
  1925.  
  1926.   Parameters
  1927.   0-1 Length
  1928.  
  1929.   Triplets (required)
  1930.  
  1931.   Font name
  1932.   0     Length X'0C'
  1933.   1     Triplet type:
  1934.         fully qualified name X'02'
  1935.   2     Type: ref to coded font X'84'
  1936.   3     ID X'00'
  1937.   4-11  Coded font name
  1938.  
  1939.   lcid
  1940.   0     Length X'04'
  1941.   1     Triplet type:
  1942.         Resource Local ID X'24'
  1943.   2     Type: coded font resource X'05'
  1944.   3     Local identifier (LCID)
  1945.  
  1946.   Font Attributes
  1947.   0     Length X'14'
  1948.   1     Triplet type:
  1949.         Font Descriptor X'IF'
  1950.   2     Weight Class
  1951.   3     Width Class
  1952.   4-5   Font Height
  1953.   6-7   Char Width
  1954.   8     Descript Flags
  1955.   9     Usage Codes
  1956.   10    Family
  1957.   11    Activity Class
  1958.   12    Font Quality
  1959.   13-14 CAP Height
  1960.   15-16 X Height
  1961.   17-18 Line Density
  1962.   19    Use Flags
  1963.  
  1964.   Font Binary GCID
  1965.   0     Length X'06'
  1966.   1     Triplet type:
  1967.         Font Binary GCID X'20'
  1968.   2-5   GCID
  1969.  
  1970.   Font Typeface
  1971.   0     Length X'24'
  1972.   1     Triplet type:
  1973.         fully qualified name X'02'
  1974.   2     Type: ref to font typeface X'08'
  1975.   3     ID X'00'
  1976.   4-35  Font typeface C'xxx..xxx'
  1977.  
  1978. Map Data Resource (MDR): optional, repeating
  1979.   Structured Field Introducer
  1980.   0-1   Length X'lD'
  1981.   2-4   MDR X'D3ABC3'
  1982.   5     Flags X'00'
  1983.   6-7   Segment sequence number X'0000'
  1984.  
  1985.   Parameters
  1986.   0-1   Length
  1987.  
  1988.   Triplets (required)
  1989.  
  1990.   Bit-map Name
  1991.   0     Length X'0C'
  1992.   1     Triplet type:
  1993.         fully qualified name X'02'
  1994.   2     Type: ref to Imaqe Object X'84'
  1995.   3     ID X'00' .
  1996.   4-11  Image name C'xxxx xxxx'
  1997.  
  1998.   Extended Resource lcid
  1999.   0     Length X'07'
  2000.   1     Triplet type:
  2001.         Extended Resource Local ID X'22'
  2002.   2     Type: Image Resource X'10'
  2003.   3-6   Bit-map handle
  2004.  
  2005. End Object Environment Group (EOG): required if BOG present
  2006.  
  2007.   Structured Field Introducer
  2008.   0-1   Length X'0010'
  2009.   2-4   EOG X'D3A9C7'
  2010.   5     Flags X'00'
  2011.   6-7   Segment sequence number X'0000'
  2012.  
  2013.   Parameters
  2014.   0-7 Object Environment Group name C'0000 0007'
  2015.  
  2016. Graphics Data Descriptor (GDD): required
  2017.  
  2018.   Structured Field Introducer
  2019.   0-1   Length X'nnnn'
  2020.   2-4   GDD X'D3A6BB'
  2021.   5     Flags X'00'
  2022.   6-7   Segment sequence number X'0000'
  2023.  
  2024.   Parameters (all required and in this order)
  2025.   0     X'F7' Specify GVM Subset
  2026.   1     Length of following data X'07'
  2027.   2     X'B0' drawing order subset
  2028.   3-4   X'0000'
  2029.   5     X'23' Level 3.2
  2030.   6     X'Ol' Version 1
  2031.   7     Length of following field X'Ol'
  2032.   8     Coordinate types in data
  2033.         X'04' Intel16
  2034.         X'05' Intel32
  2035.  
  2036.   0     X'F6' Set Picture Descriptor
  2037.   1     Length of following data
  2038.   2     Flags
  2039.         0 B'0' Picture in 2D
  2040.         1 Picture Dimensions
  2041.           B'0' Not absolute (PU_ARBITRARY PS)
  2042.           B'1' Absolute (example: PU_TWIPS PS)
  2043.         2 Picture Elements
  2044.           B'0' Not pels
  2045.           B'1' Pels (PU_PELS PS)
  2046.                (Bit 1 must also be set)
  2047.         3-7 B'00000'
  2048.   3     X'00' Reserved
  2049.   4     Picture frame size coordinate type
  2050.         X'04' Intel16
  2051.         X'05' Intel32
  2052.   5     UnitsOfMeasure
  2053.         X'00' Ten inches
  2054.         X'0l' Decimeter
  2055.   6-11 or 6-17 (2 or 4 bytes) Resolution.
  2056.         GPS Units / UOM on x axis
  2057.         GPS Units / UOM on y axis
  2058.         GPS Units / UOM on z axis
  2059.   12-23 or 18-41 (2 or 4 bytes) Window Size.
  2060.         GPS X left, X right
  2061.         GPS Y bottom, Y top
  2062.         GPS Z near, Z far
  2063.  
  2064.   0     X'21' Set Current Defaults
  2065.   1     Length of following data
  2066.   2     Set Default Parameter Format X'08'
  2067.   3-4   Mask X'E000'
  2068.   5     Names X'8F'
  2069.   6     Coordinates
  2070.         X'00' Picture in 2D
  2071.   7     Transforms
  2072.         X'04' Intel16
  2073.         X'05' Intel32
  2074.   8     Geometrics
  2075.         X'04' Intel16
  2076.         X'05' Intel32
  2077.  
  2078.   0     X'21' Set Current Defaults
  2079.   1     Length of following data
  2080.   2     Set default viewing transform X'07'
  2081.   3-4   Mask X'CC0C'
  2082.   5     Names X'8F'
  2083.   6-n   M11, M12, M21, M22, M41, M42  Matrix elements
  2084.  
  2085.   0     X'21' Set Current Defaults
  2086.   1     Length of following data
  2087.   2     Set default line attributes X'01'
  2088.   3-4   Mask--OR of as many of the following bits as are required:
  2089.         X'8000'  Line type
  2090.         X'4000'  Line width
  2091.         X'2000'  Line end
  2092.         X'1000'  Line join
  2093.         X'0800'  Stroke width
  2094.         X'0008'  Line color
  2095.         X'0002'  Line mix
  2096.   5       Flags
  2097.         X'0F'Set indicated default
  2098.                     attributes to initial values.
  2099.                     (Data field is not present
  2100.                     in this instance).
  2101.         X'8F' Set indicated default attributes
  2102.                     to specified values.
  2103.   6-n Data--data values as required, in the
  2104.                     following order if present.
  2105.       No space is reserved for attributes for which the
  2106.       corresponding mask flag was not set.
  2107.       (1 byte)---Line type
  2108.       (1 byte)---Line width
  2109.       (1 byte)---Line end
  2110.       (1 byte)---Line join
  2111.       (G bytes)--Stroke width
  2112.       (4 bytes)--Line color
  2113.       (1 byte)---Line mix
  2114.                  (G=2 or 4 depending on the Geometrics
  2115.                  parameter of Set Default Parameter Format)
  2116.  
  2117.   0     X'21' Set Current Defaults
  2118.   1     Length of following data
  2119.   2     Set Default Character Attributes X'02'
  2120.   3-4   Mask--OR of as many of the following bits as are required:
  2121.  
  2122.         X'8000'  Character angle
  2123.         X'4000'  Character box
  2124.         X'2000'  Character direction
  2125.         X'1000'  Character precision
  2126.         X'0800'  Character set
  2127.         X'0400'  Character shear
  2128.         X'0040'  Character break extra
  2129.         X'0020'  Character extra
  2130.         X'O008'  Character color
  2131.         X'0004'  Character background color
  2132.         X'0002'  Character mix
  2133.         X'0001'  character background mix
  2134.   5     Flags
  2135.         X'0F' Set indicated default attributes to initial values.
  2136.                     (Data field is not present in this case).
  2137.         X'8F' Set indicated default attributes to specified values.
  2138.   6-n   Data--data values as required, in the following order if
  2139.         present.
  2140.  
  2141.         No space is reserved for attributes for which the
  2142.         corresponding Mask flag was not set.
  2143.         (2*G bytes) - Character angle
  2144.         (2*G + 4 bytes) - Character box
  2145.         (1 byte)    - Character direction
  2146.         (1 byte)    - Character precision
  2147.         (1 byte)    - Character set
  2148.         (2*G bytes) - Character shear
  2149.         (4 bytes)   - Character break extra
  2150.         (4 bytes)   - Character extra
  2151.         (4 bytes)   - Character color
  2152.         (4 bytes)   - Character background color
  2153.         (1 byte)    - Character mix
  2154.         (1 byte)    - Character background mix
  2155.            (G=2 or 4 depending on the Geometrics parameter of Set
  2156.            Default Parameter Format)
  2157.  
  2158.   0     X'21' Set Current Defaults
  2159.   1     Length of following data
  2160.   2     Set Default Marker Attributes X'03'
  2161.   3-4   Mask--OR of as many of the following bits as are required:
  2162.         X'4000'   Marker box
  2163.         X'1000'   Marker precision
  2164.         X'0800'   Marker set
  2165.         X'0080'   Marker symbol
  2166.         X'0008'   Marker color
  2167.         X'0004'   Marker background color
  2168.         X'0002'   Marker mix
  2169.         X'0001'   Marker background mix
  2170.   5     Flags
  2171.         X'0F' Set indicated default attributes to initial values.
  2172.                       (Data field is not present in this instance)
  2173.         X'8F' Set indicated default attributes to specified values.
  2174.   6-n   Data--data values as required, in this order if present.
  2175.         No space is reserved for attributes for which the
  2176.         corresponding Mask flag was not set.
  2177.         (2*G bytes) - Marker box
  2178.         (1 byte)    - Marker precision
  2179.         (1 byte)    - Marker set
  2180.         (1 byte)    - Marker symbol
  2181.         (4 bytes)   - Marker color
  2182.         (4 bytes)   - Marker background color
  2183.         (1 byte)    - Marker mix
  2184.         (1 byte)    - Marker background mix
  2185.           (G=2 or 4 depending on the Geometrics parameter of Set
  2186.           Default Parameter Format)
  2187.  
  2188.   0     X,'21,' Set Current Defaults
  2189.   1     Length of following data
  2190.   2     Set Default Pattern Attributes X'04'
  2191.   3-4   Mask--OR of as many of the following bits as are required:
  2192.  
  2193.         X'0800'   Pattern set
  2194.         X'0100'   Pattern symbol
  2195.         X'0080'   Pattern reference point
  2196.         X'0008'   Pattern color
  2197.         X'0004'   Pattern background color
  2198.         X'0002'   Pattern mix
  2199.         X'0001'   Pattern background mix
  2200.   5     Flags
  2201.         X'0F' Set indicated default attributes to initial values.
  2202.            (Data field is not present in this instance)
  2203.         X'8F' Set indicated default attributes to specified values.
  2204.   6-n   Data--data values as required, in this order if present.
  2205.         No space is reserved for attributes for which the
  2206.         corresponding Mask flag was not set.
  2207.         (1 byte)    - Pattern set
  2208.         (1 byte)    - Pattern symbol
  2209.         (2*G bytes) - Pattern reference point
  2210.         (4 bytes)   - Pattern color
  2211.         (4 bytes)   - Pattern background color
  2212.         (1 byte)    - Pattern mix
  2213.         (1 byte)    - Pattern background mix
  2214.  
  2215.         (G=2 or 4 depending on the Geometrics parameter of Set
  2216.         Default Parameter Format)
  2217.  
  2218.   0     X'21' Set Current Defaults
  2219.   1     Length of following data
  2220.   2     Set Default Image Attributes X'06'
  2221.   3-4   Mask--OR of as many of these bits as are required:
  2222.         X'0008' Image color
  2223.         X'0004' Image background color
  2224.         X'0002' Image mix
  2225.         X'0001' Image background mix
  2226.   5     Flags
  2227.         X'0F' Set indicated default attributes to initial values.
  2228.                      (Data field is not present in this instance)
  2229.         X'8F' Set indicated default attributes to specified values.
  2230.   6-n   Data--data values as required, in this order if present.
  2231.         No space is reserved for attributes for which the
  2232.         corresponding Mask flag was not set.
  2233.         (4 bytes)       - Image color
  2234.         (4 bytes)       - Image background color
  2235.         (1 byte)        - Image mix
  2236.         (1 byte)        - Image background mix
  2237.  
  2238.   0     X'21' Set Current Defaults
  2239.   1     Length of following data
  2240.   2     Set Default Viewing Window X'05'
  2241.   3-4   Mask--OR of as many of the following bits as are required:
  2242.         X'8000' x left limit
  2243.         X'4000' x right limit
  2244.         X'2000' y bottom limit
  2245.         X'1000' y top limit
  2246.   5     Flags
  2247.         X'0F' Set indicated default attributes to initial values.
  2248.                         (Data field is not present in this case).
  2249.         X'8F' Set indicated default attributes to specified values.
  2250.   6-n   Data--data values as required, in the following order if
  2251.         present. No space is reserved for attributes for which the
  2252.         corresponding Mask flag was not set.
  2253.         (2*G bytes) - x left limit
  2254.         (2*G bytes) - x right limit
  2255.         (2*G bytes) - y bottom limit
  2256.         (2*G bytes) - y top limit
  2257.            (G=2 or 4 depending on the Geometrics parameter of Set
  2258.            Default Parameter Format)
  2259.  
  2260.   0     X'21' Set Current Defaults
  2261.   1     Length of following data
  2262.   2     Set Default Arc Parameters X'0B'
  2263.   3-4   Mask--OR of as many of the following bits as are required:
  2264.         X'8000' P value
  2265.         X'4000' Q value
  2266.         X'2000' R value
  2267.         X'1000' S value
  2268.   5     Flags
  2269.         X'0F' Set indicated default attributes to initial values.
  2270.                         (Data field is not present in this case).
  2271.         X'8F' Set indicated default attributes to specified values.
  2272.   6-n   Data--data values as required, in the following order if
  2273.         present. No space is reserved for attributes for which the
  2274.         corresponding Mask flag was not set.
  2275.         (G bytes) - P value
  2276.         (G bytes) - Q value
  2277.         (G bytes) - R value
  2278.         (G bytes) - S value
  2279.           (G=2 or 4 depending on the Geometrics parameter of Set
  2280.           Default Parameter Format)
  2281.  
  2282.   0     X'21' Set Current Defaults
  2283.   1     Length of following data
  2284.   2     Set Default Pick Identifier X'0C'
  2285.   3-4   Mask--OR of as many of the following bits as are required:
  2286.         X'8000' Pick identifier
  2287.   5     Flags
  2288.         X'0F' Set indicated default attributes to initial values.
  2289.                         (Data field is not present in this case).
  2290.         X'8F' Set indicated default attributes to specified values.
  2291.   6-n   Data--data values as required, in the following order if
  2292.         present. No space is reserved for attributes for which the
  2293.         corresponding Mask flag was not set.
  2294.         (4 bytes) - Pick identifier
  2295.  
  2296.   0     X'E7' Set Bit-map Identifier
  2297.   1     Length of following data X'07'
  2298.   2-3   Usage Flags X'8000'
  2299.   4-7   Bit-map handle
  2300.   8     Lcid
  2301.  
  2302. Graphics Data (GAD): optional, repeating
  2303.  
  2304.   Structured Field Introducer
  2305.   0-1   Length X'n+9'
  2306.   2-4   GAD X'D3EEBB'
  2307.   5     Flags X'00'
  2308.   6-7   Segment sequence number X'0000'
  2309.  
  2310.   Parameters (maximum length in one structured field is 32759)
  2311.  
  2312.   Graphics Segment (optional, repeating)
  2313.   Segment data (including the Begin Segment parameter) can be split
  2314.   at any point between successive Graphics Data structured fields.
  2315.   0     X'70' Begin Segment
  2316.   1     Length of following data X'0E'
  2317.   2-5   Segment identifier
  2318.   6     Segment attributes (1)
  2319.         0 B'1' Invisible
  2320.         1 B'1' Propagate invisibility
  2321.         2 B'1' Detectable
  2322.         3 B'1' Propagate detectability
  2323.         6 B'1' Dynamic
  2324.         7 B'1' Fast chaining
  2325.   7     Segment attributes (2)
  2326.         0 B'1' Non-chained
  2327.         3 B'1' Prolog
  2328.   8-9   Segment data length (low-order 2 bytes)
  2329.   10-13 Reserved
  2330.   14-15 Segment data length (high-order 2 bytes)
  2331.   16-n  Graphics orders (see page 33-1)
  2332.  
  2333. End Graphics Object (EGR)
  2334.   Structured Field Introducer
  2335.   0-1   Length X'0010'
  2336.   2-4   EGR X'D3A9BB'
  2337.   5     Flags X'00'
  2338.   6-7   Segment sequence number X'0000'
  2339.  
  2340.   Parameters
  2341.   0-7 Graphics object name C'0000 0007'
  2342.  
  2343. End Resource Group (ERG): required
  2344.   Structured Field Introducer
  2345.   0-1   Length X'0010'
  2346.   2-4   ERG X'D3A9C6'
  2347.   5     Flags X'00'
  2348.   6-7   Segment sequence number X'0000'
  2349.  
  2350.   Parameters
  2351.   0-7 Resource Group name  C'0000 0002'
  2352.  
  2353. End Document (EDT): required
  2354.  
  2355. Structured Field Introducer
  2356. 0-1     Length X'0010'
  2357. 2-4     EDT X'D3A9A8'
  2358. 5       Flags X'00'
  2359. 6-7     Segment sequence number X'0000'
  2360.  
  2361. Parameters
  2362. 0-7     Document name    C'0000 0001'
  2363.  
  2364.