Imported Upstream version 2.12.1
[platform/upstream/fontconfig.git] / fontconfig / fontconfig.h
index 266986c..5c72b22 100644 (file)
@@ -51,8 +51,8 @@ typedef int           FcBool;
  */
 
 #define FC_MAJOR       2
-#define FC_MINOR       10
-#define FC_REVISION    2
+#define FC_MINOR       12
+#define FC_REVISION    1
 
 #define FC_VERSION     ((FC_MAJOR * 10000) + (FC_MINOR * 100) + (FC_REVISION))
 
@@ -66,7 +66,10 @@ typedef int          FcBool;
  * it means multiple copies of the font information.
  */
 
-#define FC_CACHE_VERSION    "3"
+#define FC_CACHE_VERSION_NUMBER        7
+#define _FC_STRINGIFY_(s)      #s
+#define _FC_STRINGIFY(s)       _FC_STRINGIFY_(s)
+#define FC_CACHE_VERSION       _FC_STRINGIFY(FC_CACHE_VERSION_NUMBER)
 
 #define FcTrue         1
 #define FcFalse                0
@@ -75,7 +78,7 @@ typedef int           FcBool;
 #define FC_STYLE           "style"             /* String */
 #define FC_SLANT           "slant"             /* Int */
 #define FC_WEIGHT          "weight"            /* Int */
-#define FC_SIZE                    "size"              /* Double */
+#define FC_SIZE                    "size"              /* Range (double) */
 #define FC_ASPECT          "aspect"            /* Double */
 #define FC_PIXEL_SIZE      "pixelsize"         /* Double */
 #define FC_SPACING         "spacing"           /* Int */
@@ -91,10 +94,12 @@ typedef int         FcBool;
 #define FC_FILE                    "file"              /* String */
 #define FC_INDEX           "index"             /* Int */
 #define FC_FT_FACE         "ftface"            /* FT_Face */
-#define FC_RASTERIZER      "rasterizer"        /* String */
+#define FC_RASTERIZER      "rasterizer"        /* String (deprecated) */
 #define FC_OUTLINE         "outline"           /* Bool */
 #define FC_SCALABLE        "scalable"          /* Bool */
-#define FC_SCALE           "scale"             /* double */
+#define FC_COLOR           "color"             /* Bool */
+#define FC_SCALE           "scale"             /* double (deprecated) */
+#define FC_SYMBOL          "symbol"            /* Bool */
 #define FC_DPI             "dpi"               /* double */
 #define FC_RGBA                    "rgba"              /* Int */
 #define FC_MINSPACE        "minspace"          /* Bool use minimum line spacing */
@@ -112,7 +117,11 @@ typedef int                FcBool;
 #define FC_EMBEDDED_BITMAP  "embeddedbitmap"   /* Bool - true to enable embedded bitmaps */
 #define FC_DECORATIVE      "decorative"        /* Bool - true if style is a decorative variant */
 #define FC_LCD_FILTER      "lcdfilter"         /* Int */
+#define FC_FONT_FEATURES    "fontfeatures"     /* String */
 #define FC_NAMELANG        "namelang"          /* String RFC 3866 langs */
+#define FC_PRGNAME         "prgname"           /* String */
+#define FC_HASH                    "hash"              /* String (deprecated) */
+#define FC_POSTSCRIPT_NAME  "postscriptname"   /* String */
 
 #define FC_CACHE_SUFFIX                    ".cache-" FC_CACHE_VERSION
 #define FC_DIR_CACHE_FILE          "fonts.cache-" FC_CACHE_VERSION
@@ -127,6 +136,8 @@ typedef int         FcBool;
 #define FC_WEIGHT_EXTRALIGHT       40
 #define FC_WEIGHT_ULTRALIGHT       FC_WEIGHT_EXTRALIGHT
 #define FC_WEIGHT_LIGHT                    50
+#define FC_WEIGHT_DEMILIGHT        55
+#define FC_WEIGHT_SEMILIGHT        FC_WEIGHT_DEMILIGHT
 #define FC_WEIGHT_BOOK             75
 #define FC_WEIGHT_REGULAR          80
 #define FC_WEIGHT_NORMAL           FC_WEIGHT_REGULAR
