]>
git.wh0rd.org - fontconfig.git/blob - fontconfig/fontconfig.h
2 * $XFree86: xc/lib/fontconfig/fontconfig/fontconfig.h,v 1.5 2002/03/01 01:00:54 keithp Exp $
4 * Copyright © 2001 Keith Packard, member of The XFree86 Project, Inc.
6 * Permission to use, copy, modify, distribute, and sell this software and its
7 * documentation for any purpose is hereby granted without fee, provided that
8 * the above copyright notice appear in all copies and that both that
9 * copyright notice and this permission notice appear in supporting
10 * documentation, and that the name of Keith Packard not be used in
11 * advertising or publicity pertaining to distribution of the software without
12 * specific, written prior permission. Keith Packard makes no
13 * representations about the suitability of this software for any purpose. It
14 * is provided "as is" without express or implied warranty.
16 * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
18 * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
19 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
20 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
21 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22 * PERFORMANCE OF THIS SOFTWARE.
25 #ifndef _FONTCONFIG_H_
26 #define _FONTCONFIG_H_
30 typedef unsigned char FcChar8
;
31 typedef unsigned short FcChar16
;
32 typedef unsigned int FcChar32
;
36 * Current Fontconfig version number
42 #define FC_VERSION ((FC_MAJOR * 10000) + (FC_MINOR * 100) + (FC_REVISION))
47 #define FC_FAMILY "family" /* String */
48 #define FC_STYLE "style" /* String */
49 #define FC_SLANT "slant" /* Int */
50 #define FC_WEIGHT "weight" /* Int */
51 #define FC_SIZE "size" /* Double */
52 #define FC_PIXEL_SIZE "pixelsize" /* Double */
53 #define FC_SPACING "spacing" /* Int */
54 #define FC_FOUNDRY "foundry" /* String */
55 #define FC_ANTIALIAS "antialias" /* Bool (depends) */
56 #define FC_HINTING "hinting" /* Bool (true) */
57 #define FC_VERTICAL_LAYOUT "verticallayout" /* Bool (false) */
58 #define FC_AUTOHINT "autohint" /* Bool (false) */
59 #define FC_GLOBAL_ADVANCE "globaladvance" /* Bool (true) */
60 #define FC_FILE "file" /* String */
61 #define FC_INDEX "index" /* Int */
62 #define FC_RASTERIZER "rasterizer" /* String */
63 #define FC_OUTLINE "outline" /* Bool */
64 #define FC_SCALABLE "scalable" /* Bool */
65 #define FC_SCALE "scale" /* double */
66 #define FC_DPI "dpi" /* double */
67 #define FC_RGBA "rgba" /* Int */
68 #define FC_MINSPACE "minspace" /* Bool use minimum line spacing */
69 #define FC_SOURCE "source" /* String (X11, freetype) */
70 #define FC_CHARSET "charset" /* CharSet */
71 #define FC_LANG "lang" /* String OS/2 CodePageRange */
73 #define FC_DIR_CACHE_FILE "fonts.cache"
74 #define FC_USER_CACHE_FILE ".fonts.cache"
76 /* Adjust outline rasterizer */
77 #define FC_CHAR_WIDTH "charwidth" /* Int */
78 #define FC_CHAR_HEIGHT "charheight"/* Int */
79 #define FC_MATRIX "matrix" /* FcMatrix */
81 #define FC_WEIGHT_LIGHT 0
82 #define FC_WEIGHT_MEDIUM 100
83 #define FC_WEIGHT_DEMIBOLD 180
84 #define FC_WEIGHT_BOLD 200
85 #define FC_WEIGHT_BLACK 210
87 #define FC_SLANT_ROMAN 0
88 #define FC_SLANT_ITALIC 100
89 #define FC_SLANT_OBLIQUE 110
91 #define FC_PROPORTIONAL 0
93 #define FC_CHARCELL 110
96 #define FC_RGBA_NONE 0
99 #define FC_RGBA_VRGB 3
100 #define FC_RGBA_VBGR 4
102 /* language groups from the OS/2 CodePageRange bits */
103 #define FC_LANG_LATIN_1 "latin1" /* 0 */
104 #define FC_LANG_LATIN_2_EASTERN_EUROPE "latin2easterneurope" /* 1 */
105 #define FC_LANG_CYRILLIC "cyrillic" /* 2 */
106 #define FC_LANG_GREEK "greek" /* 3 */
107 #define FC_LANG_TURKISH "turkish" /* 4 */
108 #define FC_LANG_HEBREW "hebrew" /* 5 */
109 #define FC_LANG_ARABIC "arabic" /* 6 */
110 #define FC_LANG_WINDOWS_BALTIC "windowsbaltic" /* 7 */
111 #define FC_LANG_VIETNAMESE "vietnamese" /* 8 */
112 /* 9-15 reserved for Alternate ANSI */
113 #define FC_LANG_THAI "thai" /* 16 */
114 #define FC_LANG_JAPANESE "japanese" /* 17 */
115 #define FC_LANG_SIMPLIFIED_CHINESE "simplifiedchinese" /* 18 */
116 #define FC_LANG_KOREAN_WANSUNG "koreanwansung" /* 19 */
117 #define FC_LANG_TRADITIONAL_CHINESE "traditionalchinese" /* 20 */
118 #define FC_LANG_KOREAN_JOHAB "koreanjohab" /* 21 */
119 /* 22-28 reserved for Alternate ANSI & OEM */
120 #define FC_LANG_MACINTOSH "macintosh" /* 29 */
121 #define FC_LANG_OEM "oem" /* 30 */
122 #define FC_LANG_SYMBOL "symbol" /* 31 */
123 /* 32-47 reserved for OEM */
124 #define FC_LANG_IBM_GREEK "ibmgreek" /* 48 */
125 #define FC_LANG_MSDOS_RUSSIAN "msdosrussian" /* 49 */
126 #define FC_LANG_MSDOS_NORDIC "msdosnordic" /* 50 */
127 #define FC_LANG_ARABIC_864 "arabic864" /* 51 */
128 #define FC_LANG_MSDOS_CANADIAN_FRENCH "msdoscanadianfrench" /* 52 */
129 #define FC_LANG_HEBREW_862 "hebrew862" /* 53 */
130 #define FC_LANG_MSDOS_ICELANDIC "msdosicelandic" /* 54 */
131 #define FC_LANG_MSDOS_PORTUGUESE "msdosportuguese" /* 55 */
132 #define FC_LANG_IBM_TURKISH "ibmturkish" /* 56 */
133 #define FC_LANG_IBM_CYRILLIC "ibmcyrillic" /* 57 */
134 #define FC_LANG_LATIN_2 "latin2" /* 58 */
135 #define FC_LANG_MSDOS_BALTIC "msdosbaltic" /* 59 */
136 #define FC_LANG_GREEK_437_G "greek437g" /* 60 */
137 #define FC_LANG_ARABIC_ASMO_708 "arabicasmo708" /* 61 */
138 #define FC_LANG_WE_LATIN_1 "welatin1" /* 62 */
139 #define FC_LANG_US "us" /* 63 */
141 typedef enum _FcType
{
151 typedef struct _FcMatrix
{
152 double xx
, xy
, yx
, yy
;
155 #define FcMatrixInit(m) ((m)->xx = (m)->yy = 1, \
156 (m)->xy = (m)->yx = 0)
159 * A data structure to represent the available glyphs in a font.
160 * This is represented as a sparse boolean btree.
163 typedef struct _FcCharSet FcCharSet
;
165 typedef struct _FcObjectType
{
170 typedef struct _FcConstant
{
176 typedef enum _FcResult
{
177 FcResultMatch
, FcResultNoMatch
, FcResultTypeMismatch
, FcResultNoId
180 typedef struct _FcValue
{
192 typedef struct _FcPattern FcPattern
;
194 typedef struct _FcFontSet
{
200 typedef struct _FcObjectSet
{
203 const char **objects
;
206 typedef enum _FcMatchKind
{
207 FcMatchPattern
, FcMatchFont
210 typedef enum _FcSetName
{
215 typedef struct _FcAtomic FcAtomic
;
217 #if defined(__cplusplus) || defined(c_plusplus) /* for C++ V2.0 */
218 #define _FCFUNCPROTOBEGIN extern "C" { /* do not leave open across includes */
219 #define _FCFUNCPROTOEND }
221 #define _FCFUNCPROTOBEGIN
222 #define _FCFUNCPROTOEND
225 typedef struct _FcConfig FcConfig
;
227 typedef struct _FcFileCache FcFileCache
;
229 typedef struct _FcBlanks FcBlanks
;
231 typedef struct _FcStrList FcStrList
;
233 typedef struct _FcStrSet FcStrSet
;
239 FcBlanksCreate (void);
242 FcBlanksDestroy (FcBlanks
*b
);
245 FcBlanksAdd (FcBlanks
*b
, FcChar32 ucs4
);
248 FcBlanksIsMember (FcBlanks
*b
, FcChar32 ucs4
);
252 FcConfigFilename (const FcChar8
*url
);
255 FcConfigCreate (void);
258 FcConfigDestroy (FcConfig
*config
);
261 FcConfigSetCurrent (FcConfig
*config
);
264 FcConfigGetCurrent (void);
267 FcConfigUptoDate (FcConfig
*config
);
270 FcConfigBuildFonts (FcConfig
*config
);
273 FcConfigGetFontDirs (FcConfig
*config
);
276 FcConfigGetConfigDirs (FcConfig
*config
);
279 FcConfigGetConfigFiles (FcConfig
*config
);
282 FcConfigGetCache (FcConfig
*config
);
285 FcConfigGetBlanks (FcConfig
*config
);
288 FcConfigGetRescanInverval (FcConfig
*config
);
291 FcConfigSetRescanInverval (FcConfig
*config
, int rescanInterval
);
294 FcConfigGetFonts (FcConfig
*config
,
298 FcConfigAppFontAddFile (FcConfig
*config
,
299 const FcChar8
*file
);
302 FcConfigAppFontAddDir (FcConfig
*config
,
306 FcConfigAppFontClear (FcConfig
*config
);
309 FcConfigSubstitute (FcConfig
*config
,
315 FcCharSetCreate (void);
318 FcCharSetDestroy (FcCharSet
*fcs
);
321 FcCharSetAddChar (FcCharSet
*fcs
, FcChar32 ucs4
);
324 FcCharSetCopy (FcCharSet
*src
);
327 FcCharSetEqual (const FcCharSet
*a
, const FcCharSet
*b
);
330 FcCharSetIntersect (const FcCharSet
*a
, const FcCharSet
*b
);
333 FcCharSetUnion (const FcCharSet
*a
, const FcCharSet
*b
);
336 FcCharSetSubtract (const FcCharSet
*a
, const FcCharSet
*b
);
339 FcCharSetHasChar (const FcCharSet
*fcs
, FcChar32 ucs4
);
342 FcCharSetCount (const FcCharSet
*a
);
345 FcCharSetIntersectCount (const FcCharSet
*a
, const FcCharSet
*b
);
348 FcCharSetSubtractCount (const FcCharSet
*a
, const FcCharSet
*b
);
351 FcCharSetCoverage (const FcCharSet
*a
, FcChar32 page
, FcChar32
*result
);
355 FcValuePrint (FcValue v
);
358 FcPatternPrint (FcPattern
*p
);
361 FcFontSetPrint (FcFontSet
*s
);
365 FcDefaultSubstitute (FcPattern
*pattern
);
369 FcFileScan (FcFontSet
*set
,
377 FcDirScan (FcFontSet
*set
,
385 FcDirSave (FcFontSet
*set
, FcStrSet
*dirs
, const FcChar8
*dir
);
388 FcDirCacheValid (const FcChar8
*dir
);
392 FcFreeTypeQuery (const FcChar8
*file
, int id
, FcBlanks
*blanks
, int *count
);
397 FcFontSetCreate (void);
400 FcFontSetDestroy (FcFontSet
*s
);
403 FcFontSetAdd (FcFontSet
*s
, FcPattern
*font
);
407 FcInitLoadConfig (void);
410 FcInitLoadConfigAndFonts (void);
416 FcInitReinitialize (void);
419 FcInitBringUptoDate (void);
423 FcObjectSetCreate (void);
426 FcObjectSetAdd (FcObjectSet
*os
, const char *object
);
429 FcObjectSetDestroy (FcObjectSet
*os
);
432 FcObjectSetVaBuild (const char *first
, va_list va
);
435 FcObjectSetBuild (const char *first
, ...);
438 FcFontSetList (FcConfig
*config
,
445 FcFontList (FcConfig
*config
,
452 FcAtomicCreate (const FcChar8
*file
);
455 FcAtomicLock (FcAtomic
*atomic
);
458 FcAtomicNewFile (FcAtomic
*atomic
);
461 FcAtomicOrigFile (FcAtomic
*atomic
);
464 FcAtomicReplaceOrig (FcAtomic
*atomic
);
467 FcAtomicDeleteNew (FcAtomic
*atomic
);
470 FcAtomicUnlock (FcAtomic
*atomic
);
473 FcAtomicDestroy (FcAtomic
*atomic
);
477 FcFontSetMatch (FcConfig
*config
,
484 FcFontMatch (FcConfig
*config
,
489 FcFontRenderPrepare (FcConfig
*config
,
494 FcFontSetSort (FcConfig
*config
,
504 FcMatrixCopy (const FcMatrix
*mat
);
507 FcMatrixEqual (const FcMatrix
*mat1
, const FcMatrix
*mat2
);
510 FcMatrixMultiply (FcMatrix
*result
, const FcMatrix
*a
, const FcMatrix
*b
);
513 FcMatrixRotate (FcMatrix
*m
, double c
, double s
);
516 FcMatrixScale (FcMatrix
*m
, double sx
, double sy
);
519 FcMatrixShear (FcMatrix
*m
, double sh
, double sv
);
524 FcNameRegisterObjectTypes (const FcObjectType
*types
, int ntype
);
527 FcNameUnregisterObjectTypes (const FcObjectType
*types
, int ntype
);
530 FcNameGetObjectType (const char *object
);
533 FcNameRegisterConstants (const FcConstant
*consts
, int nconsts
);
536 FcNameUnregisterConstants (const FcConstant
*consts
, int nconsts
);
539 FcNameGetConstant (FcChar8
*string
);
542 FcNameConstant (FcChar8
*string
, int *result
);
545 FcNameParse (const FcChar8
*name
);
548 FcNameUnparse (FcPattern
*pat
);
552 FcPatternCreate (void);
555 FcPatternDuplicate (FcPattern
*p
);
558 FcValueDestroy (FcValue v
);
561 FcValueSave (FcValue v
);
564 FcPatternDestroy (FcPattern
*p
);
567 FcPatternAdd (FcPattern
*p
, const char *object
, FcValue value
, FcBool append
);
570 FcPatternGet (FcPattern
*p
, const char *object
, int id
, FcValue
*v
);
573 FcPatternDel (FcPattern
*p
, const char *object
);
576 FcPatternAddInteger (FcPattern
*p
, const char *object
, int i
);
579 FcPatternAddDouble (FcPattern
*p
, const char *object
, double d
);
582 FcPatternAddString (FcPattern
*p
, const char *object
, const FcChar8
*s
);
585 FcPatternAddMatrix (FcPattern
*p
, const char *object
, const FcMatrix
*s
);
588 FcPatternAddCharSet (FcPattern
*p
, const char *object
, const FcCharSet
*c
);
591 FcPatternAddBool (FcPattern
*p
, const char *object
, FcBool b
);
594 FcPatternGetInteger (FcPattern
*p
, const char *object
, int n
, int *i
);
597 FcPatternGetDouble (FcPattern
*p
, const char *object
, int n
, double *d
);
600 FcPatternGetString (FcPattern
*p
, const char *object
, int n
, FcChar8
** s
);
603 FcPatternGetMatrix (FcPattern
*p
, const char *object
, int n
, FcMatrix
**s
);
606 FcPatternGetCharSet (FcPattern
*p
, const char *object
, int n
, FcCharSet
**c
);
609 FcPatternGetBool (FcPattern
*p
, const char *object
, int n
, FcBool
*b
);
612 FcPatternVaBuild (FcPattern
*orig
, va_list va
);
615 FcPatternBuild (FcPattern
*orig
, ...);
620 FcStrCopy (const FcChar8
*s
);
623 FcStrCopyFilename (const FcChar8
*s
);
625 #define FcToLower(c) (('A' <= (c) && (c) <= 'Z') ? (c) - 'A' + 'a' : (c))
628 FcStrCmpIgnoreCase (const FcChar8
*s1
, const FcChar8
*s2
);
631 FcStrCmp (const FcChar8
*s1
, const FcChar8
*s2
);
634 FcUtf8ToUcs4 (FcChar8
*src_orig
,
639 FcUtf8Len (FcChar8
*string
,
645 FcStrDirname (const FcChar8
*file
);
648 FcStrBasename (const FcChar8
*file
);
651 FcStrSetCreate (void);
654 FcStrSetMember (FcStrSet
*set
, const FcChar8
*s
);
657 FcStrSetAdd (FcStrSet
*set
, const FcChar8
*s
);
660 FcStrSetAddFilename (FcStrSet
*set
, const FcChar8
*s
);
663 FcStrSetDel (FcStrSet
*set
, const FcChar8
*s
);
666 FcStrSetDestroy (FcStrSet
*set
);
669 FcStrListCreate (FcStrSet
*set
);
672 FcStrListNext (FcStrList
*list
);
675 FcStrListDone (FcStrList
*list
);
679 FcConfigParseAndLoad (FcConfig
*config
, const FcChar8
*file
, FcBool complain
);
683 #endif /* _FONTCONFIG_H_ */