]> git.wh0rd.org - fontconfig.git/blobdiff - src/fcint.h
Reviewed by: Keith Packard <keithp@keithp.com>
[fontconfig.git] / src / fcint.h
index ba5d9a4053bb93b9a5f8916f5d64c30316a49fa6..106a38b3b0ea2223922c9490bd22e3fa03477d92 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * $RCSId: xc/lib/fontconfig/src/fcint.h,v 1.27 2002/08/31 22:17:32 keithp Exp $
  *
- * Copyright © 2000 Keith Packard
+ * Copyright Â© 2000 Keith Packard
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -53,6 +53,12 @@ typedef struct _FcSymbolic {
 #define FC_FONT_FILE_INVALID   ((FcChar8 *) ".")
 #define FC_FONT_FILE_DIR       ((FcChar8 *) ".dir")
 
+#ifdef _WIN32
+#define FC_SEARCH_PATH_SEPARATOR ';'
+#else
+#define FC_SEARCH_PATH_SEPARATOR ':'
+#endif
+
 #define FC_DBG_MATCH   1
 #define FC_DBG_MATCHV  2
 #define FC_DBG_EDIT    4
@@ -63,6 +69,7 @@ typedef struct _FcSymbolic {
 #define FC_DBG_SCAN    128
 #define FC_DBG_SCANV   256
 #define FC_DBG_MEMORY  512
+#define FC_DBG_CONFIG  1024
 
 #define FC_MEM_CHARSET     0
 #define FC_MEM_CHARLEAF            1
@@ -93,8 +100,9 @@ typedef struct _FcSymbolic {
 #define FC_MEM_VSTACK      26
 #define FC_MEM_ATTR        27
 #define FC_MEM_PSTACK      28
+#define FC_MEM_STATICSTR    29
 
-#define FC_MEM_NUM         29
+#define FC_MEM_NUM         30
 
 typedef enum _FcValueBinding {
     FcValueBindingWeak, FcValueBindingStrong, FcValueBindingSame
@@ -126,10 +134,12 @@ typedef enum _FcOp {
     FcOpAssign, FcOpAssignReplace, 
     FcOpPrependFirst, FcOpPrepend, FcOpAppend, FcOpAppendLast,
     FcOpQuest,
-    FcOpOr, FcOpAnd, FcOpEqual, FcOpNotEqual, FcOpContains, FcOpNotContains,
+    FcOpOr, FcOpAnd, FcOpEqual, FcOpNotEqual, 
+    FcOpContains, FcOpListing, FcOpNotContains,
     FcOpLess, FcOpLessEqual, FcOpMore, FcOpMoreEqual,
     FcOpPlus, FcOpMinus, FcOpTimes, FcOpDivide,
-    FcOpNot, FcOpComma, FcOpInvalid
+    FcOpNot, FcOpComma, FcOpFloor, FcOpCeil, FcOpRound, FcOpTrunc,
+    FcOpInvalid
 } FcOp;
 
 typedef struct _FcExpr {
@@ -211,6 +221,18 @@ typedef struct _FcStrBuf {
     int            size;
 } FcStrBuf;
 
+/*
+ * To map adobe glyph names to unicode values, a precomputed hash
+ * table is used
+ */
+
+typedef struct _FcGlyphName {
+    FcChar32   ucs;            /* unicode value */
+    FcChar8    name[1];        /* name extends beyond struct */
+} FcGlyphName;
+
+#define FC_MAX_FILE_LEN            4096
+
 /*
  * The per-user ~/.fonts.cache-<version> file is loaded into
  * this data structure.  Each directory gets a substructure
@@ -306,6 +328,13 @@ struct _FcConfig {
     FcSubst    *substPattern;      /* substitutions for patterns */
     FcSubst    *substFont;         /* substitutions for fonts */
     int                maxObjects;         /* maximum number of tests in all substs */
+    /*
+     * List of patterns used to control font file selection
+     */
+    FcStrSet   *acceptGlobs;
+    FcStrSet   *rejectGlobs;
+    FcFontSet  *acceptPatterns;
+    FcFontSet  *rejectPatterns;
     /*
      * The set of fonts loaded from the listed directories; the
      * order within the set does not determine the font selection,
@@ -338,7 +367,7 @@ void
 FcGlobalCacheDestroy (FcGlobalCache *cache);
 
 FcBool
-FcGlobalCacheCheckTime (FcGlobalCacheInfo *info);
+FcGlobalCacheCheckTime (const FcChar8*file, FcGlobalCacheInfo *info);
 
 void
 FcGlobalCacheReferenced (FcGlobalCache     *cache,
@@ -358,7 +387,8 @@ FcBool
 FcGlobalCacheScanDir (FcFontSet                *set,
                      FcStrSet          *dirs,
                      FcGlobalCache     *cache,
-                     const FcChar8     *dir);
+                     const FcChar8     *dir,
+                     FcConfig          *config);
 
 FcGlobalCacheFile *
 FcGlobalCacheFileGet (FcGlobalCache *cache,
@@ -382,7 +412,10 @@ FcGlobalCacheSave (FcGlobalCache    *cache,
                   const FcChar8    *cache_file);
 
 FcBool
-FcDirCacheReadDir (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir);
+FcDirCacheReadDir (FcFontSet       *set, 
+                  FcStrSet         *dirs,
+                  const FcChar8    *dir,
+                  FcConfig         *config);
 
 FcBool
 FcDirCacheWriteDir (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir);
@@ -429,10 +462,31 @@ FcConfigCompareValue (const FcValue m,
                      FcOp          op,
                      const FcValue v);
 
+FcBool
+FcConfigGlobAdd (FcConfig      *config,
+                const FcChar8  *glob,
+                FcBool         accept);
+
+FcBool
+FcConfigAcceptFilename (FcConfig       *config,
+                       const FcChar8   *filename);
+
+FcBool
+FcConfigPatternsAdd (FcConfig  *config,
+                    FcPattern  *pattern,
+                    FcBool     accept);
+
+FcBool
+FcConfigAcceptFont (FcConfig       *config,
+                   const FcPattern *font);
+
 /* fccharset.c */
 FcCharSet *
 FcCharSetFreeze (FcCharSet *cs);
 
+void
+FcCharSetThawAll (void);
+
 FcBool
 FcNameUnparseCharSet (FcStrBuf *buf, const FcCharSet *c);
 
@@ -469,6 +523,27 @@ FcDebug (void);
 
 /* fcdir.c */
 
+FcBool
+FcFileIsDir (const FcChar8 *file);
+
+FcBool
+FcFileScanConfig (FcFontSet    *set,
+                 FcStrSet      *dirs,
+                 FcFileCache   *cache,
+                 FcBlanks      *blanks,
+                 const FcChar8 *file,
+                 FcBool        force,
+                 FcConfig      *config);
+
+FcBool
+FcDirScanConfig (FcFontSet     *set,
+                FcStrSet       *dirs,
+                FcFileCache    *cache,
+                FcBlanks       *blanks,
+                const FcChar8  *dir,
+                FcBool         force,
+                FcConfig       *config);
+
 /* fcfont.c */
 int
 FcFontDebug (void);
@@ -582,6 +657,10 @@ FcNameUnparseLangSet (FcStrBuf *buf, const FcLangSet *ls);
 
 /* fclist.c */
 
+FcBool
+FcListPatternMatchAny (const FcPattern *p,
+                      const FcPattern *font);
+
 /* fcmatch.c */
 
 /* fcname.c */
@@ -609,6 +688,15 @@ FcPatternAddWithBinding  (FcPattern            *p,
 FcPattern *
 FcPatternFreeze (FcPattern *p);
 
+void
+FcPatternThawAll (void);
+
+FcBool
+FcPatternAppend (FcPattern *p, FcPattern *s);
+
+const char *
+FcObjectStaticName (const char *name);
+
 /* fcrender.c */
 
 /* fcmatrix.c */
@@ -646,7 +734,16 @@ FcStrBufData (FcStrBuf *buf, const FcChar8 *s, int len);
 int
 FcStrCmpIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
 
+const FcChar8 *
+FcStrContainsIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
+
+const FcChar8 *
+FcStrContainsIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
+
 FcBool
 FcStrUsesHome (const FcChar8 *s);
 
+FcChar8 *
+FcStrLastSlash (const FcChar8  *path);
+
 #endif /* _FC_INT_H_ */