]> git.wh0rd.org - fontconfig.git/blobdiff - fontconfig/fontconfig.h
Fix weird first/not-first lameness in font matches, replacing with target
[fontconfig.git] / fontconfig / fontconfig.h
index 1085ed657a88e5b695cd93e4f75866ed97c2ad72..b5fc1f67100f371445938c113ddd0060ae3d7224 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $XFree86: xc/lib/fontconfig/fontconfig/fontconfig.h,v 1.5 2002/03/01 01:00:54 keithp Exp $
+ * $XFree86: xc/lib/fontconfig/fontconfig/fontconfig.h,v 1.23 2002/07/28 10:50:58 keithp Exp $
  *
  * Copyright © 2001 Keith Packard, member of The XFree86 Project, Inc.
  *
@@ -37,7 +37,7 @@ typedef int           FcBool;
  */
 #define FC_MAJOR       1
 #define FC_MINOR       0
-#define FC_REVISION    0
+#define FC_REVISION    1
 
 #define FC_VERSION     ((FC_MAJOR * 10000) + (FC_MINOR * 100) + (FC_REVISION))
 
@@ -49,6 +49,7 @@ typedef int           FcBool;
 #define FC_SLANT           "slant"             /* Int */
 #define FC_WEIGHT          "weight"            /* Int */
 #define FC_SIZE                    "size"              /* Double */
+#define FC_ASPECT          "aspect"            /* Double */
 #define FC_PIXEL_SIZE      "pixelsize"         /* Double */
 #define FC_SPACING         "spacing"           /* Int */
 #define FC_FOUNDRY         "foundry"           /* String */
@@ -59,6 +60,7 @@ typedef int           FcBool;
 #define FC_GLOBAL_ADVANCE   "globaladvance"    /* Bool (true) */
 #define FC_FILE                    "file"              /* String */
 #define FC_INDEX           "index"             /* Int */
+#define FC_FT_FACE         "ftface"            /* FT_Face */
 #define FC_RASTERIZER      "rasterizer"        /* String */
 #define FC_OUTLINE         "outline"           /* Bool */
 #define FC_SCALABLE        "scalable"          /* Bool */
@@ -69,6 +71,7 @@ typedef int           FcBool;
 #define FC_SOURCE          "source"            /* String (X11, freetype) */
 #define FC_CHARSET         "charset"           /* CharSet */
 #define FC_LANG                    "lang"              /* String OS/2 CodePageRange */
+#define FC_PATTERN         "pattern"           /* FcPattern */
 
 #define FC_DIR_CACHE_FILE          "fonts.cache"
 #define FC_USER_CACHE_FILE         ".fonts.cache"
@@ -99,45 +102,6 @@ typedef int         FcBool;
 #define FC_RGBA_VRGB       3
 #define FC_RGBA_VBGR       4
 
