File: ttf.h

package info (click to toggle)
vflib3 3.6.14.dfsg-3+nmu3
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 11,536 kB
  • ctags: 3,710
  • sloc: ansic: 35,811; sh: 10,357; asm: 3,290; makefile: 962; lisp: 123; perl: 109; awk: 43
file content (175 lines) | stat: -rw-r--r-- 6,060 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
/*
 * ttf.h - a heder file for TrueType driver with FreeType.
 * by Hirotsugu Kakugawa
 *
 */
/*
 * Copyright (C) 1996-1998 Hirotsugu Kakugawa. 
 * All rights reserved.
 *
 * This file is part of the VFlib Library.  This library is free
 * software; you can redistribute it and/or modify it under the terms of
 * the GNU Library General Public License as published by the Free
 * Software Foundation; either version 2 of the License, or (at your
 * option) any later version.  This library is distributed in the hope
 * that it will be useful, but WITHOUT ANY WARRANTY; without even the
 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 * PURPOSE.  See the GNU Library General Public License for more details.
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#ifndef __VFLIB_TTF_H__

#define __VFLIB_TTF_H__


#define FONTCLASS_NAME                "truetype"

#define VF_CAPE_TTF_FONT_NUMBER       "font-number"
#define VF_CAPE_TTF_PLATFORM_ID       "platform-id"
#define VF_CAPE_TTF_ENCODING_ID       "encoding-id"
#define VF_CAPE_TTF_MAPPING_ID        "mapping-id"
#define VF_CAPE_TTF_ENCODING_FORCE    "encoding-force"
#define VF_CAPE_TTF_HINTING           "hinting"
#define VF_CAPE_TTF_JISX0212_R47ES    "jisx0212-row47-empty-sjis"

#define TTF_ENV_FONT_DIR            "VFLIB_TTF_FONTS"

#ifndef  DEFAULT_EXTENSIONS
#  define   DEFAULT_EXTENSIONS      ".ttf, .ttc"
#endif

#define   POINTS_PER_INCH          72.27

#define   DEFAULT_POINT_SIZE       12.0
#define   DEFAULT_PIXEL_SIZE       24
#define   DEFAULT_DIRECTION        'H'  /* horizontal */



#define TTF_OL_ONCURVE                0x01
#define TTF_OL_X_BYTE                 0x02
#define TTF_OL_Y_BYTE                 0x04
#define TTF_OL_REPEAT_FLAGS           0x08
#define TTF_OL_SHORT_X_IS_POSITIVE    0x10
#define TTF_OL_NEXT_X_IS_ZERO         0x10
#define TTF_OL_SHORT_Y_IS_POSITIVE    0x20
#define TTF_OL_NEXT_Y_IS_ZERO         0x20

#define TTF_OL_COMP_ARG1_AND_2_ARE_WORDS      (1<<0)
#define TTF_OL_COMP_ARGS_ARE_XY_VALUES        (1<<1)
#define TTF_OL_COMP_ROUND_XY_TO_GRID          (1<<2)
#define TTF_OL_COMP_WE_HAVE_A_SCALE           (1<<3)
#define TTF_OL_COMP_RESERVED                  (1<<4)
#define TTF_OL_COMP_MORE_COMPONENTS           (1<<5)
#define TTF_OL_COMP_WE_HAVE_AN_X_AND_Y_SCALE  (1<<6)
#define TTF_OL_COMP_WE_HAVE_A_TWO_BY_TWO      (1<<7)
#define TTF_OL_COMP_WE_HAVE_INSTRUCTIONS      (1<<8)
#define TTF_OL_COMP_USE_MY_METRICS            (1<<9)

#define TT_MAP_ID_SEARCH      -1

#define TT_PLAT_ID_ANY         -1
#define TT_PLAT_ID_APPLE       0
#define TT_PLAT_ID_MACINTOSH   1
#define TT_PLAT_ID_ISO         2
#define TT_PLAT_ID_MICROSOFT   3

#define TT_ENC_ID_ANY                     -1
#define TT_ENC_ID_ISO_ASCII                0
#define TT_ENC_ID_ISO_10646                1                
#define TT_ENC_ID_ISO_8859_1               2

