|
|
1.1 root 1: /***********************************************************
2: Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
3: and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
4:
5: All Rights Reserved
6:
7: Permission to use, copy, modify, and distribute this software and its
8: documentation for any purpose and without fee is hereby granted,
9: provided that the above copyright notice appear in all copies and that
10: both that copyright notice and this permission notice appear in
11: supporting documentation, and that the names of Digital or MIT not be
12: used in advertising or publicity pertaining to distribution of the
13: software without specific, written prior permission.
14:
15: DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
16: ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
17: DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
18: ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
19: WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
20: ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
21: SOFTWARE.
22:
23: ******************************************************************/
24: #ifndef FONTSTRUCT_H
25: #define FONTSTRUCT_H 1
26: #include "font.h"
27: #include "misc.h"
28:
29: /*
30: * This file describes the Server Natural Font format.
31: * SNF fonts are both CPU-dependent and frame buffer bit order dependent.
32: * This file is used by:
33: * 1) the server, to hold font information read out of font files.
34: * 2) font converters
35: *
36: * Each font file contains the following
37: * data structures, with no padding in-between.
38: *
39: * 1) The XFONTINFO structure
40: * hand-padded to a two-short boundary.
41: *
42: * 2) The XCHARINFO array
43: * indexed directly with character codes, both on disk
44: * and in memory.
45: *
46: * 3) Character glyphs
47: * padded in the server-natural way, and
48: * ordered in the device-natural way.
49: * End of glyphs padded to 32-bit boundary.
50: *
51: * 4) nProps font properties
52: *
53: * 5) a sequence of null-terminated strings, for font properties
54: */
55:
56:
57: typedef struct _FontProp {
58: CARD32 name; /* offset of string */
59: INT32 value; /* number or offset of string */
60: Bool indirect; /* value is a string offset */
61: } FontPropRec;
62:
63: typedef struct _CharInfo {
64: xCharInfo metrics; /* info preformatted for Queries */
65: unsigned byteOffset:24; /* byte offset of the raster from pGlyphs */
66: Bool exists:1; /* true iff glyph exists for this char */
67: unsigned pad:7; /* must be zero for now */
68: } CharInfoRec;
69:
70: /*
71: * maxbounds.byteOffset is the total number of bytes in the glyph array,
72: * and maxbounds.bitOffset is total width of the unpadded font.
73: */
74: typedef struct _FontInfo {
75: unsigned int version1; /* version stamp */
76: unsigned int allExist;
77: unsigned int drawDirection;
78: unsigned int noOverlap;
79: unsigned int constantMetrics;
80: unsigned int terminalFont; /* constant metrics &&
81: width of glyph == width of char &&
82: height of glyph == height of font
83: */
84: unsigned int linear:1; /* true if nRows == 0 */
85: unsigned int padding:31;
86: unsigned int firstCol;
87: unsigned int lastCol;
88: unsigned int firstRow;
89: unsigned int lastRow;
90: unsigned int nProps;
91: unsigned int lenStrings; /* length in bytes of string table */
92: unsigned int chDefault; /* default character */
93: unsigned int fontDescent; /* minimum for quality typography */
94: unsigned int fontAscent; /* minimum for quality typography */
95: CharInfoRec minbounds; /* MIN of glyph metrics over all chars */
96: CharInfoRec maxbounds; /* MAX of glyph metrics over all chars */
97: unsigned int pixDepth; /* intensity bits per pixel */
98: unsigned int glyphSets; /* number of sets of glyphs, for
99: ONT sub-pixel positioning */
100: unsigned int version2; /* version stamp double-check */
101: } FontInfoRec;
102:
103: typedef struct _ExtentInfo {
104: DrawDirection drawDirection;
105: int fontAscent;
106: int fontDescent;
107: int overallAscent;
108: int overallDescent;
109: int overallWidth;
110: int overallLeft;
111: int overallRight;
112: } ExtentInfoRec;
113:
114: #endif /* FONTSTRUCT_H */
115:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.