1 /*
2  * TTFN is an alternative to XLFD suited for arbitrarily scalable fonts
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the Free Softaware
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17  *
18  */
19 
20 /*
21  * Why?
22  *
23  * A list request for the XLFD pattern "-*-Times-*100*" does not tell
24  * what this 100 means: Is it the pixelSize, the pointSize, the x resolution,
25  * the y resolution or the average width? Is it part of a 2x2 matrix used for
26  * rotating fonts? This *100* also matches 1000...1009 or 1100, 2100...
27  *
28  * The approach here is to be more specific depending on the context:
29  *	OpenFont name != ListFont result != ListFont pattern
30  * OpenFont names provide the fontname and rasterizer specific attributes
31  * ListFont results provide the fontname and raster independent attributes
32  *
33  */
34 
35 #ifndef TTFN_H
36 #define TTFN_H
37 
38 /***************************************************************************
39  * this struct is for XListFonts results
40  ***************************************************************************/
41 
42 // panose[0]	= bFamilyType
43 // panose[1]	= bSerifStyle
44 // panose[2]	= bWeight
45 // panose[3]	= bProportion
46 // panose[4]	= bContrast
47 // panose[5]	= bStrokeVariation
48 // panose[6]	= bArmStyle
49 // panose[7]	= bLetterForm
50 // panose[8]	= bMidLine
51 // panose[9]	= bXHeight
52 
53 typedef struct {
54 	uint8_t	nameLen;
55 	char	magic[2];		// magic == "TT"
56 	char	charset;		// U=unicode, A=ascii, S=symbol
57 	char	panoseMagic;		// 'P'
58 	char	panose[10][2];		// in hex
59 	char	modifier;		// italic
60 	char	underscore;
61 	//char	fontName[];
62 } TPFontName;
63 
64 /***************************************************************************
65  * this naming is for XOpenFont fontnames
66  ***************************************************************************/
67 
68 /* an TTFN openfont name consists of a start pattern, one char tags
69  * with decimal values, an underscore and a font name
70  *
71  * TT			(start pattern)
72  *
73  * MnnnMnnnMnnnMnnn	(scaling matrix: xx yy xy yx)
74  *			default.xx = default.pointsize
75  *			default.yy = xx
76  *			default.xy = 0;
77  *			default.yx = -xy
78  *
79  * RnnnRnnn		(resolution: xres yres)
80  *			default.yres = xres
81  *
82  * Fnnn			(flags)
83  *			default.flags = 0
84  *			bit0 = underlined
85  *			bit1 = strikeout
86  *			bit2 = subscript
87  *			bit3 = superscript
88  *			undefined bits must be zero
89  *
90  * example:
91  *	12 point subscripted Arial has the font name "TTM12F4_Arial"
92  */
93 
94 #endif
95