-/* language groups from the OS/2 CodePageRange bits */
-#define FC_LANG_LATIN_1                        "latin1"                /* 0 */
-#define FC_LANG_LATIN_2_EASTERN_EUROPE "latin2easterneurope"   /* 1 */
-#define FC_LANG_CYRILLIC               "cyrillic"              /* 2 */
-#define FC_LANG_GREEK                  "greek"                 /* 3 */
-#define FC_LANG_TURKISH                        "turkish"               /* 4 */
-#define FC_LANG_HEBREW                 "hebrew"                /* 5 */
-#define FC_LANG_ARABIC                 "arabic"                /* 6 */
-#define FC_LANG_WINDOWS_BALTIC         "windowsbaltic"         /* 7 */
-#define FC_LANG_VIETNAMESE             "vietnamese"            /* 8 */
-/* 9-15 reserved for Alternate ANSI */
-#define FC_LANG_THAI                   "thai"                  /* 16 */
-#define FC_LANG_JAPANESE               "japanese"              /* 17 */
-#define FC_LANG_SIMPLIFIED_CHINESE     "simplifiedchinese"     /* 18 */
-#define FC_LANG_KOREAN_WANSUNG         "koreanwansung"         /* 19 */
-#define FC_LANG_TRADITIONAL_CHINESE    "traditionalchinese"    /* 20 */
-#define FC_LANG_KOREAN_JOHAB           "koreanjohab"           /* 21 */
-/* 22-28 reserved for Alternate ANSI & OEM */
-#define FC_LANG_MACINTOSH              "macintosh"             /* 29 */
-#define FC_LANG_OEM                    "oem"                   /* 30 */
-#define FC_LANG_SYMBOL                 "symbol"                /* 31 */
-/* 32-47 reserved for OEM */
-#define FC_LANG_IBM_GREEK              "ibmgreek"              /* 48 */
-#define FC_LANG_MSDOS_RUSSIAN          "msdosrussian"          /* 49 */
-#define FC_LANG_MSDOS_NORDIC           "msdosnordic"           /* 50 */
-#define FC_LANG_ARABIC_864             "arabic864"             /* 51 */
-#define FC_LANG_MSDOS_CANADIAN_FRENCH  "msdoscanadianfrench"   /* 52 */
-#define FC_LANG_HEBREW_862             "hebrew862"             /* 53 */
-#define FC_LANG_MSDOS_ICELANDIC                "msdosicelandic"        /* 54 */
-#define FC_LANG_MSDOS_PORTUGUESE       "msdosportuguese"       /* 55 */
-#define FC_LANG_IBM_TURKISH            "ibmturkish"            /* 56 */
-#define FC_LANG_IBM_CYRILLIC           "ibmcyrillic"           /* 57 */
-#define FC_LANG_LATIN_2                        "latin2"                /* 58 */
-#define FC_LANG_MSDOS_BALTIC           "msdosbaltic"           /* 59 */
-#define FC_LANG_GREEK_437_G            "greek437g"             /* 60 */
-#define FC_LANG_ARABIC_ASMO_708                "arabicasmo708"         /* 61 */
-#define FC_LANG_WE_LATIN_1             "welatin1"              /* 62 */
-#define FC_LANG_US                     "us"                    /* 63 */
-
 typedef enum _FcType {
     FcTypeVoid, 
     FcTypeInteger, 
@@ -145,7 +109,9 @@ typedef enum _FcType {
     FcTypeString, 
     FcTypeBool,
     FcTypeMatrix,
-    FcTypeCharSet
+    FcTypeCharSet,
+    FcTypeFTFace,
+    FcTypePattern
 } FcType;
 
 typedef struct _FcMatrix {
@@ -177,6 +143,8 @@ typedef enum _FcResult {
     FcResultMatch, FcResultNoMatch, FcResultTypeMismatch, FcResultNoId
 } FcResult;
 
+typedef struct _FcPattern   FcPattern;
+
 typedef struct _FcValue {
     FcType     type;
     union {
@@ -186,11 +154,11 @@ typedef struct _FcValue {
        double          d;
        const FcMatrix  *m;
        const FcCharSet *c;
+       void            *f;
+       const FcPattern *p;
     } u;
 } FcValue;
 
-typedef struct _FcPattern   FcPattern;
-
 typedef struct _FcFontSet {
     int                nfont;
     int                sfont;
@@ -204,7 +172,7 @@ typedef struct _FcObjectSet {
 } FcObjectSet;
     
 typedef enum _FcMatchKind {
-    FcMatchPattern, FcMatchFont 
+    FcMatchPattern, FcMatchFont
 } FcMatchKind;
 
 typedef enum _FcSetName {
@@ -222,14 +190,23 @@ typedef struct _FcAtomic FcAtomic;
 #define _FCFUNCPROTOEND
 #endif
 
+typedef enum { FcEndianBig, FcEndianLittle } FcEndian;
+
 typedef struct _FcConfig    FcConfig;
 
-typedef struct _FcFileCache FcFileCache;
+typedef struct _FcGlobalCache  FcFileCache;
 
 typedef struct _FcBlanks    FcBlanks;
 
+typedef struct _FcStrList   FcStrList;
+
+typedef struct _FcStrSet    FcStrSet;
+
 _FCFUNCPROTOBEGIN
 
+FcBool
+FcDirCacheValid (const FcChar8 *cache_file);
+
 /* fcblanks.c */
 FcBlanks *
 FcBlanksCreate (void);
@@ -259,13 +236,19 @@ FcConfigSetCurrent (FcConfig *config);
 FcConfig *
 FcConfigGetCurrent (void);
 
+FcBool
+FcConfigUptoDate (FcConfig *config);
+    
 FcBool
 FcConfigBuildFonts (FcConfig *config);
 
-FcChar8 **
-FcConfigGetDirs (FcConfig   *config);
+FcStrList *
+FcConfigGetFontDirs (FcConfig   *config);
+
+FcStrList *
+FcConfigGetConfigDirs (FcConfig   *config);
 
-FcChar8 **
+FcStrList *
 FcConfigGetConfigFiles (FcConfig    *config);
 
 FcChar8 *
@@ -274,6 +257,12 @@ FcConfigGetCache (FcConfig  *config);
 FcBlanks *
 FcConfigGetBlanks (FcConfig *config);
 
+int
+FcConfigGetRescanInverval (FcConfig *config);
+
+FcBool
+FcConfigSetRescanInverval (FcConfig *config, int rescanInterval);
+
 FcFontSet *
 FcConfigGetFonts (FcConfig     *config,
                  FcSetName     set);
@@ -331,18 +320,32 @@ FcCharSetIntersectCount (const FcCharSet *a, const FcCharSet *b);
 FcChar32
 FcCharSetSubtractCount (const FcCharSet *a, const FcCharSet *b);
 
+FcBool
+FcCharSetIsSubset (const FcCharSet *a, const FcCharSet *b);
+
+#define FC_CHARSET_MAP_SIZE (256/32)
+#define FC_CHARSET_DONE        ((FcChar32) -1)
+
 FcChar32
-FcCharSetCoverage (const FcCharSet *a, FcChar32 page, FcChar32 *result);
+FcCharSetFirstPage (const FcCharSet *a, 
+                   FcChar32        map[FC_CHARSET_MAP_SIZE],
+                   FcChar32        *next);
+
+FcChar32
+FcCharSetNextPage (const FcCharSet  *a, 
+                  FcChar32         map[FC_CHARSET_MAP_SIZE],
+                  FcChar32         *next);
+
 
 /* fcdbg.c */
 void
-FcValuePrint (FcValue v);
+FcValuePrint (const FcValue v);
 
 void
-FcPatternPrint (FcPattern *p);
+FcPatternPrint (const FcPattern *p);
 
 void
-FcFontSetPrint (FcFontSet *s);
+FcFontSetPrint (const FcFontSet *s);
 
 /* fcdefault.c */
 void
@@ -351,6 +354,7 @@ FcDefaultSubstitute (FcPattern *pattern);
 /* fcdir.c */
 FcBool
 FcFileScan (FcFontSet      *set,
+           FcStrSet        *dirs,
            FcFileCache     *cache,
            FcBlanks        *blanks,
            const FcChar8   *file,
@@ -358,13 +362,14 @@ FcFileScan (FcFontSet         *set,
 
 FcBool
 FcDirScan (FcFontSet       *set,
+          FcStrSet         *dirs,
           FcFileCache      *cache,
           FcBlanks         *blanks,
           const FcChar8    *dir,
           FcBool           force);
 
 FcBool
-FcDirSave (FcFontSet *set, const FcChar8 *dir);
+FcDirSave (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir);
 
 /* fcfreetype.c */
 FcPattern *
@@ -382,14 +387,23 @@ FcBool
 FcFontSetAdd (FcFontSet *s, FcPattern *font);
 
 /* fcinit.c */
+FcConfig *
+FcInitLoadConfig (void);
+
+FcConfig *
+FcInitLoadConfigAndFonts (void);
+
 FcBool
-FcInitFonts (void);
+FcInit (void);
+
+int
+FcGetVersion (void);
 
 FcBool
-FcInitConfig (void);
+FcInitReinitialize (void);
 
 FcBool
-FcInit (void);
+FcInitBringUptoDate (void);
 
 /* fclist.c */
 FcObjectSet *
@@ -472,6 +486,16 @@ FcFontSetSort (FcConfig        *config,
               FcCharSet    **csp,
               FcResult     *result);
 
+FcFontSet *
+FcFontSort (FcConfig    *config,
+           FcPattern    *p,
+           FcBool       trim,
+           FcCharSet    **csp,
+           FcResult     *result);
+
+void
+FcFontSetSortDestroy (FcFontSet *fs);
+
 /* fcmatrix.c */
 FcMatrix *
 FcMatrixCopy (const FcMatrix *mat);
@@ -527,18 +551,36 @@ FcPatternCreate (void);
 FcPattern *
 FcPatternDuplicate (FcPattern *p);
 
+void
+FcPatternReference (FcPattern *p);
+
 void
 FcValueDestroy (FcValue v);
 
+FcBool
+FcValueEqual (FcValue va, FcValue vb);
+
 FcValue
 FcValueSave (FcValue v);
 
 void
 FcPatternDestroy (FcPattern *p);
 
+FcBool
+FcPatternEqual (const FcPattern *pa, const FcPattern *pb);
+
+FcBool
+FcPatternEqualSubset (const FcPattern *pa, const FcPattern *pb, const FcObjectSet *os);
+
+FcChar32
+FcPatternHash (const FcPattern *p);
+
 FcBool
 FcPatternAdd (FcPattern *p, const char *object, FcValue value, FcBool append);
     
+FcBool
+FcPatternAddWeak (FcPattern *p, const char *object, FcValue value, FcBool append);
+    
 FcResult
 FcPatternGet (FcPattern *p, const char *object, int id, FcValue *v);
     
@@ -563,6 +605,9 @@ FcPatternAddCharSet (FcPattern *p, const char *object, const FcCharSet *c);
 FcBool
 FcPatternAddBool (FcPattern *p, const char *object, FcBool b);
 
+FcBool
+FcPatternAddPattern (FcPattern *p, const char *object, const FcPattern *pp);
+
 FcResult
 FcPatternGetInteger (FcPattern *p, const char *object, int n, int *i);
 
@@ -581,6 +626,9 @@ FcPatternGetCharSet (FcPattern *p, const char *object, int n, FcCharSet **c);
 FcResult
 FcPatternGetBool (FcPattern *p, const char *object, int n, FcBool *b);
 
+FcResult
+FcPatternGetPattern (FcPattern *p, const char *object, int n, FcPattern **pp);
+
 FcPattern *
 FcPatternVaBuild (FcPattern *orig, va_list va);
     
@@ -592,11 +640,17 @@ FcPatternBuild (FcPattern *orig, ...);
 FcChar8 *
 FcStrCopy (const FcChar8 *s);
 
+FcChar8 *
+FcStrCopyFilename (const FcChar8 *s);
+    
 #define FcToLower(c)   (('A' <= (c) && (c) <= 'Z') ? (c) - 'A' + 'a' : (c))
 
 int
 FcStrCmpIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
 
+int
+FcStrCmp (const FcChar8 *s1, const FcChar8 *s2);
+
 int
 FcUtf8ToUcs4 (FcChar8   *src_orig,
              FcChar32  *dst,
@@ -608,6 +662,58 @@ FcUtf8Len (FcChar8 *string,
           int          *nchar,
           int          *wchar);
 
+#define FC_UTF8_MAX_LEN        6
+
+int
+FcUcs4ToUtf8 (FcChar32 ucs4,
+             FcChar8   dest[FC_UTF8_MAX_LEN]);
+
+int
+FcUtf16ToUcs4 (FcChar8 *src_orig,
+              FcEndian endian,
+              FcChar32 *dst,
+              int      len);       /* in bytes */
+
+FcBool
+FcUtf16Len (FcChar8    *string,
+           FcEndian    endian,
+           int         len,        /* in bytes */
+           int         *nchar,
+           int         *wchar);
+
+FcChar8 *
+FcStrDirname (const FcChar8 *file);
+
+FcChar8 *
+FcStrBasename (const FcChar8 *file);
+
+FcStrSet *
+FcStrSetCreate (void);
+
+FcBool
+FcStrSetMember (FcStrSet *set, const FcChar8 *s);
+
+FcBool
+FcStrSetAdd (FcStrSet *set, const FcChar8 *s);
+
+FcBool
+FcStrSetAddFilename (FcStrSet *set, const FcChar8 *s);
+
+FcBool
+FcStrSetDel (FcStrSet *set, const FcChar8 *s);
+
+void
+FcStrSetDestroy (FcStrSet *set);
+
+FcStrList *
+FcStrListCreate (FcStrSet *set);
+
+FcChar8 *
+FcStrListNext (FcStrList *list);
+
+void
+FcStrListDone (FcStrList *list);
+
 /* fcxml.c */
 FcBool
 FcConfigParseAndLoad (FcConfig *config, const FcChar8 *file, FcBool complain);