@@ -181,15 +192,17 @@ typedef int               FcBool;
 #define FC_LCD_LEGACY      3
 
 typedef enum _FcType {
-    FcTypeVoid, 
-    FcTypeInteger, 
-    FcTypeDouble, 
-    FcTypeString, 
+    FcTypeUnknown = -1,
+    FcTypeVoid,
+    FcTypeInteger,
+    FcTypeDouble,
+    FcTypeString,
     FcTypeBool,
     FcTypeMatrix,
     FcTypeCharSet,
     FcTypeFTFace,
-    FcTypeLangSet
+    FcTypeLangSet,
+    FcTypeRange
 } FcType;
 
 typedef struct _FcMatrix {
@@ -207,7 +220,7 @@ typedef struct _FcMatrix {
 typedef struct _FcCharSet FcCharSet;
 
 typedef struct _FcObjectType {
-    const char *object;
+    char       *object;
     FcType     type;
 } FcObjectType;
 
@@ -226,6 +239,8 @@ typedef struct _FcPattern   FcPattern;
 
 typedef struct _FcLangSet   FcLangSet;
 
+typedef struct _FcRange            FcRange;
+
 typedef struct _FcValue {
     FcType     type;
     union {
@@ -237,6 +252,7 @@ typedef struct _FcValue {
        const FcCharSet *c;
        void            *f;
        const FcLangSet *l;
+       const FcRange   *r;
     } u;
 } FcValue;
 
@@ -417,6 +433,13 @@ FcConfigSubstitute (FcConfig       *config,
                    FcPattern   *p,
                    FcMatchKind kind);
 
+FcPublic const FcChar8 *
+FcConfigGetSysRoot (const FcConfig *config);
+
+FcPublic void
+FcConfigSetSysRoot (FcConfig      *config,
+                   const FcChar8 *sysroot);
+
 /* fccharset.c */
 FcPublic FcCharSet*
 FcCharSetCreate (void);
@@ -424,7 +447,7 @@ FcCharSetCreate (void);
 /* deprecated alias for FcCharSetCreate */
 FcPublic FcCharSet *
 FcCharSetNew (void);
-    
+
 FcPublic void
 FcCharSetDestroy (FcCharSet *fcs);
 
@@ -529,6 +552,9 @@ FcDirSave (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir);
 
 FcPublic FcCache *
 FcDirCacheLoad (const FcChar8 *dir, FcConfig *config, FcChar8 **cache_file);
+
+FcPublic FcCache *
+FcDirCacheRescan (const FcChar8 *dir, FcConfig *config);
     
 FcPublic FcCache *
 FcDirCacheRead (const FcChar8 *dir, FcBool force, FcConfig *config);
@@ -580,6 +606,9 @@ FcInitBringUptoDate (void);
 FcPublic FcStrSet *
 FcGetLangs (void);
 
+FcPublic FcChar8 *
+FcLangNormalize (const FcChar8 *lang);
+
 FcPublic const FcCharSet *
 FcLangGetCharSet (const FcChar8 *lang);
 
@@ -734,21 +763,25 @@ FcMatrixShear (FcMatrix *m, double sh, double sv);
 
 /* fcname.c */
 
+/* Deprecated.  Does nothing.  Returns FcFalse. */
 FcPublic FcBool
 FcNameRegisterObjectTypes (const FcObjectType *types, int ntype);
 
+/* Deprecated.  Does nothing.  Returns FcFalse. */
 FcPublic FcBool
 FcNameUnregisterObjectTypes (const FcObjectType *types, int ntype);
-    
+
 FcPublic const FcObjectType *
 FcNameGetObjectType (const char *object);
 
+/* Deprecated.  Does nothing.  Returns FcFalse. */
 FcPublic FcBool
 FcNameRegisterConstants (const FcConstant *consts, int nconsts);
 
+/* Deprecated.  Does nothing.  Returns FcFalse. */
 FcPublic FcBool
 FcNameUnregisterConstants (const FcConstant *consts, int nconsts);
-    
+
 FcPublic const FcConstant *
 FcNameGetConstant (const FcChar8 *string);
 
@@ -831,6 +864,9 @@ FcPatternAddBool (FcPattern *p, const char *object, FcBool b);
 FcPublic FcBool
 FcPatternAddLangSet (FcPattern *p, const char *object, const FcLangSet *ls);
 
+FcPublic FcBool
+FcPatternAddRange (FcPattern *p, const char *object, const FcRange *r);
+
 FcPublic FcResult
 FcPatternGetInteger (const FcPattern *p, const char *object, int n, int *i);
 
@@ -852,6 +888,9 @@ FcPatternGetBool (const FcPattern *p, const char *object, int n, FcBool *b);
 FcPublic FcResult
 FcPatternGetLangSet (const FcPattern *p, const char *object, int n, FcLangSet **ls);
 
+FcPublic FcResult
+FcPatternGetRange (const FcPattern *p, const char *object, int id, FcRange **r);
+
 FcPublic FcPattern *
 FcPatternVaBuild (FcPattern *p, va_list va);
     
@@ -861,6 +900,30 @@ FcPatternBuild (FcPattern *p, ...) FC_ATTRIBUTE_SENTINEL(0);
 FcPublic FcChar8 *
 FcPatternFormat (FcPattern *pat, const FcChar8 *format);
 
+/* fcrange.c */
+FcPublic FcRange *
+FcRangeCreateDouble (double begin, double end);
+
+FcPublic FcRange *
+FcRangeCreateInteger (FcChar32 begin, FcChar32 end);
+
+FcPublic void
+FcRangeDestroy (FcRange *range);
+
+FcPublic FcRange *
+FcRangeCopy (const FcRange *r);
+
+FcPublic FcBool
+FcRangeGetDouble(const FcRange *range, double *begin, double *end);
+
+/* fcweight.c */
+
+FcPublic int
+FcWeightFromOpenType (int ot_weight);
+
+FcPublic int
+FcWeightToOpenType (int fc_weight);
+
 /* fcstr.c */
 
 FcPublic FcChar8 *
@@ -955,6 +1018,9 @@ FcStrSetDestroy (FcStrSet *set);
 FcPublic FcStrList *
 FcStrListCreate (FcStrSet *set);
 
+FcPublic void
+FcStrListFirst (FcStrList *list);
+
 FcPublic FcChar8 *
 FcStrListNext (FcStrList *list);