2 Parser and writer for truetype font files.
4 Part of the swftools package.
6 Copyright (c) 2010 Matthias Kramm <kramm@quiss.org>
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
27 typedef struct _ttf_table {
29 struct _ttf_table*prev;
30 struct _ttf_table*next;
37 typedef struct _table_maxp {
40 U16 maxComponentPoints;
41 U16 maxComponentContours;
43 U16 maxTwilightPoints;
46 U16 maxInstructionDefs;
48 U16 maxSizeOfInstructions;
49 U16 maxComponentElements;
50 U16 maxComponentDepth;
53 typedef struct _table_os2 {
59 U16 ySubscriptXOffset;
60 U16 ySubscriptYOffset;
61 U16 ySuperscriptXSize;
62 U16 ySuperscriptYSize;
63 U16 ySuperscriptXOffset;
64 U16 ySuperscriptYOffset;
66 U16 yStrikeoutPosition;
73 U8 panose_StrokeVariation;
90 /* for version >= 0x0001 */
94 /* for version >= 0x0002 */
102 typedef struct _table_hea
105 S16 minLeftSideBearing;
106 S16 minRightSideBearing;
113 #define GLYPH_ON_CURVE 0x01
114 #define GLYPH_CONTOUR_START 0x40
115 #define GLYPH_CONTOUR_END 0x80
117 typedef U32 unicode_t;
119 typedef struct _ttfpoint {
123 typedef struct _ttfglyph {
126 S16 xmin,ymin,xmax,ymax;
133 typedef struct _table_head {
136 S16 xmin,ymin,xmax,ymax;
138 U16 lowest_readable_size;
142 typedef struct _table_post {
144 U16 underline_position;
145 U16 underline_thickness;
148 typedef struct _ttf {
177 void ttf_reduce(ttf_t*ttf);
178 ttf_t*ttf_load(void*data, int length);
179 ttf_table_t*ttf_addtable(ttf_t*ttf, U32 tag);
180 void ttf_create_truetype_tables(ttf_t*ttf);
181 void ttf_dump(ttf_t*ttf);
182 void ttf_save(ttf_t*ttf, const char*filename);