cheshirekow  v0.1.0
common.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 Josh Bialkowski (jbialk@mit.edu)
3  *
4  * This file is part of cppfontconfig.
5  *
6  * cppfontconfig is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * cppfontconfig is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with cppfontconfig. If not, see <http://www.gnu.org/licenses/>.
18  */
27 #ifndef CPPFONTCONFIG_COMMON_H_
28 #define CPPFONTCONFIG_COMMON_H_
29 
30 
31 
32 
33 
34 #define FCMM_DONT_CONSTRUCT( TYPE ) \
35 private: \
36  template <typename T> \
37  TYPE( const T& param ) \
38  { \
39  struct TYPE##_is_an_opaque_type_use_create_method{} obj; \
40  int i = obj; \
41  } \
42 
43 
44 namespace fontconfig
45 {
46 
47 
48 const unsigned int MAJOR = 2;
49 const unsigned int MINOR = 10;
50 const unsigned int REVISION = 0;
51 const unsigned int VERSION = ((MAJOR * 10000) + (MINOR * 100) + (REVISION));
52 
62 const char* const CACHE_VERSION = "3";
63 
64 
65 typedef unsigned char Char8_t;
66 typedef unsigned short Char16_t;
67 typedef unsigned int Char32_t;
68 typedef int Bool_t;
69 typedef int Object_t;
70 
72 const char* const FAMILY = "family";
73 const char* const STYLE = "style";
74 const char* const SLANT = "slant";
75 const char* const WEIGHT = "weight";
76 const char* const SIZE = "size";
77 const char* const ASPECT = "aspect";
78 const char* const PIXEL_SIZE = "pixelsize";
79 const char* const SPACING = "spacing";
80 const char* const FOUNDRY = "foundry";
81 const char* const ANTIALIAS = "antialias";
82 const char* const HINTING = "hinting";
83 const char* const HINT_STYLE = "hintstyle";
84 const char* const VERTICAL_LAYOUT = "verticallayout";
85 const char* const AUTOHINT = "autohint";
86 
87 /* GLOBAL_ADVANCE is deprecated. this is simply ignored on freetype 2.4.5 or later */
88 const char* const GLOBAL_ADVANCE = "globaladvance";
89 const char* const WIDTH = "width";
90 const char* const FILE = "file";
91 const char* const INDEX = "index";
92 const char* const FT_FACE = "ftface";
93 const char* const RASTERIZER = "rasterizer";
94 const char* const OUTLINE = "outline";
95 const char* const SCALABLE = "scalable";
96 const char* const SCALE = "scale";
97 const char* const DPI = "dpi";
98 const char* const RGBA = "rgba";
99 const char* const MINSPACE = "minspace";
100 const char* const SOURCE = "source";
101 const char* const CHARSET = "charset";
102 const char* const LANG = "lang";
103 const char* const FONTVERSION = "fontversion";
104 const char* const FULLNAME = "fullname";
105 const char* const FAMILYLANG = "familylang";
106 const char* const STYLELANG = "stylelang";
107 const char* const FULLNAMELANG = "fullnamelang";
108 const char* const CAPABILITY = "capability";
109 const char* const FONTFORMAT = "fontformat";
110 const char* const EMBOLDEN = "embolden";
111 const char* const EMBEDDED_BITMAP = "embeddedbitmap";
112 const char* const DECORATIVE = "decorative";
113 const char* const LCD_FILTER = "lcdfilter";
114 const char* const NAMELANG = "namelang";
115 
116 namespace key
117 {
118 
119 enum Key
120 {
162 };
163 
164 }
165 
166 typedef key::Key Key_t;
167 
168 
169 
170 // these "3" should probably not be written by hand, but I'm trying to
171 // avoid any macros... this can be done with boost::mpl
172 // (http://stackoverflow.com/questions/4693819/c-template-string-concatenation)
173 // but it seems kind of ridiculous to add that dependency to save 6 seconds
174 // of maintanance
175 const char* const CACHE_SUFFIX = ".cache-3";
176 const char* const DIR_CACHE_FILE = "fonts.cache-3";
177 const char* const USER_CACHE_FILE = ".fonts.cache-3";
178 
179 // Adjust outline rasterizer
180 const char* const CHAR_WIDTH = "charwidth";
181 const char* const CHAR_HEIGHT = "charheight";
182 const char* const MATRIX = "matrix";
183 
184 
185 
186 namespace weight
187 {
188 
189 const unsigned int THIN = 0;
190 const unsigned int EXTRALIGHT = 40;
191 const unsigned int ULTRALIGHT = EXTRALIGHT;
192 const unsigned int LIGHT = 50;
193 const unsigned int BOOK = 75;
194 const unsigned int REGULAR = 80;
195 const unsigned int NORMAL = REGULAR;
196 const unsigned int MEDIUM = 100;
197 const unsigned int DEMIBOLD = 180;
198 const unsigned int SEMIBOLD = DEMIBOLD;
199 const unsigned int BOLD = 200;
200 const unsigned int EXTRABOLD = 205;
201 const unsigned int ULTRABOLD = EXTRABOLD;
202 const unsigned int BLACK = 210;
203 const unsigned int HEAVY = BLACK;
204 const unsigned int EXTRABLACK = 215;
205 const unsigned int ULTRABLACK = EXTRABLACK;
206 
207 }
208 
209 
210 namespace slant
211 {
212 
213 const unsigned int ROMAN = 0;
214 const unsigned int ITALIC = 100;
215 const unsigned int OBLIQUE = 110;
216 
217 }
218 
219 namespace width
220 {
221 
222 const unsigned int ULTRACONDENSED = 50;
223 const unsigned int EXTRACONDENSED = 63;
224 const unsigned int CONDENSED = 75;
225 const unsigned int SEMICONDENSED = 87;
226 const unsigned int NORMAL = 100;
227 const unsigned int SEMIEXPANDED = 113;
228 const unsigned int EXPANDED = 125;
229 const unsigned int EXTRAEXPANDED = 150;
230 const unsigned int ULTRAEXPANDED = 200;
231 
232 }
233 
234 namespace rgba
235 {
236 
237 const unsigned int UNKNOWN = 0;
238 const unsigned int RGB = 1;
239 const unsigned int BGR = 2;
240 const unsigned int VRGB = 3;
241 const unsigned int VBGR = 4;
242 const unsigned int NONE = 5;
243 
244 }
245 
246 namespace hint
247 {
248 
249 const unsigned int NONE = 0;
250 const unsigned int SLIGHT = 1;
251 const unsigned int MEDIUM = 2;
252 const unsigned int FULL = 3;
253 
254 }
255 
256 namespace lcd
257 {
258 
259 const unsigned int NONE = 0;
260 const unsigned int DEFAULT = 1;
261 const unsigned int LIGHT = 2;
262 const unsigned int LEGACY = 3;
263 
264 }
265 
266 namespace type
267 {
268 
269 enum Type {
279 };
280 
281 }
282 
284 
285 namespace match
286 {
287 
289 {
293 };
294 
295 }
296 
298 
299 namespace qual
300 {
301 
302 enum Qual
303 {
308 };
309 
310 
311 }
312 
314 
315 
316 namespace op
317 {
318 
319 enum Op
320 {
333 };
334 
335 }
336 
337 typedef op::Op Op_t;
338 
339 
340 namespace lang
341 {
342 
343 enum Result
344 {
345  Equal = 0,
349 };
350 
351 }
352 
354 
355 
356 namespace result
357 {
358 
359 enum Result
360 {
366 };
367 
368 }
369 
371 
372 
373 namespace setname
374 {
375 
377 {
378  System = 0,
380 };
381 
382 }
383 
385 
386 namespace endian
387 {
388  enum Endian
389  {
392  };
393 }
394 
396 
397 }
398 
399 
400 
401 
402 
403 
404 
405 
406 
407 
408 
409 
410 
411 #endif // COMMON_H_
const char *const FOUNDRY
String.
Definition: common.h:80
const unsigned int MEDIUM
Definition: common.h:251
const char *const LCD_FILTER
Int.
Definition: common.h:113
const char *const SPACING
Int.
Definition: common.h:79
const unsigned int RGB
Definition: common.h:238
qual::Qual Qual_t
Definition: common.h:313
unsigned int Char32_t
Definition: common.h:67
const unsigned int ULTRABOLD
Definition: common.h:201
const char *const EMBEDDED_BITMAP
Bool - true to enable embedded bitmaps.
Definition: common.h:111
const char *const DIR_CACHE_FILE
Definition: common.h:176
const unsigned int ULTRAEXPANDED
Definition: common.h:230
setname::SetName SetName_t
Definition: common.h:384
const char *const ASPECT
Double.
Definition: common.h:77
const unsigned int LEGACY
Definition: common.h:262
const unsigned int REGULAR
Definition: common.h:194
const char *const CACHE_SUFFIX
Definition: common.h:175
const char *const RGBA
Int.
Definition: common.h:98
endian::Endian Endian_t
Definition: common.h:395
const unsigned int ULTRABLACK
Definition: common.h:205
result::Result Result_t
Definition: common.h:370
const unsigned int ITALIC
Definition: common.h:214
const char *const VERTICAL_LAYOUT
Bool (false)
Definition: common.h:84
const unsigned int ROMAN
Definition: common.h:213
const unsigned int MEDIUM
Definition: common.h:196
const char *const DECORATIVE
Bool - true if style is a decorative variant.
Definition: common.h:112
const unsigned int SLIGHT
Definition: common.h:250
const char *const SLANT
Int.
Definition: common.h:74
const char *const EMBOLDEN
Bool - true if emboldening needed.
Definition: common.h:110
const unsigned int DEFAULT
Definition: common.h:260
const unsigned int NONE
Definition: common.h:259
const unsigned int EXTRABLACK
Definition: common.h:204
const unsigned int SEMICONDENSED
Definition: common.h:225
const char *const FULLNAME
String.
Definition: common.h:104
const unsigned int BOLD
Definition: common.h:199
const unsigned int BGR
Definition: common.h:239
const unsigned int NORMAL
Definition: common.h:195
match::MatchKind MatchKind_t
Definition: common.h:297
const unsigned int ULTRACONDENSED
Definition: common.h:222
key::Key Key_t
Definition: common.h:166
unsigned char Char8_t
Definition: common.h:65
const unsigned int SEMIBOLD
Definition: common.h:198
const char *const RASTERIZER
String.
Definition: common.h:93
const char *const ANTIALIAS
Bool (depends)
Definition: common.h:81
const unsigned int SEMIEXPANDED
Definition: common.h:227
const char *const MINSPACE
Bool use minimum line spacing.
Definition: common.h:99
const unsigned int EXTRALIGHT
Definition: common.h:190
const char *const PIXEL_SIZE
Double.
Definition: common.h:78
const char *const CHAR_WIDTH
Int.
Definition: common.h:180
op::Op Op_t
Definition: common.h:337
const char *const FAMILYLANG
String RFC 3066 langs.
Definition: common.h:105
const char *const NAMELANG
String RFC 3866 langs.
Definition: common.h:114
const unsigned int FULL
Definition: common.h:252
const unsigned int NORMAL
Definition: common.h:226
const char *const GLOBAL_ADVANCE
Bool (true)
Definition: common.h:88
const unsigned int VERSION
Definition: common.h:51
const char *const STYLELANG
String RFC 3066 langs.
Definition: common.h:106
const char *const OUTLINE
Bool.
Definition: common.h:94
const char *const CHARSET
CharSet.
Definition: common.h:101
const char *const SOURCE
String (deprecated)
Definition: common.h:100
const unsigned int VRGB
Definition: common.h:240
const char *const CHAR_HEIGHT
Int.
Definition: common.h:181
const unsigned int LIGHT
Definition: common.h:192
const unsigned int LIGHT
Definition: common.h:261
const char *const CACHE_VERSION
Definition: common.h:62
const char *const INDEX
Int.
Definition: common.h:91
const char *const LANG
String RFC 3066 langs.
Definition: common.h:102
const char *const WEIGHT
Int.
Definition: common.h:75
const unsigned int EXTRABOLD
Definition: common.h:200
const unsigned int MINOR
Definition: common.h:49
const unsigned int VBGR
Definition: common.h:241
const unsigned int CONDENSED
Definition: common.h:224
const char *const CAPABILITY
String.
Definition: common.h:108
const unsigned int OBLIQUE
Definition: common.h:215
const char *const DPI
double
Definition: common.h:97
int Bool_t
Definition: common.h:68
lang::Result LangResult_t
Definition: common.h:353
const unsigned int UNKNOWN
Definition: common.h:237
const char *const USER_CACHE_FILE
Definition: common.h:177
const char *const HINT_STYLE
Int.
Definition: common.h:83
const char *const FAMILY
property keys
Definition: common.h:72
const char *const AUTOHINT
Bool (false)
Definition: common.h:85
const char *const FT_FACE
FT_Face.
Definition: common.h:92
const unsigned int NONE
Definition: common.h:242
type::Type Type_t
Definition: common.h:283
const char *const HINTING
Bool (true)
Definition: common.h:82
unsigned short Char16_t
Definition: common.h:66
const char *const FONTVERSION
Int from 'head' table.
Definition: common.h:103
const char *const STYLE
String.
Definition: common.h:73
const unsigned int MAJOR
Definition: common.h:48
const unsigned int DEMIBOLD
Definition: common.h:197
const unsigned int BOOK
Definition: common.h:193
const unsigned int EXPANDED
Definition: common.h:228
const char *const FILE
String.
Definition: common.h:90
const char *const FULLNAMELANG
String RFC 3066 langs.
Definition: common.h:107
int Object_t
Definition: common.h:69
const unsigned int REVISION
Definition: common.h:50
const char *const SIZE
Double.
Definition: common.h:76
const char *const SCALABLE
Bool.
Definition: common.h:95
const char *const MATRIX
FcMatrix.
Definition: common.h:182
const char *const SCALE
double
Definition: common.h:96
const unsigned int EXTRAEXPANDED
Definition: common.h:229
const char *const WIDTH
Int.
Definition: common.h:89
const unsigned int EXTRACONDENSED
Definition: common.h:223
const unsigned int HEAVY
Definition: common.h:203
const unsigned int THIN
Definition: common.h:189
const unsigned int BLACK
Definition: common.h:202
const unsigned int ULTRALIGHT
Definition: common.h:191
const char *const FONTFORMAT
String.
Definition: common.h:109
const unsigned int NONE
Definition: common.h:249