| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455 |
- (******************************************************************************)
- (* GRFONTS.H - MetaWINDOW font file record data structure. *)
- (* *)
- (* Transcribed from GRFONTS.H by Metagraphics Software Corporation *)
- (* *)
- (* PSW 06/28/91 08:30am *)
- (******************************************************************************)
- (*# module(implementation=>off, init_code=>off) *)
- DEFINITION MODULE GrFonts;
- (*
- * Graphix
- * Release 3.7
- * (c) Copyright 1986-1992 PMI
- * Green Bay, Wisconsin
- * (414) 468-6040
- * All rights reserved
- *
- *)
- TYPE
- ofswid = RECORD (* Offset/Width Table Entry *)
- wid: SHORTCARD; (* character width *)
- ofs: SHORTCARD; (* character offset *)
- END;
- fontRcd = RECORD (* MetaWINDOW FONT DATA HEADER RECORD *)
- fontVer: BYTE; (* Font format version number (=2) *)
- fontRev: BYTE; (* Font style revision designation *)
- fontNameLen: BYTE; (* Font baseName length (0-15) *)
- fontBaseName: ARRAY [1..16] OF CHAR;(* Font Base Name *)
- fontSuffix1: ARRAY [1..10] OF CHAR;(* Font suffix 1 *)
- fontSuffix2: ARRAY [1..10] OF CHAR;(* Font suffix 2 *)
- fontSuffix3: ARRAY [1..10] OF CHAR;(* Font suffix 3 *)
- fontFacing: CHAR; (* Synthesized font facing flags *)
- fontSign: ARRAY [1..8] OF CHAR; (* 'METAFONT' signature *)
- fontWeight: BYTE; (* Font weight *)
- fontCoding: BYTE; (* Character set encoding *)
- fontSize: LONGCARD; (* Buffer size needed to hold font *)
- fontMax: WORD; (* Maximum character code *)
- fontMin: WORD; (* Minimum character code *)
- fontPtSize: SHORTINT; (* Point Size *)
- fontfamily: SHORTINT; (* Font family *)
- fontStyle: SHORTINT; (* Device style *)
- fontFlags: SHORTINT; (* Font flags *)
- fontColor:ARRAY [1..2] OF LONGINT; (* Font Character & bkground colors *)
- minChar: BYTE; (* Minimum ASCII character code *)
- maxChar: BYTE; (* Maximum ASCII character code *)
- chWidth: INTEGER; (* Fixed space character width *)
- chHeight: INTEGER; (* Character height *)
- chKern: INTEGER; (* Fixed space character offset *)
- ascent: INTEGER; (* Ascent *)
- descent: INTEGER; (* Descent *)
- lnSpacing: INTEGER; (* Vertical spacing between baselines *)
- chBad: WORD; (* Char to show for undefined codes *)
- chCenter:ARRAY [1..2] OF INTEGER; (* Icon or Marker center (X,Y) *)
- chAngle: INTEGER; (* Italicise slant angle *)
- chUnder: INTEGER; (* recommended txUnder setting *)
- chScore: INTEGER; (* recommended txScore setting *)
- locTbl: LONGINT; (* offset to locTable *)
- ofwdTbl: LONGINT; (* offset to ofwdTable *)
- kernTbl: LONGINT; (* offset to kernTable *)
- sizeTbl: LONGINT; (* offset to size/rotation tbl(strk) *)
- grafMapTbl: LONGINT; (* offset to font grafMap structure *)
- rowTbl: LONGINT; (* offset to grafMap rowTable(s) *)
- fontTbl: LONGINT; (* offset to font bitImage/nodes tbl *)
- fontNotice: LONGINT; (* offset to trademk/cpyright notice *)
- fontSupplier: LONGINT; (* offset to name of font supplier *)
- fontAuthor: LONGINT; (* offset to name of font author *)
- fontInfo: LONGINT; (* offset to miscellaneous font info *)
- fontDate: LONGINT; (* offset to font creation date *)
- fontSpacing: LONGINT; (* Vertical spacing between baselines *)
- fontLowHgt: LONGINT; (* baseline to top of lowercase 'x' *)
- fontCapHgt: LONGINT; (* baseline to top of capital 'H' *)
- fontAscent: LONGINT; (* baseline to top of lowercase 'd' *)
- fontDescent: LONGINT; (* baseline to bottom of lowercase 'p'*)
- fontMaxWid: LONGINT; (* maximum character width *)
- fontAvgWid: LONGINT; (* average character width *)
- fontEmWid: LONGINT; (* Em space width *)
- fontRsvd: INTEGER; (* (reserved for future use) *)
- offwidTbl:ARRAY [1..16] OF LONGINT; (* offset to facing off/wid tables *)
- (* fontData *) (* font data/image tables (variable) *)
- END;
- adsFont = POINTER TO fontRcd;
- (*T MW_Ver4 *
- fontHeader = fontRcd;
- fontRec = fontRcd;
- *E MW_Ver4 *)
- (******************************************************************************
- MetaWINDOW FONT FILE FORMAT VERSION 2.1
- This document describes the font data record fields and structures used by
- the MetaWINDOW font system. The MetaWINDOW font system has been designed
- to permit extensions to be added in a simplified manner such that existing
- fonts remain upwardly compatible with new versions MetaWINDOW. Similiarly,
- a basic level of downward "compliablity" is offered for fonts created with
- later extensions, but, obviously, new extensions and functions will
- not be recognized by earlier versions of MetaWINDOW software. This document
- references MetaWINDOW Font File Format Version 2.1 implemented for MetaWINDOW
- Version 4 (Font Format Version 2.0 was previously used with MetaWINDOW
- Version 3).
- The first 256 bytes of a MetaWINDOW binary font contains a font header
- comprised of the following information:
- MetaWINDOW FONT HEADER RECORD
- -----------------------------
- fontVer is the MetaWINDOW font record format version number. The
- font version designation is divided into two parts,
- minorRev|majorRev, as follows:
- bit: 7654 3210
- ---- xxxx Major Revision
- xxxx ---- Minor Revision
- The font format version number described in this document is
- Version 2.1 which referenced in fontVer as "0x12"
- fontRev is the revision designation set by the font designer for this
- particular font style. The revision should be updated to
- reflect font revisions and edits.
- fontNameLen is the length (0-15) of the font baseName which follows.
- fontBaseName The ASCII string for the font name is divided into four parts.
- fontSuffix1 The "fontBaseName" is the basic font face styling of the
- fontSuffix2 font (up to 15 characters). Up to three (3) additional
- fontSuffix3 suffixes (up to 9 characters in length each) are optionally
- included to describe the fonts facing variation. For
- example a "Sheffield-DemiOblique" font would be defined as:
- fontBaseName = "Sheffield"
- fontSuffix1 = "Demi"
- fontSuffix2 = "Oblique"
- fontSuffix3 = NULL
- The partitioning of the font name facilitates creation
- of unique font abbreviations. For example, an abbreviated
- font menu name or file name can be created by using the first
- five characters of the fontBaseName, and the first three
- characters of each fontSuffix. "Sheffield-DemiOblique"
- becomes "SheffDemObl" in abbreviated form.
- fontFacing defines what types of synthesized font facings may be
- created by MetaWINDOW. In certain cases seperate fonts
- may be created to more accurately represent differernt
- font faces rather than use MetaWINDOWs built-in synthesized
- font facing features. For these cases, particular synthesized
- faces may be disabled and not performed by MetaWINDOW.
- The "fontFacing" field is defined as follows:
- 7654 3210 FONT FACING (.fontFacing)
- ---- ---1 Enable(0)/disable(1) synthesized Bold face
- ---- --1- Enable(0)/disable(1) synthesized Italic face
- ---- -1-- Enable(0)/disable(1) synthesized Condensed face
- ---- 1--- Enable(0)/disable(1) synthesized Extended face
- ---1 ---- Enable(0)/disable(1) synthesized Underline
- --1- ---- Enable(0)/disable(1) synthesized Strikeout
- For example, if a seperate font has been created to more
- closely represent "TimesRoman-Italic", the .fontFacing
- flags for the font may be set to "0x0E" to allow only
- synthesized "bold", "underline" and "strikeout" facings
- with "italic", "condensed" and "extended" synthesis disabled.
- fontSign is the Metagraphics signature for a MetaWINDOW font. This
- field is set equal to the eight ASCII characters "METAFONT"
- and may be tested to verify the identity of a Metagraphics
- font. The "METAFONT" signature is also used to identify
- byte order sequence for fonts ported from other systems.
- fontSize is the size of the memory font buffer (in bytes) needed to
- hold this font. fontSize defines the memory requirement
- needed for holding this font, which may be larger than the
- fonts "file size" after the font is decompacted.
- fontMin is the minimum character code value defined in this font.
- (minimum 0).
- fontMax is the maximum character code value defined in this font
- (the maximum character code value is 65535).
- fontWeight indicates the general font "blackness" in a range of values
- from 0 (light) to 255 (max-black). Eight weight "ranges"
- are predefined for designating a fonts "weight" (the mid
- value is the nominal designation for each range):
- weightRange Nominal Weight
- 0-31 16 Light
- 32-63 48 Book
- 64-95 80 Medium (default)
- 96-127 112 Demi-bold
- 128-159 144 Bold
- 160-191 176 Extra-bold
- 192-223 208 Ultra-bold
- 224-255 240 Black
- fontCoding designates the character encoding sequence for this font.
- The character encoding defines the mapping between character
- values and the displayed character. The following character
- coding sequences are currently defined:
- 0 = ANSI (default)
- 1 = EBCDIC
- 2 = IBM
- 3 = ADOBE
- 4 = MAC
- 5 = KANJI
- fontPtSize is the designated font size as measured in "points" (1/72nds
- of an inch) for this font when displayed on a device with
- the appropriate resolution (pixResX and pixResY) for which
- this font was created.
- fontFamily identifies a generic font family grouping for this font,
- and a unique font identification number assigned by
- Metagraphics. The fontFamily field is encoded in the
- following format:
- FEDC BA98 7654 3210 FONT FAMILY
- ---- xxxx xxxx xxxx Font family ID number (0-4095)
- xxxx ---- ---- ---- Font family group (0-16):
- 0 = undefined
- 1 = Serif (Times, Century Schoolbook, etc.)
- 2 = Sans-Serif (Helvetica, Swiss, etc.)
- 3 = Modern (Pica, Elite, Courier, etc.)
- 4 = Script (Cursive)
- 5 = Symbol
- 7 = Decorative
- 8 = Icon
- 9-15 = (reserved)
- fontStyle defines the font facing style characteristics for this
- font. fontStyle is defined in the following format:
- bit: FDEC BA98 7654 3210 FONT STYLE (.fontStyle)
- = 1 ---- ---- ---- ---1 Bold
- = 2 ---- ---- ---- --1- Italic
- = 4 ---- ---- ---- -1-- Condensed
- = 8 ---- ---- ---- 1--- Extended
- = 16 ---- ---- ---1 ---- Underline
- = 32 ---- ---- --1- ---- Strikeout
- = 64 ---- ---- -1-- ---- Outline
- =128 ---- ---- 1--- ---- Shadow
- fontFlags defines miscelleanous detail information regarding this font:
- FEDC BA98 7654 3210 FONT FLAGS (.fontFlags)
- ---- ---- ---- -xxx Geometry: 0 = bitmap font
- 1 = stroked font
- 2 = outline font
- 3-7 = reserved
- ---- ---- ---- x--- Pitch: fixed(0) or
- proportional(1) spacing
- ---- ---- --xx ---- Compression: 0 = no compression
- 1 = 1D run-length encoding
- 2 = 2D run-length encoding
- ---- --xx ---- ---- Offset/Width
- Precision: 0 = integer
- 1 = 1/256
- 2 = 1/65535
- ---- xx-- ---- ---- Pixel Order: 0 = PC (left=msb)
- 1 = TI (left=lsb)
- fontColor is the character color (fontColor[0]) and backgound color
- (fontColor[1]) of the font. Normally these values are set
- to 0xFFFFFFFF (white) and 0x00000000 (black) for the character
- foreground and background colors, respectively. These values
- are updated by MetaWINDOW during execution when a font
- needs to be color translated for multi-bit per pixel adaptors.
- minChar For ASCII encoded fonts, minChar defines the minimum ASCII
- code for the font. Normally this value is "fontMin & 255".
- maxChar For ASCII encoded fonts, maxChar defines the maximum ASCII
- code for the font. Normally this value is "fontMax & 255".
- chWidth defines the default character width, in integer pixels, when
- fixed-width facing is active.
- chHeight defines the height of the character bit image in pixels.
- "chHeight" is the equal to the sum of "ascent+descent".
- chKern specifies the default kerning offset, in integer pixels, when
- fixed-width facing is active (default 0).
- ascent is the number of pixels above the baseline the font rises.
- descent is the number of pixels below the baseline descenders fall.
- lnSpacing is the recommended spacing, in integer pixels, to seperate
- consecuative text lines (default chHeight+2).
- chBad is the character to display for "undefined" character codes.
- chOrient defines the orientation of the characters in this font,
- measured in integer tenth of degrees (default 0).
- chCenter[2] defines the center position for characters in symbol or
- marker fonts. "chCenter" is measured from the lower-left
- corner of the character cell. For character fonts chCenter
- should be set equal to (0,0).
- chAngle specifies the recommended slant angle for synthesizing
- italic facing. chAngle is specified in interger tenth
- of degree increments (default -200 = -20.0 degrees).
- chUnder is the recommended TextUnder setting for this font (default 1).
- chScore is the recommended TextScore setting for this font (default 1).
- locTbl is the offset to the start of the "locTable" array.
- ofwdTbl is the offset to the start of the "ofwdTable" array.
- kernTbl is the offset to the start of the "kernTable" array.
- sizeTbl is the offset to the start of the size/rotation table
- for stroked/outline fonts.
- bmapTbl is the offset to the start of the fonts "grafMap"
- (bitmap) data record.
- rowTbl is the offset to the start of the fonts grafMap
- "rowTable" array.
- fontTbl is the offset to the start of the fonts pixel image
- data (for bitmap fonts), or to the fonts geometry data
- (for stroked/outline fonts).
- fontNotice is the offset to the start of the character string of
- the fonts trademark/copyright notice.
- fontSupplier is the offset to the start of the character string of
- the font suppliers name.
- fontAuthor is the offset to the start of the character string of
- the fonts author name.
- fontInfo is the offset to the start of the character string
- containing miscellaneous information about this font.
- The following font fields are defined for use with "precision" fonts only
- (fontFlags.precision > 0).
- fontSpacing is the fixed point (integer.fractional) distance recommended
- to seperate consecutive baselines of text vertically.
- fontxHgt is the fixed point distance (integer.fraction) between
- the font baseline to the top of lowercase "x".
- fontCapHgt is the fixed point distance (integer.fraction) between
- the font baseline to the top of capital "H".
- fontAscent is the fixed point distance (integer.fraction) between
- the font baseline to the top of lowercase "d".
- fontDescent is the fixed point distance (integer.fraction) between
- the font baseline to the bottom of lowercase "p".
- fontMaxWid is the fixed point width (integer.fraction) of the
- widest character in the font (typically "M" or "W").
- fontAvgWid is the fixed point value (integer.fraction) for the
- average character width in the font.
- fontEmWid is the fixed point value (integer.fraction) for a
- typographic "em" width for this font.
- offwidTbl is a table of offsets from the beginning of the font buffer
- to the start of multiple facing offset/width facing tables.
- The following bit combinations serve as "offwidTbl" indexes
- for locating different ofwdTbl arrays for use with synthesized
- facing:
- =1 ---1 Bold
- =2 --1- Italic
- =4 -1-- Condensed
- =8 1--- Extended
- For example, "offwidTbl[3]" is the offset value from the
- beginning of the font record to the start of the "ofwdTable"
- to use when performing synthesized "bold+italic" facing.
- *******************************************************************************)
- END GrFonts.
|