GRFONTS.LST 25 KB

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