]>
git.wh0rd.org - fontconfig.git/blob - fontconfig/fontconfig.h
f5287d51d0a3f3a9ffecf9ac40a30c068a697e76
2 * $XFree86: xc/lib/fontconfig/fontconfig/fontconfig.h,v 1.18 2002/06/19 20:08:22 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_ASPECT "aspect" /* Double */
53 #define FC_PIXEL_SIZE "pixelsize" /* Double */
54 #define FC_SPACING "spacing" /* Int */
55 #define FC_FOUNDRY "foundry" /* String */
56 #define FC_ANTIALIAS "antialias" /* Bool (depends) */
57 #define FC_HINTING "hinting" /* Bool (true) */
58 #define FC_VERTICAL_LAYOUT "verticallayout" /* Bool (false) */
59 #define FC_AUTOHINT "autohint" /* Bool (false) */
60 #define FC_GLOBAL_ADVANCE "globaladvance" /* Bool (true) */
61 #define FC_FILE "file" /* String */
62 #define FC_INDEX "index" /* Int */
63 #define FC_FT_FACE "ftface" /* FT_Face */
64 #define FC_RASTERIZER "rasterizer" /* String */
65 #define FC_OUTLINE "outline" /* Bool */
66 #define FC_SCALABLE "scalable" /* Bool */
67 #define FC_SCALE "scale" /* double */
68 #define FC_DPI "dpi" /* double */
69 #define FC_RGBA "rgba" /* Int */
70 #define FC_MINSPACE "minspace" /* Bool use minimum line spacing */
71 #define FC_SOURCE "source" /* String (X11, freetype) */
72 #define FC_CHARSET "charset" /* CharSet */
73 #define FC_LANG "lang" /* String OS/2 CodePageRange */
75 #define FC_DIR_CACHE_FILE "fonts.cache"
76 #define FC_USER_CACHE_FILE ".fonts.cache"
78 /* Adjust outline rasterizer */
79 #define FC_CHAR_WIDTH "charwidth" /* Int */
80 #define FC_CHAR_HEIGHT "charheight"/* Int */
81 #define FC_MATRIX "matrix" /* FcMatrix */
83 #define FC_WEIGHT_LIGHT 0
84 #define FC_WEIGHT_MEDIUM 100
85 #define FC_WEIGHT_DEMIBOLD 180
86 #define FC_WEIGHT_BOLD 200
87 #define FC_WEIGHT_BLACK 210
89 #define FC_SLANT_ROMAN 0
90 #define FC_SLANT_ITALIC 100
91 #define FC_SLANT_OBLIQUE 110
93 #define FC_PROPORTIONAL 0
95 #define FC_CHARCELL 110
98 #define FC_RGBA_NONE 0
100 #define FC_RGBA_BGR 2
101 #define FC_RGBA_VRGB 3
102 #define FC_RGBA_VBGR 4
104 /* language groups from the OS/2 CodePageRange bits */
105 #define FC_LANG_LATIN_1 "latin1" /* 0 */
106 #define FC_LANG_LATIN_2_EASTERN_EUROPE "latin2easterneurope" /* 1 */
107 #define FC_LANG_CYRILLIC "cyrillic" /* 2 */
108 #define FC_LANG_GREEK "greek" /* 3 */
109 #define FC_LANG_TURKISH "turkish" /* 4 */
110 #define FC_LANG_HEBREW "hebrew" /* 5 */
111 #define FC_LANG_ARABIC "arabic" /* 6 */
112 #define FC_LANG_WINDOWS_BALTIC "windowsbaltic" /* 7 */
113 #define FC_LANG_VIETNAMESE "vietnamese" /* 8 */
114 /* 9-15 reserved for Alternate ANSI */
115 #define FC_LANG_THAI "thai" /* 16 */
116 #define FC_LANG_JAPANESE "japanese" /* 17 */
117 #define FC_LANG_SIMPLIFIED_CHINESE "simplifiedchinese" /* 18 */
118 #define FC_LANG_KOREAN_WANSUNG "koreanwansung" /* 19 */
119 #define FC_LANG_TRADITIONAL_CHINESE "traditionalchinese" /* 20 */
120 #define FC_LANG_KOREAN_JOHAB "koreanjohab" /* 21 */
121 /* 22-28 reserved for Alternate ANSI & OEM */
122 #define FC_LANG_MACINTOSH "macintosh" /* 29 */
123 #define FC_LANG_OEM "oem" /* 30 */
124 #define FC_LANG_SYMBOL "symbol" /* 31 */
125 /* 32-47 reserved for OEM */
126 #define FC_LANG_IBM_GREEK "ibmgreek" /* 48 */
127 #define FC_LANG_MSDOS_RUSSIAN "msdosrussian" /* 49 */
128 #define FC_LANG_MSDOS_NORDIC "msdosnordic" /* 50 */
129 #define FC_LANG_ARABIC_864 "arabic864" /* 51 */
130 #define FC_LANG_MSDOS_CANADIAN_FRENCH "msdoscanadianfrench" /* 52 */
131 #define FC_LANG_HEBREW_862 "hebrew862" /* 53 */
132 #define FC_LANG_MSDOS_ICELANDIC "msdosicelandic" /* 54 */
133 #define FC_LANG_MSDOS_PORTUGUESE "msdosportuguese" /* 55 */
134 #define FC_LANG_IBM_TURKISH "ibmturkish" /* 56 */
135 #define FC_LANG_IBM_CYRILLIC "ibmcyrillic" /* 57 */
136 #define FC_LANG_LATIN_2 "latin2" /* 58 */
137 #define FC_LANG_MSDOS_BALTIC "msdosbaltic" /* 59 */
138 #define FC_LANG_GREEK_437_G "greek437g" /* 60 */
139 #define FC_LANG_ARABIC_ASMO_708 "arabicasmo708" /* 61 */
140 #define FC_LANG_WE_LATIN_1 "welatin1" /* 62 */
141 #define FC_LANG_US "us" /* 63 */
142 #define FC_LANG_UNKNOWN "unknown" /* none of the above */
144 typedef enum _FcType
{
155 typedef struct _FcMatrix
{
156 double xx
, xy
, yx
, yy
;
159 #define FcMatrixInit(m) ((m)->xx = (m)->yy = 1, \
160 (m)->xy = (m)->yx = 0)
163 * A data structure to represent the available glyphs in a font.
164 * This is represented as a sparse boolean btree.
167 typedef struct _FcCharSet FcCharSet
;
169 typedef struct _FcObjectType
{
174 typedef struct _FcConstant
{
180 typedef enum _FcResult
{
181 FcResultMatch
, FcResultNoMatch
, FcResultTypeMismatch
, FcResultNoId
184 typedef struct _FcValue
{
197 typedef struct _FcPattern FcPattern
;
199 typedef struct _FcFontSet
{
205 typedef struct _FcObjectSet
{
208 const char **objects
;
211 typedef enum _FcMatchKind
{
212 FcMatchPattern
, FcMatchFont
215 typedef enum _FcSetName
{
220 typedef struct _FcAtomic FcAtomic
;
222 #if defined(__cplusplus) || defined(c_plusplus) /* for C++ V2.0 */
223 #define _FCFUNCPROTOBEGIN extern "C" { /* do not leave open across includes */
224 #define _FCFUNCPROTOEND }
226 #define _FCFUNCPROTOBEGIN
227 #define _FCFUNCPROTOEND
230 typedef struct _FcConfig FcConfig
;
232 typedef struct _FcFileCache FcFileCache
;
234 typedef struct _FcBlanks FcBlanks
;
236 typedef struct _FcStrList FcStrList
;
238 typedef struct _FcStrSet FcStrSet
;
244 FcBlanksCreate (void);
247 FcBlanksDestroy (FcBlanks
*b
);
250 FcBlanksAdd (FcBlanks
*b
, FcChar32 ucs4
);
253 FcBlanksIsMember (FcBlanks
*b
, FcChar32 ucs4
);
257 FcConfigFilename (const FcChar8
*url
);
260 FcConfigCreate (void);
263 FcConfigDestroy (FcConfig
*config
);
266 FcConfigSetCurrent (FcConfig
*config
);
269 FcConfigGetCurrent (void);
272 FcConfigUptoDate (FcConfig
*config
);
275 FcConfigBuildFonts (FcConfig
*config
);
278 FcConfigGetFontDirs (FcConfig
*config
);
281 FcConfigGetConfigDirs (FcConfig
*config
);
284 FcConfigGetConfigFiles (FcConfig
*config
);
287 FcConfigGetCache (FcConfig
*config
);
290 FcConfigGetBlanks (FcConfig
*config
);
293 FcConfigGetRescanInverval (FcConfig
*config
);
296 FcConfigSetRescanInverval (FcConfig
*config
, int rescanInterval
);
299 FcConfigGetFonts (FcConfig
*config
,
303 FcConfigAppFontAddFile (FcConfig
*config
,
304 const FcChar8
*file
);
307 FcConfigAppFontAddDir (FcConfig
*config
,
311 FcConfigAppFontClear (FcConfig
*config
);
314 FcConfigSubstitute (FcConfig
*config
,
320 FcCharSetCreate (void);
323 FcCharSetDestroy (FcCharSet
*fcs
);
326 FcCharSetAddChar (FcCharSet
*fcs
, FcChar32 ucs4
);
329 FcCharSetCopy (FcCharSet
*src
);
332 FcCharSetEqual (const FcCharSet
*a
, const FcCharSet
*b
);
335 FcCharSetIntersect (const FcCharSet
*a
, const FcCharSet
*b
);
338 FcCharSetUnion (const FcCharSet
*a
, const FcCharSet
*b
);
341 FcCharSetSubtract (const FcCharSet
*a
, const FcCharSet
*b
);
344 FcCharSetHasChar (const FcCharSet
*fcs
, FcChar32 ucs4
);
347 FcCharSetCount (const FcCharSet
*a
);
350 FcCharSetIntersectCount (const FcCharSet
*a
, const FcCharSet
*b
);
353 FcCharSetSubtractCount (const FcCharSet
*a
, const FcCharSet
*b
);
356 FcCharSetIsSubset (const FcCharSet
*a
, const FcCharSet
*b
);
358 #define FC_CHARSET_MAP_SIZE (256/32)
359 #define FC_CHARSET_DONE ((FcChar32) -1)
362 FcCharSetFirstPage (const FcCharSet
*a
,
363 FcChar32 map
[FC_CHARSET_MAP_SIZE
],
367 FcCharSetNextPage (const FcCharSet
*a
,
368 FcChar32 map
[FC_CHARSET_MAP_SIZE
],
374 FcValuePrint (FcValue v
);
377 FcPatternPrint (FcPattern
*p
);
380 FcFontSetPrint (FcFontSet
*s
);
384 FcDefaultSubstitute (FcPattern
*pattern
);
388 FcFileScan (FcFontSet
*set
,
396 FcDirScan (FcFontSet
*set
,
404 FcDirSave (FcFontSet
*set
, FcStrSet
*dirs
, const FcChar8
*dir
);
407 FcDirCacheValid (const FcChar8
*dir
);
411 FcFreeTypeQuery (const FcChar8
*file
, int id
, FcBlanks
*blanks
, int *count
);
416 FcFontSetCreate (void);
419 FcFontSetDestroy (FcFontSet
*s
);
422 FcFontSetAdd (FcFontSet
*s
, FcPattern
*font
);
426 FcInitLoadConfig (void);
429 FcInitLoadConfigAndFonts (void);
438 FcInitReinitialize (void);
441 FcInitBringUptoDate (void);
445 FcObjectSetCreate (void);
448 FcObjectSetAdd (FcObjectSet
*os
, const char *object
);
451 FcObjectSetDestroy (FcObjectSet
*os
);
454 FcObjectSetVaBuild (const char *first
, va_list va
);
457 FcObjectSetBuild (const char *first
, ...);
460 FcFontSetList (FcConfig
*config
,
467 FcFontList (FcConfig
*config
,
474 FcAtomicCreate (const FcChar8
*file
);
477 FcAtomicLock (FcAtomic
*atomic
);
480 FcAtomicNewFile (FcAtomic
*atomic
);
483 FcAtomicOrigFile (FcAtomic
*atomic
);
486 FcAtomicReplaceOrig (FcAtomic
*atomic
);
489 FcAtomicDeleteNew (FcAtomic
*atomic
);
492 FcAtomicUnlock (FcAtomic
*atomic
);
495 FcAtomicDestroy (FcAtomic
*atomic
);
499 FcFontSetMatch (FcConfig
*config
,
506 FcFontMatch (FcConfig
*config
,
511 FcFontRenderPrepare (FcConfig
*config
,
516 FcFontSetSort (FcConfig
*config
,
525 FcFontSort (FcConfig
*config
,
532 FcFontSetSortDestroy (FcFontSet
*fs
);
536 FcMatrixCopy (const FcMatrix
*mat
);
539 FcMatrixEqual (const FcMatrix
*mat1
, const FcMatrix
*mat2
);
542 FcMatrixMultiply (FcMatrix
*result
, const FcMatrix
*a
, const FcMatrix
*b
);
545 FcMatrixRotate (FcMatrix
*m
, double c
, double s
);
548 FcMatrixScale (FcMatrix
*m
, double sx
, double sy
);
551 FcMatrixShear (FcMatrix
*m
, double sh
, double sv
);
556 FcNameRegisterObjectTypes (const FcObjectType
*types
, int ntype
);
559 FcNameUnregisterObjectTypes (const FcObjectType
*types
, int ntype
);
562 FcNameGetObjectType (const char *object
);
565 FcNameRegisterConstants (const FcConstant
*consts
, int nconsts
);
568 FcNameUnregisterConstants (const FcConstant
*consts
, int nconsts
);
571 FcNameGetConstant (FcChar8
*string
);
574 FcNameConstant (FcChar8
*string
, int *result
);
577 FcNameParse (const FcChar8
*name
);
580 FcNameUnparse (FcPattern
*pat
);
584 FcPatternCreate (void);
587 FcPatternDuplicate (FcPattern
*p
);
590 FcPatternReference (FcPattern
*p
);
593 FcValueDestroy (FcValue v
);
596 FcValueEqual (FcValue va
, FcValue vb
);
599 FcValueSave (FcValue v
);
602 FcPatternDestroy (FcPattern
*p
);
605 FcPatternEqual (const FcPattern
*pa
, const FcPattern
*pb
);
608 FcPatternEqualSubset (const FcPattern
*pa
, const FcPattern
*pb
, const FcObjectSet
*os
);
611 FcPatternHash (const FcPattern
*p
);
614 FcPatternAdd (FcPattern
*p
, const char *object
, FcValue value
, FcBool append
);
617 FcPatternGet (FcPattern
*p
, const char *object
, int id
, FcValue
*v
);
620 FcPatternDel (FcPattern
*p
, const char *object
);
623 FcPatternAddInteger (FcPattern
*p
, const char *object
, int i
);
626 FcPatternAddDouble (FcPattern
*p
, const char *object
, double d
);
629 FcPatternAddString (FcPattern
*p
, const char *object
, const FcChar8
*s
);
632 FcPatternAddMatrix (FcPattern
*p
, const char *object
, const FcMatrix
*s
);
635 FcPatternAddCharSet (FcPattern
*p
, const char *object
, const FcCharSet
*c
);
638 FcPatternAddBool (FcPattern
*p
, const char *object
, FcBool b
);
641 FcPatternGetInteger (FcPattern
*p
, const char *object
, int n
, int *i
);
644 FcPatternGetDouble (FcPattern
*p
, const char *object
, int n
, double *d
);
647 FcPatternGetString (FcPattern
*p
, const char *object
, int n
, FcChar8
** s
);
650 FcPatternGetMatrix (FcPattern
*p
, const char *object
, int n
, FcMatrix
**s
);
653 FcPatternGetCharSet (FcPattern
*p
, const char *object
, int n
, FcCharSet
**c
);
656 FcPatternGetBool (FcPattern
*p
, const char *object
, int n
, FcBool
*b
);
659 FcPatternVaBuild (FcPattern
*orig
, va_list va
);
662 FcPatternBuild (FcPattern
*orig
, ...);
667 FcStrCopy (const FcChar8
*s
);
670 FcStrCopyFilename (const FcChar8
*s
);
672 #define FcToLower(c) (('A' <= (c) && (c) <= 'Z') ? (c) - 'A' + 'a' : (c))
675 FcStrCmpIgnoreCase (const FcChar8
*s1
, const FcChar8
*s2
);
678 FcStrCmp (const FcChar8
*s1
, const FcChar8
*s2
);
681 FcUtf8ToUcs4 (FcChar8
*src_orig
,
686 FcUtf8Len (FcChar8
*string
,
692 FcStrDirname (const FcChar8
*file
);
695 FcStrBasename (const FcChar8
*file
);
698 FcStrSetCreate (void);
701 FcStrSetMember (FcStrSet
*set
, const FcChar8
*s
);
704 FcStrSetAdd (FcStrSet
*set
, const FcChar8
*s
);
707 FcStrSetAddFilename (FcStrSet
*set
, const FcChar8
*s
);
710 FcStrSetDel (FcStrSet
*set
, const FcChar8
*s
);
713 FcStrSetDestroy (FcStrSet
*set
);
716 FcStrListCreate (FcStrSet
*set
);
719 FcStrListNext (FcStrList
*list
);
722 FcStrListDone (FcStrList
*list
);
726 FcConfigParseAndLoad (FcConfig
*config
, const FcChar8
*file
, FcBool complain
);
730 #endif /* _FONTCONFIG_H_ */