GRFONTS.DEF 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455
  1. (******************************************************************************)
  2. (* GRFONTS.H - MetaWINDOW font file record data structure. *)
  3. (* *)
  4. (* Transcribed from GRFONTS.H by Metagraphics Software Corporation *)
  5. (* *)
  6. (* PSW 06/28/91 08:30am *)
  7. (******************************************************************************)
  8. (*# module(implementation=>off, init_code=>off) *)
  9. DEFINITION MODULE GrFonts;
  10. (*
  11. * Graphix
  12. * Release 3.7
  13. * (c) Copyright 1986-1992 PMI
  14. * Green Bay, Wisconsin
  15. * (414) 468-6040
  16. * All rights reserved
  17. *
  18. *)
  19. TYPE
  20. ofswid = RECORD (* Offset/Width Table Entry *)
  21. wid: SHORTCARD; (* character width *)
  22. ofs: SHORTCARD; (* character offset *)
  23. END;
  24. fontRcd = RECORD (* MetaWINDOW FONT DATA HEADER RECORD *)
  25. fontVer: BYTE; (* Font format version number (=2) *)
  26. fontRev: BYTE; (* Font style revision designation *)
  27. fontNameLen: BYTE; (* Font baseName length (0-15) *)
  28. fontBaseName: ARRAY [1..16] OF CHAR;(* Font Base Name *)
  29. fontSuffix1: ARRAY [1..10] OF CHAR;(* Font suffix 1 *)
  30. fontSuffix2: ARRAY [1..10] OF CHAR;(* Font suffix 2 *)
  31. fontSuffix3: ARRAY [1..10] OF CHAR;(* Font suffix 3 *)
  32. fontFacing: CHAR; (* Synthesized font facing flags *)
  33. fontSign: ARRAY [1..8] OF CHAR; (* 'METAFONT' signature *)
  34. fontWeight: BYTE; (* Font weight *)
  35. fontCoding: BYTE; (* Character set encoding *)
  36. fontSize: LONGCARD; (* Buffer size needed to hold font *)
  37. fontMax: WORD; (* Maximum character code *)
  38. fontMin: WORD; (* Minimum character code *)
  39. fontPtSize: SHORTINT; (* Point Size *)
  40. fontfamily: SHORTINT; (* Font family *)
  41. fontStyle: SHORTINT; (* Device style *)
  42. fontFlags: SHORTINT; (* Font flags *)
  43. fontColor:ARRAY [1..2] OF LONGINT; (* Font Character & bkground colors *)
  44. minChar: BYTE; (* Minimum ASCII character code *)
  45. maxChar: BYTE; (* Maximum ASCII character code *)
  46. chWidth: INTEGER; (* Fixed space character width *)
  47. chHeight: INTEGER; (* Character height *)
  48. chKern: INTEGER; (* Fixed space character offset *)
  49. ascent: INTEGER; (* Ascent *)
  50. descent: INTEGER; (* Descent *)
  51. lnSpacing: INTEGER; (* Vertical spacing between baselines *)
  52. chBad: WORD; (* Char to show for undefined codes *)
  53. chCenter:ARRAY [1..2] OF INTEGER; (* Icon or Marker center (X,Y) *)
  54. chAngle: INTEGER; (* Italicise slant angle *)
  55. chUnder: INTEGER; (* recommended txUnder setting *)
  56. chScore: INTEGER; (* recommended txScore setting *)
  57. locTbl: LONGINT; (* offset to locTable *)
  58. ofwdTbl: LONGINT; (* offset to ofwdTable *)
  59. kernTbl: LONGINT; (* offset to kernTable *)
  60. sizeTbl: LONGINT; (* offset to size/rotation tbl(strk) *)
  61. grafMapTbl: LONGINT; (* offset to font grafMap structure *)
  62. rowTbl: LONGINT; (* offset to grafMap rowTable(s) *)
  63. fontTbl: LONGINT; (* offset to font bitImage/nodes tbl *)
  64. fontNotice: LONGINT; (* offset to trademk/cpyright notice *)
  65. fontSupplier: LONGINT; (* offset to name of font supplier *)
  66. fontAuthor: LONGINT; (* offset to name of font author *)
  67. fontInfo: LONGINT; (* offset to miscellaneous font info *)
  68. fontDate: LONGINT; (* offset to font creation date *)
  69. fontSpacing: LONGINT; (* Vertical spacing between baselines *)
  70. fontLowHgt: LONGINT; (* baseline to top of lowercase 'x' *)
  71. fontCapHgt: LONGINT; (* baseline to top of capital 'H' *)
  72. fontAscent: LONGINT; (* baseline to top of lowercase 'd' *)
  73. fontDescent: LONGINT; (* baseline to bottom of lowercase 'p'*)
  74. fontMaxWid: LONGINT; (* maximum character width *)
  75. fontAvgWid: LONGINT; (* average character width *)
  76. fontEmWid: LONGINT; (* Em space width *)
  77. fontRsvd: INTEGER; (* (reserved for future use) *)
  78. offwidTbl:ARRAY [1..16] OF LONGINT; (* offset to facing off/wid tables *)
  79. (* fontData *) (* font data/image tables (variable) *)
  80. END;
  81. adsFont = POINTER TO fontRcd;
  82. (*T MW_Ver4 *
  83. fontHeader = fontRcd;
  84. fontRec = fontRcd;
  85. *E MW_Ver4 *)
  86. (******************************************************************************
  87. MetaWINDOW FONT FILE FORMAT VERSION 2.1
  88. This document describes the font data record fields and structures used by
  89. the MetaWINDOW font system. The MetaWINDOW font system has been designed
  90. to permit extensions to be added in a simplified manner such that existing
  91. fonts remain upwardly compatible with new versions MetaWINDOW. Similiarly,
  92. a basic level of downward "compliablity" is offered for fonts created with
  93. later extensions, but, obviously, new extensions and functions will
  94. not be recognized by earlier versions of MetaWINDOW software. This document
  95. references MetaWINDOW Font File Format Version 2.1 implemented for MetaWINDOW
  96. Version 4 (Font Format Version 2.0 was previously used with MetaWINDOW
  97. Version 3).
  98. The first 256 bytes of a MetaWINDOW binary font contains a font header
  99. comprised of the following information:
  100. MetaWINDOW FONT HEADER RECORD
  101. -----------------------------
  102. fontVer is the MetaWINDOW font record format version number. The
  103. font version designation is divided into two parts,
  104. minorRev|majorRev, as follows:
  105. bit: 7654 3210
  106. ---- xxxx Major Revision
  107. xxxx ---- Minor Revision
  108. The font format version number described in this document is
  109. Version 2.1 which referenced in fontVer as "0x12"
  110. fontRev is the revision designation set by the font designer for this
  111. particular font style. The revision should be updated to
  112. reflect font revisions and edits.
  113. fontNameLen is the length (0-15) of the font baseName which follows.
  114. fontBaseName The ASCII string for the font name is divided into four parts.
  115. fontSuffix1 The "fontBaseName" is the basic font face styling of the
  116. fontSuffix2 font (up to 15 characters). Up to three (3) additional
  117. fontSuffix3 suffixes (up to 9 characters in length each) are optionally
  118. included to describe the fonts facing variation. For
  119. example a "Sheffield-DemiOblique" font would be defined as:
  120. fontBaseName = "Sheffield"
  121. fontSuffix1 = "Demi"
  122. fontSuffix2 = "Oblique"
  123. fontSuffix3 = NULL
  124. The partitioning of the font name facilitates creation
  125. of unique font abbreviations. For example, an abbreviated
  126. font menu name or file name can be created by using the first
  127. five characters of the fontBaseName, and the first three
  128. characters of each fontSuffix. "Sheffield-DemiOblique"
  129. becomes "SheffDemObl" in abbreviated form.
  130. fontFacing defines what types of synthesized font facings may be
  131. created by MetaWINDOW. In certain cases seperate fonts
  132. may be created to more accurately represent differernt
  133. font faces rather than use MetaWINDOWs built-in synthesized
  134. font facing features. For these cases, particular synthesized
  135. faces may be disabled and not performed by MetaWINDOW.
  136. The "fontFacing" field is defined as follows:
  137. 7654 3210 FONT FACING (.fontFacing)
  138. ---- ---1 Enable(0)/disable(1) synthesized Bold face
  139. ---- --1- Enable(0)/disable(1) synthesized Italic face
  140. ---- -1-- Enable(0)/disable(1) synthesized Condensed face
  141. ---- 1--- Enable(0)/disable(1) synthesized Extended face
  142. ---1 ---- Enable(0)/disable(1) synthesized Underline
  143. --1- ---- Enable(0)/disable(1) synthesized Strikeout
  144. For example, if a seperate font has been created to more
  145. closely represent "TimesRoman-Italic", the .fontFacing
  146. flags for the font may be set to "0x0E" to allow only
  147. synthesized "bold", "underline" and "strikeout" facings
  148. with "italic", "condensed" and "extended" synthesis disabled.
  149. fontSign is the Metagraphics signature for a MetaWINDOW font. This
  150. field is set equal to the eight ASCII characters "METAFONT"
  151. and may be tested to verify the identity of a Metagraphics
  152. font. The "METAFONT" signature is also used to identify
  153. byte order sequence for fonts ported from other systems.
  154. fontSize is the size of the memory font buffer (in bytes) needed to
  155. hold this font. fontSize defines the memory requirement
  156. needed for holding this font, which may be larger than the
  157. fonts "file size" after the font is decompacted.
  158. fontMin is the minimum character code value defined in this font.
  159. (minimum 0).
  160. fontMax is the maximum character code value defined in this font
  161. (the maximum character code value is 65535).
  162. fontWeight indicates the general font "blackness" in a range of values
  163. from 0 (light) to 255 (max-black). Eight weight "ranges"
  164. are predefined for designating a fonts "weight" (the mid
  165. value is the nominal designation for each range):
  166. weightRange Nominal Weight
  167. 0-31 16 Light
  168. 32-63 48 Book
  169. 64-95 80 Medium (default)
  170. 96-127 112 Demi-bold
  171. 128-159 144 Bold
  172. 160-191 176 Extra-bold
  173. 192-223 208 Ultra-bold
  174. 224-255 240 Black
  175. fontCoding designates the character encoding sequence for this font.
  176. The character encoding defines the mapping between character
  177. values and the displayed character. The following character
  178. coding sequences are currently defined:
  179. 0 = ANSI (default)
  180. 1 = EBCDIC
  181. 2 = IBM
  182. 3 = ADOBE
  183. 4 = MAC
  184. 5 = KANJI
  185. fontPtSize is the designated font size as measured in "points" (1/72nds
  186. of an inch) for this font when displayed on a device with
  187. the appropriate resolution (pixResX and pixResY) for which
  188. this font was created.
  189. fontFamily identifies a generic font family grouping for this font,
  190. and a unique font identification number assigned by
  191. Metagraphics. The fontFamily field is encoded in the
  192. following format:
  193. FEDC BA98 7654 3210 FONT FAMILY
  194. ---- xxxx xxxx xxxx Font family ID number (0-4095)
  195. xxxx ---- ---- ---- Font family group (0-16):
  196. 0 = undefined
  197. 1 = Serif (Times, Century Schoolbook, etc.)
  198. 2 = Sans-Serif (Helvetica, Swiss, etc.)
  199. 3 = Modern (Pica, Elite, Courier, etc.)
  200. 4 = Script (Cursive)
  201. 5 = Symbol
  202. 7 = Decorative
  203. 8 = Icon
  204. 9-15 = (reserved)
  205. fontStyle defines the font facing style characteristics for this
  206. font. fontStyle is defined in the following format:
  207. bit: FDEC BA98 7654 3210 FONT STYLE (.fontStyle)
  208. = 1 ---- ---- ---- ---1 Bold
  209. = 2 ---- ---- ---- --1- Italic
  210. = 4 ---- ---- ---- -1-- Condensed
  211. = 8 ---- ---- ---- 1--- Extended
  212. = 16 ---- ---- ---1 ---- Underline
  213. = 32 ---- ---- --1- ---- Strikeout
  214. = 64 ---- ---- -1-- ---- Outline
  215. =128 ---- ---- 1--- ---- Shadow
  216. fontFlags defines miscelleanous detail information regarding this font:
  217. FEDC BA98 7654 3210 FONT FLAGS (.fontFlags)
  218. ---- ---- ---- -xxx Geometry: 0 = bitmap font
  219. 1 = stroked font
  220. 2 = outline font
  221. 3-7 = reserved
  222. ---- ---- ---- x--- Pitch: fixed(0) or
  223. proportional(1) spacing
  224. ---- ---- --xx ---- Compression: 0 = no compression
  225. 1 = 1D run-length encoding
  226. 2 = 2D run-length encoding
  227. ---- --xx ---- ---- Offset/Width
  228. Precision: 0 = integer
  229. 1 = 1/256
  230. 2 = 1/65535
  231. ---- xx-- ---- ---- Pixel Order: 0 = PC (left=msb)
  232. 1 = TI (left=lsb)
  233. fontColor is the character color (fontColor[0]) and backgound color
  234. (fontColor[1]) of the font. Normally these values are set
  235. to 0xFFFFFFFF (white) and 0x00000000 (black) for the character
  236. foreground and background colors, respectively. These values
  237. are updated by MetaWINDOW during execution when a font
  238. needs to be color translated for multi-bit per pixel adaptors.
  239. minChar For ASCII encoded fonts, minChar defines the minimum ASCII
  240. code for the font. Normally this value is "fontMin & 255".
  241. maxChar For ASCII encoded fonts, maxChar defines the maximum ASCII
  242. code for the font. Normally this value is "fontMax & 255".
  243. chWidth defines the default character width, in integer pixels, when
  244. fixed-width facing is active.
  245. chHeight defines the height of the character bit image in pixels.
  246. "chHeight" is the equal to the sum of "ascent+descent".
  247. chKern specifies the default kerning offset, in integer pixels, when
  248. fixed-width facing is active (default 0).
  249. ascent is the number of pixels above the baseline the font rises.
  250. descent is the number of pixels below the baseline descenders fall.
  251. lnSpacing is the recommended spacing, in integer pixels, to seperate
  252. consecuative text lines (default chHeight+2).
  253. chBad is the character to display for "undefined" character codes.
  254. chOrient defines the orientation of the characters in this font,
  255. measured in integer tenth of degrees (default 0).
  256. chCenter[2] defines the center position for characters in symbol or
  257. marker fonts. "chCenter" is measured from the lower-left
  258. corner of the character cell. For character fonts chCenter
  259. should be set equal to (0,0).
  260. chAngle specifies the recommended slant angle for synthesizing
  261. italic facing. chAngle is specified in interger tenth
  262. of degree increments (default -200 = -20.0 degrees).
  263. chUnder is the recommended TextUnder setting for this font (default 1).
  264. chScore is the recommended TextScore setting for this font (default 1).
  265. locTbl is the offset to the start of the "locTable" array.
  266. ofwdTbl is the offset to the start of the "ofwdTable" array.
  267. kernTbl is the offset to the start of the "kernTable" array.
  268. sizeTbl is the offset to the start of the size/rotation table
  269. for stroked/outline fonts.
  270. bmapTbl is the offset to the start of the fonts "grafMap"
  271. (bitmap) data record.
  272. rowTbl is the offset to the start of the fonts grafMap
  273. "rowTable" array.
  274. fontTbl is the offset to the start of the fonts pixel image
  275. data (for bitmap fonts), or to the fonts geometry data
  276. (for stroked/outline fonts).
  277. fontNotice is the offset to the start of the character string of
  278. the fonts trademark/copyright notice.
  279. fontSupplier is the offset to the start of the character string of
  280. the font suppliers name.
  281. fontAuthor is the offset to the start of the character string of
  282. the fonts author name.
  283. fontInfo is the offset to the start of the character string
  284. containing miscellaneous information about this font.
  285. The following font fields are defined for use with "precision" fonts only
  286. (fontFlags.precision > 0).
  287. fontSpacing is the fixed point (integer.fractional) distance recommended
  288. to seperate consecutive baselines of text vertically.
  289. fontxHgt is the fixed point distance (integer.fraction) between
  290. the font baseline to the top of lowercase "x".
  291. fontCapHgt is the fixed point distance (integer.fraction) between
  292. the font baseline to the top of capital "H".
  293. fontAscent is the fixed point distance (integer.fraction) between
  294. the font baseline to the top of lowercase "d".
  295. fontDescent is the fixed point distance (integer.fraction) between
  296. the font baseline to the bottom of lowercase "p".
  297. fontMaxWid is the fixed point width (integer.fraction) of the
  298. widest character in the font (typically "M" or "W").
  299. fontAvgWid is the fixed point value (integer.fraction) for the
  300. average character width in the font.
  301. fontEmWid is the fixed point value (integer.fraction) for a
  302. typographic "em" width for this font.
  303. offwidTbl is a table of offsets from the beginning of the font buffer
  304. to the start of multiple facing offset/width facing tables.
  305. The following bit combinations serve as "offwidTbl" indexes
  306. for locating different ofwdTbl arrays for use with synthesized
  307. facing:
  308. =1 ---1 Bold
  309. =2 --1- Italic
  310. =4 -1-- Condensed
  311. =8 1--- Extended
  312. For example, "offwidTbl[3]" is the offset value from the
  313. beginning of the font record to the start of the "ofwdTable"
  314. to use when performing synthesized "bold+italic" facing.
  315. *******************************************************************************)
  316. END GrFonts.