#define TT_ENC_ID_MS_SYMBOL                0
#define TT_ENC_ID_MS_UNICODE               1
#define TT_ENC_ID_MS_SHIFT_JIS             2
#define TT_ENC_ID_MS_BIG5                  3
#define TT_ENC_ID_MS_RPC                   4
#define TT_ENC_ID_MS_WANSUNG               5
#define TT_ENC_ID_MS_JOHAB                 6   
#define TT_ENC_ID_APPLE_DEFAULT            0
#define TT_ENC_ID_APPLE_UNICODE_1_1        1
#define TT_ENC_ID_APPLE_ISO_10646          2
#define TT_ENC_ID_APPLE_UNICODE_2_0        3
#define TT_ENC_ID_MAC_ROMAN                0
#define TT_ENC_ID_MAC_JAPANESE             1
#define TT_ENC_ID_MAC_TRADITIONAL_CHINESE  2
#define TT_ENC_ID_MAC_KOREAN               3
#define TT_ENC_ID_MAC_ARABIC               4
#define TT_ENC_ID_MAC_HEBREW               5
#define TT_ENC_ID_MAC_GREEK                6
#define TT_ENC_ID_MAC_RUSSIAN              7
#define TT_ENC_ID_MAC_RSYMBOL              8
#define TT_ENC_ID_MAC_DEVANAGARI           9
#define TT_ENC_ID_MAC_GURMUKHI             10
#define TT_ENC_ID_MAC_GUJARATI             11
#define TT_ENC_ID_MAC_ORIYA                12
#define TT_ENC_ID_MAC_BENGALI              13
#define TT_ENC_ID_MAC_TAMIL                14
#define TT_ENC_ID_MAC_TELUGU               15
#define TT_ENC_ID_MAC_KANNADA              16
#define TT_ENC_ID_MAC_MALAYALAM            17
#define TT_ENC_ID_MAC_SINHALESE            18
#define TT_ENC_ID_MAC_BURMESE              19
#define TT_ENC_ID_MAC_KHMER                20
#define TT_ENC_ID_MAC_THAI                 21
#define TT_ENC_ID_MAC_LAOTIAN              22
#define TT_ENC_ID_MAC_GEORGIAN             23
#define TT_ENC_ID_MAC_ARMENIAN             24
#define TT_ENC_ID_MAC_MALDIVIAN            25
#define TT_ENC_ID_MAC_SIMPLIFIED_CHINESE   25
#define TT_ENC_ID_MAC_TIBETAN              26
#define TT_ENC_ID_MAC_MONGOLIAN            27
#define TT_ENC_ID_MAC_GEEZ                 28
#define TT_ENC_ID_MAC_SLAVIC               29
#define TT_ENC_ID_MAC_VIETNAMESE           30
#define TT_ENC_ID_MAC_SINDHI               31
#define TT_ENC_ID_MAC_UNINTERP             32


/* 
 * TTF outlune
 */
typedef unsigned char   ttf_byte;
typedef char            ttf_char;
typedef unsigned short  ttf_ushort;
typedef short           ttf_short;
typedef unsigned long   ttf_ulong;
typedef long            ttf_long;
typedef long            ttf_fixed;
typedef short           ttf_funit;
typedef short           ttf_fword;
typedef unsigned short  ttf_ufword;
typedef short           ttf_f2dot14;

typedef struct {
  ttf_ufword advanceWidth;
  ttf_fword  lsb;
} ttf_hor_metrics;
typedef struct {
  ttf_ushort advanceHeight;
  ttf_short  tsb;
} ttf_ver_metrics;

typedef struct
{
  int            n_cts;
  int            xMin, yMin, xMax, yMax;
  ttf_hor_metrics  h_met;
  ttf_ver_metrics  v_met;
  int            n_pts;
  unsigned int   *end_points;
  int            n_instructions;
  unsigned char  *instructions;
  unsigned int   *flags;
  int            *xlist;
  int            *ylist;
} ttf_outline;
typedef ttf_outline *TTF_OUTLINE;


#endif /*__VFLIB_TTF_H__*/

/*EOF*/