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