if (!atomic)
return 0;
FcMemAlloc (FC_MEM_ATOMIC, total_len);
-
+
atomic->file = (FcChar8 *) (atomic + 1);
strcpy ((char *) atomic->file, (char *) file);
{
FcMemFree (FC_MEM_ATOMIC, sizeof (FcAtomic) +
strlen ((char *) atomic->file) * 4 + 4 +
- sizeof (NEW_NAME) + sizeof (LCK_NAME) +
+ sizeof (NEW_NAME) + sizeof (LCK_NAME) +
sizeof (TMP_NAME));
free (atomic);
char full_path_name[MAX_PATH];
char *basename;
DWORD rc;
-
+
if (!GetFileAttributesEx (file, GetFileExInfoStandard, &wfad))
return -1;
-
+
statb->st_dev = 0;
/* Calculate a pseudo inode number as a hash of the full path name.
rc = GetLongPathName (full_path_name, full_path_name, sizeof (full_path_name));
statb->st_ino = FcStringHash (full_path_name);
-
+
statb->st_mode = _S_IREAD | _S_IWRITE;
statb->st_mode |= (statb->st_mode >> 3) | (statb->st_mode >> 6);
statb->st_mode |= _S_IFDIR;
else
statb->st_mode |= _S_IFREG;
-
+
statb->st_nlink = 1;
statb->st_uid = statb->st_gid = 0;
statb->st_rdev = 0;
-
+
if (wfad.nFileSizeHigh > 0)
return -1;
statb->st_size = wfad.nFileSizeLow;
-
+
statb->st_atime = (*(INT64 *)&wfad.ftLastAccessTime)/10000000 - EPOCH_OFFSET;
statb->st_mtime = (*(INT64 *)&wfad.ftLastWriteTime)/10000000 - EPOCH_OFFSET;
statb->st_ctime = statb->st_mtime;
-
+
return 0;
}
#endif
return fd;
}
-/*
+/*
* Look for a cache file for the specified dir. Attempt
* to use each one we find, stopping when the callback
* indicates success
*/
static FcBool
-FcDirCacheProcess (FcConfig *config, const FcChar8 *dir,
+FcDirCacheProcess (FcConfig *config, const FcChar8 *dir,
FcBool (*callback) (int fd, struct stat *fd_stat,
struct stat *dir_stat, void *closure),
void *closure, FcChar8 **cache_file_ret)
FcStrFree (cache_hashed);
}
FcStrListDone (list);
-
+
return ret;
}
update[fcCacheMaxLevel] = &fcCacheChains[fcCacheMaxLevel];
fcCacheMaxLevel = level;
}
-
+
s = malloc (sizeof (FcCacheSkip) + (level - 1) * sizeof (FcCacheSkip *));
if (!s)
return FcFalse;
s->cache_ino = 0;
s->cache_mtime = 0;
}
-
+
/*
* Insert into all fcCacheChains
*/
PAGE_READONLY, 0, 0, NULL);
if (hFileMap != NULL)
{
- cache = MapViewOfFile (hFileMap, FILE_MAP_READ, 0, 0,
+ cache = MapViewOfFile (hFileMap, FILE_MAP_READ, 0, 0,
fd_stat->st_size);
CloseHandle (hFileMap);
}
return NULL;
}
allocated = FcTrue;
- }
- if (cache->magic != FC_CACHE_MAGIC_MMAP ||
+ }
+ if (cache->magic != FC_CACHE_MAGIC_MMAP ||
cache->version < FC_CACHE_CONTENT_VERSION ||
cache->size != fd_stat->st_size ||
!FcCacheTimeValid (cache, dir_stat) ||
{
FcBool ret = FcTrue;
FcCache c;
-
+
if (read (fd, &c, sizeof (FcCache)) != sizeof (FcCache))
ret = FcFalse;
else if (c.magic != FC_CACHE_MAGIC_MMAP)
static FcBool
FcDirCacheValidConfig (const FcChar8 *dir, FcConfig *config)
{
- return FcDirCacheProcess (config, dir,
+ return FcDirCacheProcess (config, dir,
FcDirCacheValidateHelper,
NULL, NULL);
}
FcDirCacheValid (const FcChar8 *dir)
{
FcConfig *config;
-
+
config = FcConfigGetCurrent ();
if (!config)
return FcFalse;
FcChar8 *dir_serialize;
intptr_t *dirs_serialize;
FcFontSet *set_serialize;
-
+
if (!serialize)
return NULL;
/*
*/
if (!FcFontSetSerializeAlloc (serialize, set))
goto bail1;
-
+
/* Serialize layout complete. Now allocate space and fill it */
cache = malloc (serialize->size);
if (!cache)
if (!dir_serialize)
goto bail2;
cache->dir = FcPtrToOffset (cache, dir_serialize);
-
+
/*
* Serialize sub dirs
*/
goto bail2;
cache->dirs = FcPtrToOffset (cache, dirs_serialize);
cache->dirs_count = dirs->num;
- for (i = 0; i < dirs->num; i++)
+ for (i = 0; i < dirs->num; i++)
{
FcChar8 *d_serialize = FcStrSerialize (serialize, dirs->strs[i]);
if (!d_serialize)
goto bail2;
dirs_serialize[i] = FcPtrToOffset (dirs_serialize, d_serialize);
}
-
+
/*
* Serialize font set
*/
cache->set = FcPtrToOffset (cache, set_serialize);
FcSerializeDestroy (serialize);
-
+
FcCacheInsert (cache, NULL);
return cache;
{
FcChar8 *parent;
FcBool ret;
-
+
if (strlen ((char *) dir) == 0)
return FcFalse;
-
+
parent = FcStrDirname (dir);
if (!parent)
return FcFalse;
/*
* Write it to the first directory in the list which is writable
*/
-
+
list = FcStrListCreate (config->cacheDirs);
if (!list)
return FcFalse;
fd = open((char *)FcAtomicNewFile (atomic), O_RDWR | O_CREAT | O_BINARY, 0666);
if (fd == -1)
goto bail4;
-
+
/* Temporarily switch magic to MMAP while writing to file */
magic = cache->magic;
if (magic != FC_CACHE_MAGIC_MMAP)
cache->magic = FC_CACHE_MAGIC_MMAP;
-
+
/*
* Write cache contents to file
*/
written = write (fd, cache, cache->size);
-
+
/* Switch magic back */
if (magic != FC_CACHE_MAGIC_MMAP)
cache->magic = magic;
-
+
if (written != cache->size)
{
perror ("write cache");
FcFontSet *old = FcCacheSet (c);
FcFontSet *new = FcFontSetCreate ();
int i;
-
+
if (!new)
return NULL;
for (i = 0; i < old->nfont; i++)
}
/*
- * Final wrapup - pad to 64-byte boundary with the bit pattern
+ * Final wrapup - pad to 64-byte boundary with the bit pattern
* 1 0* (64-bit count of bits processed, MSB-first)
*/
static void MD5Final(unsigned char digest[16], struct MD5Context *ctx)
if (!config)
goto bail0;
FcMemAlloc (FC_MEM_CONFIG, sizeof (FcConfig));
-
+
config->configDirs = FcStrSetCreate ();
if (!config->configDirs)
goto bail1;
-
+
config->configFiles = FcStrSetCreate ();
if (!config->configFiles)
goto bail2;
-
+
config->fontDirs = FcStrSetCreate ();
if (!config->fontDirs)
goto bail3;
-
+
config->acceptGlobs = FcStrSetCreate ();
if (!config->acceptGlobs)
goto bail4;
config->acceptPatterns = FcFontSetCreate ();
if (!config->acceptPatterns)
goto bail6;
-
+
config->rejectPatterns = FcFontSetCreate ();
if (!config->rejectPatterns)
goto bail7;
config->cacheDirs = FcStrSetCreate ();
if (!config->cacheDirs)
goto bail8;
-
+
config->blanks = 0;
config->substPattern = 0;
config->fonts[set] = 0;
config->rescanTime = time(0);
- config->rescanInterval = 30;
+ config->rescanInterval = 30;
config->expr_pool = NULL;
config->ref = 1;
-
+
return config;
bail8:
FcSubstDestroy (FcSubst *s)
{
FcSubst *n;
-
+
while (s)
{
n = s->next;
*/
FcBool
-FcConfigAddCache (FcConfig *config, FcCache *cache,
+FcConfigAddCache (FcConfig *config, FcCache *cache,
FcSetName set, FcStrSet *dirSet)
{
FcFontSet *fs;
FcStrList *dirlist;
FcChar8 *dir;
FcCache *cache;
-
+
dirlist = FcStrListCreate (dirSet);
if (!dirlist)
return FcFalse;
fonts = FcFontSetCreate ();
if (!fonts)
return FcFalse;
-
+
FcConfigSetFonts (config, fonts, FcSetSystem);
-
+
if (!FcConfigAddDirList (config, FcSetSystem, config->fontDirs))
return FcFalse;
if (FcDebug () & FC_DBG_FONTSET)
FcConfigAddDir (FcConfig *config,
const FcChar8 *d)
{
- return (FcConfigAddConfigDir (config, d) &&
+ return (FcConfigAddConfigDir (config, d) &&
FcConfigAddFontDir (config, d));
}
}
return FcStrListCreate (config->cacheDirs);
}
-
+
FcBool
FcConfigAddConfigFile (FcConfig *config,
const FcChar8 *f)
{
FcBool ret;
FcChar8 *file = FcConfigFilename (f);
-
+
if (!file)
return FcFalse;
-
+
ret = FcStrSetAdd (config->configFiles, file);
FcStrFree (file);
return ret;
FcChar32 blank)
{
FcBlanks *b, *freeme = 0;
-
+
b = config->blanks;
if (!b)
{
return FcConfigSetRescanInterval (config, rescanInterval);
}
-
+
FcBool
FcConfigAddEdit (FcConfig *config,
FcTest *test,
FcValue left = FcValueCanonicalize(left_o);
FcValue right = FcValueCanonicalize(right_o);
FcBool ret = FcFalse;
-
+
left = FcConfigPromote (left, right);
right = FcConfigPromote (right, left);
- if (left.type == right.type)
+ if (left.type == right.type)
{
switch (left.type) {
case FcTypeInteger:
case FcOpNotContains:
ret = left.u.d != right.u.d;
break;
- case FcOpLess:
+ case FcOpLess:
ret = left.u.d < right.u.d;
break;
- case FcOpLessEqual:
+ case FcOpLessEqual:
ret = left.u.d <= right.u.d;
break;
- case FcOpMore:
+ case FcOpMore:
ret = left.u.d > right.u.d;
break;
- case FcOpMoreEqual:
+ case FcOpMoreEqual:
ret = left.u.d >= right.u.d;
break;
default:
break;
case FcTypeBool:
switch (op) {
- case FcOpEqual:
+ case FcOpEqual:
case FcOpContains:
case FcOpListing:
ret = left.u.b == right.u.b;
break;
case FcTypeString:
switch (op) {
- case FcOpEqual:
+ case FcOpEqual:
case FcOpListing:
ret = FcStrCmpIgnoreCase (left.u.s, right.u.s) == 0;
break;
FcResult r;
FcMatrix *m;
FcChar8 *str;
-
+
switch (e->op) {
case FcOpInteger:
v.type = FcTypeInteger;
switch (vl.type) {
case FcTypeDouble:
switch (e->op) {
- case FcOpPlus:
+ case FcOpPlus:
v.type = FcTypeDouble;
- v.u.d = vl.u.d + vr.u.d;
+ v.u.d = vl.u.d + vr.u.d;
break;
case FcOpMinus:
v.type = FcTypeDouble;
- v.u.d = vl.u.d - vr.u.d;
+ v.u.d = vl.u.d - vr.u.d;
break;
case FcOpTimes:
v.type = FcTypeDouble;
- v.u.d = vl.u.d * vr.u.d;
+ v.u.d = vl.u.d * vr.u.d;
break;
case FcOpDivide:
v.type = FcTypeDouble;
- v.u.d = vl.u.d / vr.u.d;
+ v.u.d = vl.u.d / vr.u.d;
break;
default:
- v.type = FcTypeVoid;
+ v.type = FcTypeVoid;
break;
}
if (v.type == FcTypeDouble &&
v.u.b = vl.u.b && vr.u.b;
break;
default:
- v.type = FcTypeVoid;
+ v.type = FcTypeVoid;
break;
}
break;
str = FcStrPlus (vl.u.s, vr.u.s);
v.u.s = FcStrStaticName (str);
FcStrFree (str);
-
+
if (!v.u.s)
v.type = FcTypeVoid;
break;
FcExpr *e = t->expr;
FcValue value;
FcValueList *v;
-
+
while (e)
{
/* Compute the value of the match expression */
FcConfigValues (FcPattern *p, FcExpr *e, FcValueBinding binding)
{
FcValueList *l;
-
+
if (!e)
return 0;
l = (FcValueList *) malloc (sizeof (FcValueList));
{
FcValueListPtr *prev, last, v;
FcValueBinding sameBinding;
-
+
if (position)
sameBinding = position->binding;
else
if (position)
prev = &position->next;
else
- for (prev = head; *prev != NULL;
+ for (prev = head; *prev != NULL;
prev = &(*prev)->next)
;
}
{
if (position)
{
- for (prev = head; *prev != NULL;
+ for (prev = head; *prev != NULL;
prev = &(*prev)->next)
{
if (*prev == position)
FcValueListPrint (*head);
printf ("\n");
}
-
+
if (new)
{
last = new;
while (last->next != NULL)
last = last->next;
-
+
last->next = *prev;
*prev = new;
}
-
+
if (FcDebug () & FC_DBG_EDIT)
{
printf ("%s list after ", append ? "Append" : "Prepend");
FcValueListPrint (*head);
printf ("\n");
}
-
+
return FcTrue;
}
if (list)
{
FcPatternElt *e = FcPatternObjectInsertElt (p, object);
-
+
if (!e)
return;
FcConfigAdd (&e->values, 0, append, list);
if ((t->kind == FcMatchFont || kind == FcMatchPattern) &&
t->object == e->object)
{
- /*
+ /*
* KLUDGE - the pattern may have been reallocated or
* things may have been inserted or deleted above
* this element by other edits. Go back and find
{
FcValueList *thisValue = st[i].value;
FcValueList *nextValue = thisValue;
-
+
/*
* Append the new list of values after the current value
*/
}
else
fontconfig_path[0] = '\0';
-
+
break;
}
FcMemAlloc (FC_MEM_STRING, strlen ((char *) path) + 1);
if (access ((char *) path, R_OK) == 0)
return path;
-
+
FcStrFree (path);
return 0;
}
if (env)
{
e = env;
- while (*e)
+ while (*e)
{
colon = (FcChar8 *) strchr ((char *) e, FC_SEARCH_PATH_SEPARATOR);
if (!colon)
i++;
}
}
-
+
#ifdef _WIN32
if (fontconfig_path[0] == '\0')
{
subdirs = FcStrSetCreate ();
if (!subdirs)
return FcFalse;
-
+
set = FcConfigGetFonts (config, FcSetApplication);
if (!set)
{
{
FcFontSet *set;
FcStrSet *dirs;
-
+
if (!config)
{
config = FcConfigGetCurrent ();
dirs = FcStrSetCreate ();
if (!dirs)
return FcFalse;
-
+
set = FcConfigGetFonts (config, FcSetApplication);
if (!set)
{
}
FcConfigSetFonts (config, set, FcSetApplication);
}
-
+
FcStrSetAddFilename (dirs, dir);
-
+
if (!FcConfigAddDirList (config, FcSetApplication, dirs))
{
FcStrSetDestroy (dirs);
{
FcChar8 c;
- while ((c = *glob++))
+ while ((c = *glob++))
{
switch (c) {
case '*':
const FcPattern *font)
{
int i;
-
+
for (i = 0; i < patterns->nfont; i++)
if (FcListPatternMatchAny (patterns->fonts[i], font))
return FcTrue;
FcCharSetDestroy (FcCharSet *fcs)
{
int i;
-
+
if (fcs->ref == FC_REF_CONSTANT)
{
FcCacheObjectDereference (fcs);
#define FC_IS_ZERO_OR_POWER_OF_TWO(x) (!((x) & ((x)-1)))
static FcBool
-FcCharSetPutLeaf (FcCharSet *fcs,
+FcCharSetPutLeaf (FcCharSet *fcs,
FcChar32 ucs4,
- FcCharLeaf *leaf,
+ FcCharLeaf *leaf,
int pos)
{
intptr_t *leaves = FcCharSetLeaves (fcs);
fcs->leaves_offset = FcPtrToOffset (fcs, leaves);
fcs->numbers_offset = FcPtrToOffset (fcs, numbers);
}
-
- memmove (leaves + pos + 1, leaves + pos,
+
+ memmove (leaves + pos + 1, leaves + pos,
(fcs->num - pos) * sizeof (*leaves));
memmove (numbers + pos + 1, numbers + pos,
(fcs->num - pos) * sizeof (*numbers));
pos = FcCharSetFindLeafPos (fcs, ucs4);
if (pos >= 0)
return FcCharSetLeaf(fcs, pos);
-
+
leaf = calloc (1, sizeof (FcCharLeaf));
if (!leaf)
return 0;
-
+
pos = -pos - 1;
if (!FcCharSetPutLeaf (fcs, ucs4, leaf, pos))
{
{
FcCharLeaf *leaf;
FcChar32 *b;
-
+
if (fcs->ref == FC_REF_CONSTANT)
return FcFalse;
leaf = FcCharSetFindLeafCreate (fcs, ucs4);
{
FcCharSetIter ai, bi;
int i;
-
+
if (a == b)
return FcTrue;
for (FcCharSetIterStart (a, &ai), FcCharSetIterStart (b, &bi);
{
FcCharSetIter ai, bi;
FcChar32 count = 0;
-
+
FcCharSetIterStart (a, &ai);
FcCharSetIterStart (b, &bi);
while (ai.leaf && bi.leaf)
while (i--)
count += FcCharSetPopCount (*am++ & *bm++);
FcCharSetIterNext (a, &ai);
- }
+ }
else if (ai.ucs4 < bi.ucs4)
{
ai.ucs4 = bi.ucs4;
{
FcCharSetIter ai;
FcChar32 count = 0;
-
+
for (FcCharSetIterStart (a, &ai); ai.leaf; FcCharSetIterNext (a, &ai))
{
int i = 256/32;
{
FcCharSetIter ai, bi;
FcChar32 count = 0;
-
+
FcCharSetIterStart (a, &ai);
FcCharSetIterStart (b, &bi);
while (ai.leaf)
{
int ai, bi;
FcChar16 an, bn;
-
+
if (a == b) return FcTrue;
bi = 0;
ai = 0;
{
FcChar32 *am = FcCharSetLeaf(a, ai)->map;
FcChar32 *bm = FcCharSetLeaf(b, bi)->map;
-
+
if (am != bm)
{
int i = 256/32;
*/
FcChar32
-FcCharSetNextPage (const FcCharSet *a,
+FcCharSetNextPage (const FcCharSet *a,
FcChar32 map[FC_CHARSET_MAP_SIZE],
FcChar32 *next)
{
FcCharSetIterSet (a, &ai);
if (!ai.leaf)
return FC_CHARSET_DONE;
-
+
/*
* Save current information
*/
}
FcChar32
-FcCharSetFirstPage (const FcCharSet *a,
+FcCharSetFirstPage (const FcCharSet *a,
FcChar32 map[FC_CHARSET_MAP_SIZE],
FcChar32 *next)
{
/*
* old coverage API, rather hard to use correctly
*/
-
+
FcChar32
FcCharSetCoverage (const FcCharSet *a, FcChar32 page, FcChar32 *result)
{
/*
* ASCII representation of charsets.
- *
+ *
* Each leaf is represented as 9 32-bit values, the code of the first character followed
* by 8 32 bit values for the leaf itself. Each value is encoded as 5 ASCII characters,
* only 85 different values are used to avoid control characters as well as the other
*/
static const unsigned char charToValue[256] = {
- /* "" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\b" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\020" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\030" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* " " */ 0xff, 0x00, 0xff, 0x01, 0x02, 0x03, 0x04, 0xff,
- /* "(" */ 0x05, 0x06, 0x07, 0x08, 0xff, 0xff, 0x09, 0x0a,
- /* "0" */ 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12,
- /* "8" */ 0x13, 0x14, 0xff, 0x15, 0x16, 0xff, 0x17, 0x18,
- /* "@" */ 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,
- /* "H" */ 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
- /* "P" */ 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,
- /* "X" */ 0x31, 0x32, 0x33, 0x34, 0xff, 0x35, 0x36, 0xff,
- /* "`" */ 0xff, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d,
- /* "h" */ 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45,
- /* "p" */ 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d,
- /* "x" */ 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0xff,
- /* "\200" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\210" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\220" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\230" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\240" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\250" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\260" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\270" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\300" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\310" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\320" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\330" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\340" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\350" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\360" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\370" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ /* "" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ /* "\b" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ /* "\020" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ /* "\030" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ /* " " */ 0xff, 0x00, 0xff, 0x01, 0x02, 0x03, 0x04, 0xff,
+ /* "(" */ 0x05, 0x06, 0x07, 0x08, 0xff, 0xff, 0x09, 0x0a,
+ /* "0" */ 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12,
+ /* "8" */ 0x13, 0x14, 0xff, 0x15, 0x16, 0xff, 0x17, 0x18,
+ /* "@" */ 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,
+ /* "H" */ 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
+ /* "P" */ 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,
+ /* "X" */ 0x31, 0x32, 0x33, 0x34, 0xff, 0x35, 0x36, 0xff,
+ /* "`" */ 0xff, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d,
+ /* "h" */ 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45,
+ /* "p" */ 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d,
+ /* "x" */ 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0xff,
+ /* "\200" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ /* "\210" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ /* "\220" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ /* "\230" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ /* "\240" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ /* "\250" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ /* "\260" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ /* "\270" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ /* "\300" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ /* "\310" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ /* "\320" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ /* "\330" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ /* "\340" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ /* "\350" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ /* "\360" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ /* "\370" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
};
static const FcChar8 valueToChar[0x55] = {
int i;
FcChar32 v;
FcChar32 c;
-
+
if (*string == ' ')
{
v = 0;
FcCharSetDestroy (check);
}
#endif
-
+
return FcTrue;
}
FcChar32 hash = FcCharLeafHash (leaf);
FcCharLeafEnt **bucket = &freezer->leaf_hash_table[hash % FC_CHAR_LEAF_HASH_SIZE];
FcCharLeafEnt *ent;
-
+
for (ent = *bucket; ent; ent = ent->next)
{
if (ent->hash == hash && !memcmp (&ent->leaf, leaf, sizeof (FcCharLeaf)))
{
FcCharSetOrigEnt **bucket = &freezer->orig_hash_table[((uintptr_t) orig) & FC_CHAR_SET_HASH_SIZE];
FcCharSetOrigEnt *ent;
-
+
ent = malloc (sizeof (FcCharSetOrigEnt));
if (!ent)
return FcFalse;
{
if (ent->hash == hash &&
ent->set.num == fcs->num &&
- !memcmp (FcCharSetNumbers(&ent->set),
+ !memcmp (FcCharSetNumbers(&ent->set),
FcCharSetNumbers(fcs),
fcs->num * sizeof (FcChar16)))
{
if (!ent)
return 0;
FcMemAlloc (FC_MEM_CHARSET, size);
-
+
freezer->charsets_allocated++;
-
+
ent->set.ref = FC_REF_CONSTANT;
ent->set.num = fcs->num;
if (fcs->num)
ent->set.leaves_offset = sizeof (ent->set);
ent->set.numbers_offset = (ent->set.leaves_offset +
fcs->num * sizeof (intptr_t));
-
+
ent_leaves = FcCharSetLeaves (&ent->set);
for (i = 0; i < fcs->num; i++)
ent_leaves[i] = FcPtrToOffset (ent_leaves,
FcCharSetLeaf (fcs, i));
- memcpy (FcCharSetNumbers (&ent->set),
- FcCharSetNumbers (fcs),
+ memcpy (FcCharSetNumbers (&ent->set),
+ FcCharSetNumbers (fcs),
fcs->num * sizeof (FcChar16));
}
else
{
FcCharSetOrigEnt **bucket = &freezer->orig_hash_table[((uintptr_t) orig) & FC_CHAR_SET_HASH_SIZE];
FcCharSetOrigEnt *ent;
-
+
for (ent = *bucket; ent; ent = ent->next)
if (ent->orig == orig)
return ent->frozen;
intptr_t *leaves;
FcChar16 *numbers;
int i;
-
+
if (cs->ref != FC_REF_CONSTANT)
{
if (!serialize->cs_freezer)
}
if (FcCharSetFindFrozen (serialize->cs_freezer, cs))
return FcTrue;
-
+
cs = FcCharSetFreeze (serialize->cs_freezer, cs);
}
-
+
leaves = FcCharSetLeaves (cs);
numbers = FcCharSetNumbers (cs);
-
+
if (!FcSerializeAlloc (serialize, cs, sizeof (FcCharSet)))
return FcFalse;
if (!FcSerializeAlloc (serialize, leaves, cs->num * sizeof (intptr_t)))
return FcFalse;
return FcTrue;
}
-
+
FcCharSet *
FcCharSetSerialize(FcSerialize *serialize, const FcCharSet *cs)
{
if (!cs)
return NULL;
}
-
+
cs_serialized = FcSerializePtr (serialize, cs);
if (!cs_serialized)
return NULL;
-
+
cs_serialized->ref = FC_REF_CONSTANT;
cs_serialized->num = cs->num;
leaves_serialized = FcSerializePtr (serialize, leaves);
if (!leaves_serialized)
return NULL;
-
+
cs_serialized->leaves_offset = FcPtrToOffset (cs_serialized,
leaves_serialized);
numbers_serialized = FcSerializePtr (serialize, numbers);
if (!numbers)
return NULL;
-
+
cs_serialized->numbers_offset = FcPtrToOffset (cs_serialized,
numbers_serialized);
-
+
for (i = 0; i < cs->num; i++)
{
leaf = FcCharSetLeaf (cs, i);
if (!leaf_serialized)
return NULL;
*leaf_serialized = *leaf;
- leaves_serialized[i] = FcPtrToOffset (leaves_serialized,
+ leaves_serialized[i] = FcPtrToOffset (leaves_serialized,
leaf_serialized);
numbers_serialized[i] = numbers[i];
}
cs_serialized->leaves_offset = 0;
cs_serialized->numbers_offset = 0;
}
-
+
return cs_serialized;
}
#define __fccharset__
{
FcStrBuf buf;
FcChar8 init_buf[1024];
-
+
FcStrBufInit (&buf, init_buf, sizeof (init_buf));
if (FcNameUnparseLangSet (&buf, ls) && FcStrBufChar (&buf,'\0'))
printf ("%s", buf.buf);
int i, j;
intptr_t *leaves = FcCharSetLeaves (c);
FcChar16 *numbers = FcCharSetNumbers (c);
-
+
#if 0
printf ("CharSet 0x%x\n", (intptr_t) c);
printf ("Leaves: +%d = 0x%x\n", c->leaves_offset, (intptr_t) leaves);
printf ("Numbers: +%d = 0x%x\n", c->numbers_offset, (intptr_t) numbers);
-
+
for (i = 0; i < c->num; i++)
{
- printf ("Page %d: %04x +%d = 0x%x\n",
- i, numbers[i], leaves[i],
+ printf ("Page %d: %04x +%d = 0x%x\n",
+ i, numbers[i], leaves[i],
(intptr_t) FcOffsetToPtr (leaves, leaves[i], FcCharLeaf));
}
#endif
{
int i;
FcPatternElt *e;
-
+
if (!p)
{
printf ("Null pattern\n");
{
FcEdit *e;
FcTest *t;
-
+
printf ("match\n");
for (t = subst->test; t; t = t->next)
{
for (i = 0; i < NUM_FC_BOOL_DEFAULTS; i++)
if (FcPatternObjectGet (pattern, FcBoolDefaults[i].field, 0, &v) == FcResultNoMatch)
FcPatternObjectAddBool (pattern, FcBoolDefaults[i].field, FcBoolDefaults[i].value);
-
+
if (FcPatternObjectGet (pattern, FC_PIXEL_SIZE_OBJECT, 0, &v) == FcResultNoMatch)
{
double dpi, size, scale;
FcBool ret = FcTrue;
int id;
int count = 0;
-
+
id = 0;
do
{
strcpy ((char *) file, (char *) dir);
strcat ((char *) file, "/");
base = file + strlen ((char *) file);
-
+
if (FcDebug () & FC_DBG_SCAN)
printf ("\tScanning dir %s\n", dir);
*/
for (i = 0; i < files->num; i++)
FcFileScanConfig (set, dirs, blanks, files->strs[i], config);
-
+
bail2:
FcStrSetDestroy (files);
bail1:
ret = FcFalse;
goto bail2;
}
-
+
/*
* Write out the cache file, ignoring any troubles
*/
FcDirCacheWrite (cache, config);
-
+
bail2:
FcStrSetDestroy (dirs);
bail1:
/* Try to use existing cache file */
if (!force)
cache = FcDirCacheLoad (dir, config, NULL);
-
+
/* Not using existing cache file, construct new cache */
if (!cache)
cache = FcDirCacheScan (dir, config);
-
+
return cache;
}
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_DZONGKHA, "dz" },
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_JAVANESE, "jw" },
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_SUNDANESE, "su" },
-
+
#if 0 /* these seem to be errors that have been dropped */
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_SCOTTISH_GAELIC },
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_IRISH_GAELIC },
#endif
-
+
/* The following codes are new as of 2000-03-10 */
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_GALICIAN, "gl" },
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_AFRIKAANS, "af" },
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_PASHTO_AFGHANISTAN, "ps" },
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_FILIPINO_PHILIPPINES, "phi" },
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_DHIVEHI_MALDIVES, "div" },
-
+
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_OROMO_ETHIOPIA, "om" },
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_TIGRIGNA_ETHIOPIA, "ti" },
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_TIGRIGNA_ERYTHREA, "ti" },
while (in_bytes_left)
{
- size_t did = iconv (cd,
+ size_t did = iconv (cd,
&inbuf, &in_bytes_left,
&outbuf, &out_bytes_left);
if (did == (size_t) (-1))
{
language_id = TT_MAC_LANGID_JAPANESE;
}
-
+
for (i = 0; i < NUM_FC_FT_LANGUAGE; i++)
if (fcFtLanguage[i].platform_id == platform_id &&
(fcFtLanguage[i].language_id == TT_LANGUAGE_DONT_CARE ||
{
/* vendor is not necessarily NUL-terminated. */
int i, len;
-
+
len = strlen((char *) vendor_string);
if (memcmp(vendor, vendor_string, len) != 0)
return FcFalse;
FcVendorFoundry(const FT_Char vendor[4])
{
int i;
-
+
if (vendor)
for(i = 0; i < NUM_VENDOR_FOUNDRIES; i++)
if (FcVendorMatch (vendor, FcVendorFoundries[i].vendor))
const FcChar8 *exclusiveLang = 0;
FT_SfntName sname;
FT_UInt snamei, snamec;
-
+
int nfamily = 0;
int nfamily_lang = 0;
int nstyle = 0;
FcChar8 *style = 0;
int st;
-
+
pat = FcPatternCreate ();
if (!pat)
goto bail0;
* the Postscript FontInfo dictionary. Finally, the
* BDF properties will queried.
*/
-
+
if (os2 && os2->version >= 0x0001 && os2->version != 0xffff)
foundry = FcVendorFoundry(os2->achVendID);
#endif
case TT_NAME_ID_PREFERRED_FAMILY:
case TT_NAME_ID_FONT_FAMILY:
-#if 0
+#if 0
case TT_NAME_ID_PS_NAME:
case TT_NAME_ID_UNIQUE_ID:
#endif
}
}
- if (!nfamily && face->family_name &&
+ if (!nfamily && face->family_name &&
FcStrCmpIgnoreBlanksAndCase ((FcChar8 *) face->family_name, (FcChar8 *) "") != 0)
{
if (FcDebug () & FC_DBG_SCANV)
goto bail1;
++nfamily;
}
-
+
if (!nstyle && face->style_name &&
FcStrCmpIgnoreBlanksAndCase ((FcChar8 *) face->style_name, (FcChar8 *) "") != 0)
{
goto bail1;
++nstyle;
}
-
+
if (!nfamily)
{
FcChar8 *start, *end;
}
if (bits & (1 << bit))
{
- /*
+ /*
* If the font advertises support for multiple
* "exclusive" languages, then include support
* for any language found to have coverage
* Type 1: Check for FontInfo dictionary information
* Code from g2@magestudios.net (Gerard Escalante)
*/
-
+
#if HAVE_FT_GET_PS_FONT_INFO
if (FT_Get_PS_Font_Info(face, &psfontinfo) == 0)
{
printf ("\tType1 weight %s maps to %d\n",
psfontinfo.weight, weight);
}
-
+
#if 0
- /*
+ /*
* Don't bother with italic_angle; FreeType already extracts that
* information for us and sticks it into style_flags
*/
if (psfontinfo.italic_angle)
- slant = FC_SLANT_ITALIC;
+ slant = FC_SLANT_ITALIC;
else
- slant = FC_SLANT_ROMAN;
+ slant = FC_SLANT_ROMAN;
#endif
if(!foundry)
foundry = FcNoticeFoundry(psfontinfo.notice);
}
#endif /* HAVE_FT_GET_PS_FONT_INFO */
-
+
#if HAVE_FT_GET_BDF_PROPERTY
/*
* Finally, look for a FOUNDRY BDF property if no other
prop.type == BDF_PROPERTY_TYPE_CARDINAL))
{
FT_Int32 value;
-
+
if (prop.type == BDF_PROPERTY_TYPE_INTEGER)
value = prop.u.integer;
else
* Drop our reference to the charset
*/
FcCharSetDestroy (cs);
-
+
return pat;
bail2:
FT_Face face;
FT_Library ftLibrary;
FcPattern *pat = NULL;
-
+
if (FT_Init_FreeType (&ftLibrary))
return NULL;
-
+
if (FT_New_Face (ftLibrary, (char *) file, id, &face))
goto bail;
AdobeSymbolEnt,
sizeof (AdobeSymbolEnt) / sizeof (AdobeSymbolEnt[0]),
};
-
+
static const FcFontDecode fcFontDecoders[] = {
{ ft_encoding_unicode, 0, (1 << 21) - 1 },
{ ft_encoding_symbol, &AdobeSymbol, (1 << 16) - 1 },
FcFreeTypeUseNames (FT_Face face)
{
FT_Int map;
-
+
if (!FT_Has_PS_Glyph_Names (face))
return FcFalse;
for (map = 0; map < face->num_charmaps; map++)
{
if (_fc_glyph_names[gn].ucs == ucs4)
return _fc_glyph_names[gn].name;
- if (!r)
+ if (!r)
{
r = (int) (ucs4 % FC_GLYPHNAME_REHASH);
if (!r)
{
if (!strcmp ((char *) name, (char *) _fc_glyph_names[gn].name))
return _fc_glyph_names[gn].ucs;
- if (!r)
+ if (!r)
{
r = (int) (h % FC_GLYPHNAME_REHASH);
if (!r)
}
static FcBool
-FcFreeTypeCheckGlyph (FT_Face face, FcChar32 ucs4,
+FcFreeTypeCheckGlyph (FT_Face face, FcChar32 ucs4,
FT_UInt glyph, FcBlanks *blanks,
FT_Pos *advance,
FcBool using_strike)
{
FT_Int load_flags = FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH | FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING;
FT_GlyphSlot slot;
-
+
if (using_strike)
load_flags &= ~FT_LOAD_NO_SCALE;
*/
if (face->face_flags & FT_FACE_FLAG_SCALABLE)
load_flags |= FT_LOAD_NO_BITMAP;
-
+
if (FT_Load_Glyph (face, glyph, load_flags))
return FcFalse;
-
+
slot = face->glyph;
if (!glyph)
return FcFalse;
-
+
*advance = slot->metrics.horiAdvance;
switch (slot->format) {
fcs = FcCharSetCreate ();
if (!fcs)
goto bail0;
-
+
#if HAVE_FT_SELECT_SIZE
if (strike_index >= 0) {
if (FT_Select_Size (face, strike_index) != FT_Err_Ok)
{
ucs4 = map->ent[i].bmp;
glyph = FT_Get_Char_Index (face, map->ent[i].encode);
- if (glyph &&
+ if (glyph &&
FcFreeTypeCheckGlyph (face, ucs4, glyph, blanks, &advance, using_strike))
{
- /*
+ /*
* ignore glyphs with zero advance. They’re
* combining characters, and while their behaviour
* isn’t well defined for monospaced applications in
if (FT_Get_Glyph_Name (face, glyph, name_buf, FC_GLYPHNAME_BUFLEN+1) == 0)
{
ucs4 = FcGlyphNameToUcs4 (name_buf);
- if (ucs4 != 0xffff &&
+ if (ucs4 != 0xffff &&
FcFreeTypeCheckGlyph (face, ucs4, glyph, blanks, &advance, using_strike))
{
if (advance)
FcFreeTypeCharSetAndSpacing (FT_Face face, FcBlanks *blanks, int *spacing)
{
FcCharSet *cs;
-
+
cs = FcFreeTypeCharSetAndSpacingForSize (face, blanks, spacing, -1);
/*
* Check for bitmap-only ttf fonts that are missing the glyf table.
* In that case, pick a size and look for glyphs in that size instead
*/
- if (FcCharSetCount (cs) == 0)
+ if (FcCharSetCount (cs) == 0)
{
/* Check for non-scalable TT fonts */
if (!(face->face_flags & FT_FACE_FLAG_SCALABLE) &&
/* Select the face closest to 16 pixels tall */
for (i = 1; i < face->num_fixed_sizes; i++) {
- if (abs (face->available_sizes[i].height - 16) <
+ if (abs (face->available_sizes[i].height - 16) <
abs (face->available_sizes[strike_index].height - 16))
strike_index = i;
}
*/
#define FcIsSpace(x) (040 == (x))
#define FcIsValidScript(x) (FcIsLower(x) || FcIsUpper (x) || FcIsSpace(x))
-
+
static void
addtag(FcChar8 *complex_, FT_ULong tag)
{
tagstring[2] = (FcChar8)(tag >> 8),
tagstring[3] = (FcChar8)(tag);
tagstring[4] = '\0';
-
+
/* skip tags which aren't alphabetic, under the assumption that
* they're probably broken
*/
if (!issilgraphitefont && !gsub_count && !gpos_count)
goto bail;
- maxsize = (((FT_ULong) gpos_count + (FT_ULong) gsub_count) * OTLAYOUT_LEN +
+ maxsize = (((FT_ULong) gpos_count + (FT_ULong) gsub_count) * OTLAYOUT_LEN +
(issilgraphitefont ? 13 : 0));
complex_ = malloc (sizeof (FcChar8) * maxsize);
if (!complex_)
{
FcPattern **f;
int sfont;
-
+
if (s->nfont == s->sfont)
{
sfont = s->sfont + 32;
FcFontSetSerializeAlloc (FcSerialize *serialize, const FcFontSet *s)
{
int i;
-
+
if (!FcSerializeAlloc (serialize, s, sizeof (FcFontSet)))
return FcFalse;
if (!FcSerializeAlloc (serialize, s->fonts, s->nfont * sizeof (FcPattern *)))
return NULL;
*s_serialize = *s;
s_serialize->sfont = s_serialize->nfont;
-
+
fonts_serialize = FcSerializePtr (serialize, s->fonts);
if (!fonts_serialize)
return NULL;
FcPrivate const FcCharMap *
FcFreeTypeGetPrivateMap (FT_Encoding encoding);
-
+
#endif /* _FCFTINT_H_ */
FcInitLoadConfig (void)
{
FcConfig *config;
-
+
FcInitDebug ();
config = FcConfigCreate ();
if (!config)
return FcFalse;
-
+
if (!FcConfigParseAndLoad (config, 0, FcTrue))
{
FcConfigDestroy (config);
return FcInitFallbackConfig ();
}
-
+
if (config->cacheDirs && config->cacheDirs->num == 0)
{
fprintf (stderr,
* Serialized data structures use only offsets instead of pointers
* A low bit of 1 indicates an offset.
*/
-
+
/* Is the provided pointer actually an offset? */
#define FcIsEncodedOffset(p) ((((intptr_t) (p)) & 1) != 0)
} FcValueList;
#define FcValueListNext(vl) FcPointerMember(vl,next,FcValueList)
-
+
typedef int FcObject;
typedef struct _FcPatternElt *FcPatternEltPtr;
/*
- * Pattern elts are stuck in a structure connected to the pattern,
+ * Pattern elts are stuck in a structure connected to the pattern,
* so they get moved around when the pattern is resized. Hence, the
* values field must be a pointer/offset instead of just an offset
*/
fs->fonts[i])
typedef enum _FcOp {
- FcOpInteger, FcOpDouble, FcOpString, FcOpMatrix, FcOpBool, FcOpCharSet,
+ FcOpInteger, FcOpDouble, FcOpString, FcOpMatrix, FcOpBool, FcOpCharSet,
FcOpNil,
FcOpField, FcOpConst,
- FcOpAssign, FcOpAssignReplace,
+ FcOpAssign, FcOpAssignReplace,
FcOpPrependFirst, FcOpPrepend, FcOpAppend, FcOpAppendLast,
FcOpQuest,
- FcOpOr, FcOpAnd, FcOpEqual, FcOpNotEqual,
+ FcOpOr, FcOpAnd, FcOpEqual, FcOpNotEqual,
FcOpContains, FcOpListing, FcOpNotContains,
FcOpLess, FcOpLessEqual, FcOpMore, FcOpMoreEqual,
FcOpPlus, FcOpMinus, FcOpTimes, FcOpDivide,
void *linear;
FcSerializeBucket *buckets[FC_SERIALIZE_HASH_SIZE];
} FcSerialize;
-
+
/*
* To map adobe glyph names to unicode values, a precomputed hash
* table is used
/*
* To perform case-insensitive string comparisons, a table
* is used which holds three different kinds of folding data.
- *
+ *
* The first is a range of upper case values mapping to a range
* of their lower case equivalents. Within each range, the offset
* between upper and lower case is constant.
*
* The second is a range of upper case values which are interleaved
* with their lower case equivalents.
- *
+ *
* The third is a set of raw unicode values mapping to a list
* of unicode values for comparison purposes. This allows conversion
* of ß to "ss" so that SS, ss and ß all match. A separate array
FcBlanks *blanks;
/*
* List of directories containing fonts,
- * built by recursively scanning the set
+ * built by recursively scanning the set
* of configured directories
*/
FcStrSet *fontDirs;
FcExprPage *expr_pool; /* pool of FcExpr's */
};
-
+
extern FcPrivate FcConfig *_fcConfig;
typedef struct _FcFileTime {
FcPrivate FcBool
FcDirCacheWrite (FcCache *cache, FcConfig *config);
-
+
FcPrivate void
FcCacheObjectReference (void *object);
FcPrivate void
FcCacheFini (void);
-
+
FcPrivate void
FcDirCacheReference (FcCache *cache, int nref);
FcConfigModifiedTime (FcConfig *config);
FcPrivate FcBool
-FcConfigAddCache (FcConfig *config, FcCache *cache,
+FcConfigAddCache (FcConfig *config, FcCache *cache,
FcSetName set, FcStrSet *dirSet);
/* fcserialize.c */
FcPrivate intptr_t
FcAlignSize (intptr_t size);
-
+
FcPrivate FcSerialize *
FcSerializeCreate (void);
FcPrivate void
FcCharSetPrint (const FcCharSet *c);
-
+
extern FcPrivate int FcDebugVal;
#define FcDebug() (FcDebugVal)
/* fclang.c */
FcPrivate FcLangSet *
-FcFreeTypeLangSet (const FcCharSet *charset,
+FcFreeTypeLangSet (const FcCharSet *charset,
const FcChar8 *exclusiveLang);
FcPrivate FcLangResult
FcLangCompare (const FcChar8 *s1, const FcChar8 *s2);
-
+
FcPrivate FcLangSet *
FcLangSetPromote (const FcChar8 *lang);
FcPrivate FcBool
FcPatternObjectAdd (FcPattern *p, FcObject object, FcValue value, FcBool append);
-
+
FcPrivate FcBool
FcPatternObjectAddWeak (FcPattern *p, FcObject object, FcValue value, FcBool append);
-
+
FcPrivate FcResult
FcPatternObjectGet (const FcPattern *p, FcObject object, int id, FcValue *v);
-
+
FcPrivate FcBool
FcPatternObjectDel (FcPattern *p, FcObject object);
}
FcLangSet *
-FcFreeTypeLangSet (const FcCharSet *charset,
+FcFreeTypeLangSet (const FcCharSet *charset,
const FcChar8 *exclusiveLang)
{
int i, j;
ls = FcLangSetCreate ();
if (!ls)
return 0;
- if (FcDebug() & FC_DBG_LANGSET)
+ if (FcDebug() & FC_DBG_LANGSET)
{
printf ("font charset");
FcCharSetPrint (charset);
}
for (i = 0; i < NUM_LANG_CHAR_SET; i++)
{
- if (FcDebug() & FC_DBG_LANGSET)
+ if (FcDebug() & FC_DBG_LANGSET)
{
printf ("%s charset", fcLangCharSets[i].lang);
FcCharSetPrint (&fcLangCharSets[i].charset);
continue;
for (j = 0; j < fcLangCharSets[i].charset.num; j++)
- if (FcCharSetLeaf(&fcLangCharSets[i].charset, j) !=
+ if (FcCharSetLeaf(&fcLangCharSets[i].charset, j) !=
FcCharSetLeaf(exclusiveCharset, j))
continue;
}
{
if (missing && missing < 10)
{
- FcCharSet *missed = FcCharSetSubtract (&fcLangCharSets[i].charset,
+ FcCharSet *missed = FcCharSetSubtract (&fcLangCharSets[i].charset,
charset);
FcChar32 ucs4;
FcChar32 map[FC_CHARSET_MAP_SIZE];
if (FcDebug() & FC_DBG_SCANV)
printf ("\n");
-
-
+
+
return ls;
}
}
/*
- * Return FcTrue when super contains sub.
+ * Return FcTrue when super contains sub.
*
* super contains sub if super and sub have the same
* language and either the same country or one
{
int low, high, mid = 0;
int cmp = 0;
- FcChar8 firstChar = FcToLower(lang[0]);
+ FcChar8 firstChar = FcToLower(lang[0]);
FcChar8 secondChar = firstChar ? FcToLower(lang[1]) : '\0';
-
+
if (firstChar < 'a')
{
low = 0;
{ /* fast path for resolving 2-letter languages (by far the most common) after
* finding the first char (probably already true because of the hash table) */
cmp = fcLangCharSets[mid].lang[1] - secondChar;
- if (cmp == 0 &&
- (fcLangCharSets[mid].lang[2] != '\0' ||
+ if (cmp == 0 &&
+ (fcLangCharSets[mid].lang[2] != '\0' ||
lang[2] != '\0'))
{
- cmp = FcStrCmpIgnoreCase(fcLangCharSets[mid].lang+2,
+ cmp = FcStrCmpIgnoreCase(fcLangCharSets[mid].lang+2,
lang+2);
}
}
if (missing)
{
for (j = 0; j < 32; j++)
- if (missing & (1 << j))
+ if (missing & (1 << j))
{
if (!FcLangSetContainsLang (lsa,
fcLangCharSets[fcLangCharSetIndicesInv[i*32 + j]].lang))
int s;
const char **objects;
int high, low, mid, c;
-
+
if (os->nobject == os->sobject)
{
s = os->sobject + 4;
}
if (c < 0)
mid++;
- memmove (os->objects + mid + 1, os->objects + mid,
+ memmove (os->objects + mid + 1, os->objects + mid,
(os->nobject - mid) * sizeof (const char *));
os->objects[mid] = object;
os->nobject++;
* where it requires an exact match)
*/
if (FcConfigCompareValue (&fnt->value,
- FcOpListing,
- &pat->value))
+ FcOpListing,
+ &pat->value))
break;
}
if (fnt == NULL)
static FcChar32
FcListMatrixHash (const FcMatrix *m)
{
- int xx = (int) (m->xx * 100),
- xy = (int) (m->xy * 100),
+ int xx = (int) (m->xx * 100),
+ xy = (int) (m->xy * 100),
yx = (int) (m->yx * 100),
yy = (int) (m->yy * 100);
FcListValueListHash (FcValueListPtr list)
{
FcChar32 h = 0;
-
+
while (list != NULL)
{
h = h ^ FcListValueHash (&list->value);
int entries;
FcListBucket *buckets[FC_LIST_HASH_SIZE];
} FcListHashTable;
-
+
static void
FcListHashTableInit (FcListHashTable *table)
{
for (prev = &table->buckets[hash % FC_LIST_HASH_SIZE];
(bucket = *prev); prev = &(bucket->next))
{
- if (bucket->hash == hash &&
+ if (bucket->hash == hash &&
FcListPatternEqual (bucket->pattern, font, os))
return FcTrue;
}
bucket->pattern = FcPatternCreate ();
if (!bucket->pattern)
goto bail1;
-
+
for (o = 0; o < os->nobject; o++)
{
if (!strcmp (os->objects[o], FC_FAMILY) || !strcmp (os->objects[o], FC_FAMILYLANG))
for (v = FcPatternEltValues(e), idx = 0; v;
v = FcValueListNext(v), ++idx)
{
- if (!FcPatternAdd (bucket->pattern,
- os->objects[o],
+ if (!FcPatternAdd (bucket->pattern,
+ os->objects[o],
FcValueCanonicalize(&v->value), defidx != idx))
goto bail2;
}
++table->entries;
return FcTrue;
-
+
bail2:
FcPatternDestroy (bucket->pattern);
bail1:
full++;
}
}
- printf ("used: %d max: %d avg: %g\n", full, max,
+ printf ("used: %d max: %d avg: %g\n", full, max,
(double) ents / FC_LIST_HASH_SIZE);
}
#endif
FcMemFree (FC_MEM_LISTBUCK, sizeof (FcListBucket));
free (bucket);
}
-
+
return ret;
bail2:
FcCompareNumber (FcValue *value1, FcValue *value2)
{
double v1, v2, v;
-
+
switch (value1->type) {
case FcTypeInteger:
v1 = (double) value1->u.i;
{
FcLangResult result;
FcValue value1 = FcValueCanonicalize(v1), value2 = FcValueCanonicalize(v2);
-
+
switch (value1.type) {
case FcTypeLangSet:
switch (value2.type) {
result = FcLangSetCompare (value1.u.l, value2.u.l);
break;
case FcTypeString:
- result = FcLangSetHasLang (value1.u.l,
+ result = FcLangSetHasLang (value1.u.l,
value2.u.s);
break;
default:
result = FcLangSetHasLang (value2.u.l, value1.u.s);
break;
case FcTypeString:
- result = FcLangCompare (value1.u.s,
+ result = FcLangCompare (value1.u.s,
value2.u.s);
break;
default:
FcResult *result)
{
int i, i1, i2;
-
+
for (i = 0; i < NUM_MATCH_VALUES; i++)
value[i] = 0.0;
-
+
i1 = 0;
i2 = 0;
while (i1 < pat->num && i2 < fnt->num)
FcPatternElt *fe, *pe;
FcValue v;
FcResult result;
-
+
new = FcPatternCreate ();
if (!new)
return 0;
pe = FcPatternObjectFindElt (pat, fe->object);
if (pe)
{
- if (!FcCompareValueList (pe->object, FcPatternEltValues(pe),
+ if (!FcCompareValueList (pe->object, FcPatternEltValues(pe),
FcPatternEltValues(fe), &v, 0, &result))
{
FcPatternDestroy (new);
FcPattern *
FcFontMatch (FcConfig *config,
- FcPattern *p,
+ FcPattern *p,
FcResult *result)
{
FcFontSet *sets[2];
}
if (!nnodes)
goto bail0;
-
+
for (nPatternLang = 0;
FcPatternGet (p, FC_LANG, nPatternLang, &patternLang) == FcResultMatch;
nPatternLang++)
;
/* freed below */
- nodes = malloc (nnodes * sizeof (FcSortNode) +
+ nodes = malloc (nnodes * sizeof (FcSortNode) +
nnodes * sizeof (FcSortNode *) +
nPatternLang * sizeof (FcBool));
if (!nodes)
goto bail0;
nodeps = (FcSortNode **) (nodes + nnodes);
patternLangSat = (FcBool *) (nodeps + nnodes);
-
+
new = nodes;
nodep = nodeps;
for (set = 0; set < nsets; set++)
}
nnodes = new - nodes;
-
+
qsort (nodeps, nnodes, sizeof (FcSortNode *),
FcSortCompare);
-
+
for (i = 0; i < nPatternLang; i++)
patternLangSat[i] = FcFalse;
-
+
for (f = 0; f < nnodes; f++)
{
FcBool satisfies = FcFalse;
FcFontSet *
FcFontSort (FcConfig *config,
- FcPattern *p,
+ FcPattern *p,
FcBool trim,
FcCharSet **csp,
FcResult *result)
const FcMatrix FcIdentityMatrix = { 1, 0, 0, 1 };
FcMatrix *
-FcMatrixCopy (const FcMatrix *mat)
+FcMatrixCopy (const FcMatrix *mat)
{
FcMatrix *r;
- if(!mat)
+ if(!mat)
return 0;
r = (FcMatrix *) malloc (sizeof (*r) );
if (!r)
{
if(mat1 == mat2) return FcTrue;
if(mat1 == 0 || mat2 == 0) return FcFalse;
- return mat1->xx == mat2->xx &&
+ return mat1->xx == mat2->xx &&
mat1->xy == mat2->xy &&
mat1->yx == mat2->yx &&
mat1->yy == mat2->yy;
#include <string.h>
#include <stdio.h>
-/*
+/*
* Please do not change this list, it is used to initialize the object
- * list in this order to match the FC_foo_OBJECT constants. Those
+ * list in this order to match the FC_foo_OBJECT constants. Those
* constants are written into cache files.
*/
* Hook it into the hash chain
*/
b = malloc (sizeof(FcObjectBucket));
- if (!b)
+ if (!b)
return NULL;
object = (const char *) FcStrCopy ((FcChar8 *) object);
if (!object) {
* Hook it into the hash chain
*/
b = malloc (sizeof(FcObjectBucket));
- if (!b)
+ if (!b)
return FcFalse;
if (copy)
{
{ (FcChar8 *) "expanded", "width", FC_WIDTH_EXPANDED },
{ (FcChar8 *) "extraexpanded", "width", FC_WIDTH_EXTRAEXPANDED },
{ (FcChar8 *) "ultraexpanded", "width", FC_WIDTH_ULTRAEXPANDED },
-
+
{ (FcChar8 *) "proportional", "spacing", FC_PROPORTIONAL, },
{ (FcChar8 *) "dual", "spacing", FC_DUAL, },
{ (FcChar8 *) "mono", "spacing", FC_MONO, },
{
const FcConstantList *l, **prev;
- for (prev = &_FcConstants;
- (l = *prev);
+ for (prev = &_FcConstants;
+ (l = *prev);
prev = (const FcConstantList **) &(l->next))
{
if (l->consts == consts && l->nconsts == nconsts)
FcNameFindNext (const FcChar8 *cur, const char *delim, FcChar8 *save, FcChar8 *last)
{
FcChar8 c;
-
+
while ((c = *cur))
{
if (c == '\\')
return 0;
}
static FcBool
-FcNameUnparseString (FcStrBuf *buf,
+FcNameUnparseString (FcStrBuf *buf,
const FcChar8 *string,
const FcChar8 *escape)
{
{
FcChar8 temp[1024];
FcValue v = FcValueCanonicalize(v0);
-
+
switch (v.type) {
case FcTypeVoid:
return FcTrue;
case FcTypeBool:
return FcNameUnparseString (buf, v.u.b ? (FcChar8 *) "True" : (FcChar8 *) "False", 0);
case FcTypeMatrix:
- sprintf ((char *) temp, "%g %g %g %g",
+ sprintf ((char *) temp, "%g %g %g %g",
v.u.m->xx, v.u.m->xy, v.u.m->yx, v.u.m->yy);
return FcNameUnparseString (buf, temp, 0);
case FcTypeCharSet:
for (i = 0; i < l->ntypes; i++)
{
o = &l->types[i];
- if (!strcmp (o->object, FC_FAMILY) ||
+ if (!strcmp (o->object, FC_FAMILY) ||
!strcmp (o->object, FC_SIZE) ||
!strcmp (o->object, FC_FILE))
continue;
-
+
e = FcPatternObjectFindElt (pat, FcObjectFromName (o->object));
if (e)
{
goto bail0;
if (!FcNameUnparseString (&buf, (FcChar8 *) "=", 0))
goto bail0;
- if (!FcNameUnparseValueList (&buf, FcPatternEltValues(e), escape ?
+ if (!FcNameUnparseValueList (&buf, FcPatternEltValues(e), escape ?
(FcChar8 *) FC_ESCAPE_VARIABLE : 0))
goto bail0;
}
FcMatrixFree ((FcMatrix *)l->value.u.m);
break;
case FcTypeCharSet:
- FcCharSetDestroy
+ FcCharSetDestroy
((FcCharSet *) (l->value.u.c));
break;
case FcTypeLangSet:
- FcLangSetDestroy
+ FcLangSetDestroy
((FcLangSet *) (l->value.u.l));
break;
default:
{
FcChar8 c;
FcChar32 h = 0;
-
+
if (s)
while ((c = *s++))
h = ((h << 1) | (h >> 31)) ^ c;
case FcTypeBool:
return (FcChar32) v->u.b;
case FcTypeMatrix:
- return (FcDoubleHash (v->u.m->xx) ^
- FcDoubleHash (v->u.m->xy) ^
- FcDoubleHash (v->u.m->yx) ^
+ return (FcDoubleHash (v->u.m->xx) ^
+ FcDoubleHash (v->u.m->xy) ^
+ FcDoubleHash (v->u.m->yx) ^
FcDoubleHash (v->u.m->yy));
case FcTypeCharSet:
return (FcChar32) FcValueCharSet(v)->num;
FcValueListHash (FcValueListPtr l)
{
FcChar32 hash = 0;
-
+
for (; l; l = FcValueListNext(l))
{
hash = ((hash << 1) | (hash >> 31)) ^ FcValueHash (&l->value);
{
int i;
FcPatternElt *elts;
-
+
if (p->ref == FC_REF_CONSTANT)
{
FcCacheObjectDereference (p);
{
int i;
FcPatternElt *e;
-
+
i = FcPatternObjectPosition (p, object);
if (i < 0)
{
i = -i - 1;
-
+
/* reallocate array */
if (p->num + 1 >= p->size)
{
e + i,
sizeof (FcPatternElt) *
(p->num - i));
-
+
/* bump count */
p->num++;
e[i].object = object;
e[i].values = NULL;
}
-
+
return FcPatternElts(p) + i;
}
for (i = 0; i < p->num; i++)
{
- h = (((h << 1) | (h >> 31)) ^
+ h = (((h << 1) | (h >> 31)) ^
pe[i].object ^
FcValueListHash (FcPatternEltValues(&pe[i])));
}
{
FcPatternElt *ea, *eb;
int i;
-
+
for (i = 0; i < os->nobject; i++)
{
FcObject object = FcObjectFromName (os->objects[i]);
new->value = value;
new->binding = binding;
new->next = NULL;
-
+
e = FcPatternObjectInsertElt (p, object);
if (!e)
goto bail2;
-
+
if (append)
{
for (prev = &e->values; *prev; prev = &(*prev)->next)
new->next = e->values;
e->values = new;
}
-
+
return FcTrue;
-bail2:
+bail2:
FcValueDestroy (value);
bail1:
FcMemFree (FC_MEM_VALLIST, sizeof (FcValueList));
/* destroy value */
FcValueListDestroy (e->values);
-
+
/* shuffle existing ones down */
- memmove (e, e+1,
- (FcPatternElts(p) + p->num - (e + 1)) *
+ memmove (e, e+1,
+ (FcPatternElts(p) + p->num - (e + 1)) *
sizeof (FcPatternElt));
p->num--;
e = FcPatternElts(p) + p->num;
{
return FcPatternObjectDel (p, FcObjectFromName (object));
}
-
+
FcBool
FcPatternRemove (FcPattern *p, const char *object, int id)
{
{
return FcPatternObjectGetInteger (p, FcObjectFromName (object), id, i);
}
-
-
+
+
FcResult
FcPatternObjectGetDouble (const FcPattern *p, FcObject object, int id, double *d)
{
{
return FcPatternObjectGetString (p, FcObjectFromName (object), id, s);
}
-
+
FcResult
FcPatternGetMatrix(const FcPattern *p, const char *object, int id, FcMatrix **m)
{
l->binding,
FcTrue))
goto bail1;
-
+
}
}
FcPatternVaBuild (FcPattern *p, va_list va)
{
FcPattern *ret;
-
+
FcPatternVapBuild (ret, p, va);
return ret;
}
FcPatternBuild (FcPattern *p, ...)
{
va_list va;
-
+
va_start (va, p);
FcPatternVapBuild (p, p, va);
va_end (va);
int i;
FcPatternElt *e;
FcValueListPtr v;
-
+
for (i = 0; i < s->num; i++)
{
e = FcPatternElts(s)+i;
for (v = FcPatternEltValues(e); v; v = FcValueListNext(v))
{
if (!FcPatternObjectAddWithBinding (p, e->object,
- FcValueCanonicalize(&v->value),
+ FcValueCanonicalize(&v->value),
v->binding, FcTrue))
return FcFalse;
}
{
int i;
FcPatternElt *elts = FcPatternElts(pat);
-
+
if (!FcSerializeAlloc (serialize, pat, sizeof (FcPattern)))
return FcFalse;
if (!FcSerializeAlloc (serialize, elts, pat->num * sizeof (FcPatternElt)))
*pat_serialized = *pat;
pat_serialized->size = pat->num;
pat_serialized->ref = FC_REF_CONSTANT;
-
+
elts_serialized = FcSerializePtr (serialize, elts);
if (!elts_serialized)
return NULL;
-
+
pat_serialized->elts_offset = FcPtrToOffset (pat_serialized,
elts_serialized);
if (!values_serialized)
return NULL;
elts_serialized[i].object = elts[i].object;
- elts_serialized[i].values = FcPtrToEncodedOffset (&elts_serialized[i],
+ elts_serialized[i].values = FcPtrToEncodedOffset (&elts_serialized[i],
values_serialized,
FcValueList);
}
vl_serialized = FcSerializePtr (serialize, vl);
if (!vl_serialized)
return NULL;
-
+
if (prev_serialized)
prev_serialized->next = FcPtrToEncodedOffset (prev_serialized,
vl_serialized,
int mid = (min + max) >> 1;
FcChar32 low = fcCaseFold[mid].upper;
FcChar32 high = low + FcCaseFoldUpperCount (&fcCaseFold[mid]);
-
+
if (high <= ucs4)
min = mid + 1;
else if (ucs4 < low)
w->read = 0;
}
r = *w->src++;
-
+
if ((r & 0xc0) == 0xc0)
return FcStrCaseWalkerLong (w, r);
if ('A' <= r && r <= 'Z')
{
r = *w->src++;
} while (r == ' ');
-
+
if ((r & 0xc0) == 0xc0)
return FcStrCaseWalkerLong (w, r);
if ('A' <= r && r <= 'Z')
FcChar8 c1, c2;
if (s1 == s2) return 0;
-
+
FcStrCaseWalkerInit (s1, &w1);
FcStrCaseWalkerInit (s2, &w2);
-
- for (;;)
+
+ for (;;)
{
c1 = FcStrCaseWalkerNext (&w1);
c2 = FcStrCaseWalkerNext (&w2);
FcChar8 c1, c2;
if (s1 == s2) return 0;
-
+
FcStrCaseWalkerInit (s1, &w1);
FcStrCaseWalkerInit (s2, &w2);
-
- for (;;)
+
+ for (;;)
{
c1 = FcStrCaseWalkerNextIgnoreBlanks (&w1);
c2 = FcStrCaseWalkerNextIgnoreBlanks (&w2);
FcStrCmp (const FcChar8 *s1, const FcChar8 *s2)
{
FcChar8 c1, c2;
-
+
if (s1 == s2)
return 0;
- for (;;)
+ for (;;)
{
c1 = *s1++;
c2 = *s2++;
FcStrCaseWalkerInit (s1, &w1);
FcStrCaseWalkerInit (s2, &w2);
-
- for (;;)
+
+ for (;;)
{
c1 = FcStrCaseWalkerNextIgnoreBlanks (&w1);
c2 = FcStrCaseWalkerNextIgnoreBlanks (&w2);
FcStrCaseWalkerInit (s1, &w1);
FcStrCaseWalkerInit (s2, &w2);
-
- for (;;)
+
+ for (;;)
{
c1 = FcStrCaseWalkerNext (&w1);
c2 = FcStrCaseWalkerNext (&w2);
while (s1len >= s2len)
{
- if (wordStart &&
+ if (wordStart &&
FcStrIsAtIgnoreCase (s1, s2) &&
(s1len == s2len || FcCharIsPunct (s1[s2len])))
{
if (s1 == s2)
return s1;
-
+
FcStrCaseWalkerInit (s1, &w1);
FcStrCaseWalkerInit (s2, &w2);
-
+
c2 = FcStrCaseWalkerNext (&w2);
-
+
for (;;)
{
cur = w1.src;
if (!c2)
return 0;
- for (;;)
+ for (;;)
{
p = s1;
c1 = *s1++;
if (len == 0)
return 0;
-
+
s = *src++;
len--;
-
+
if (!(s & 0x80))
{
result = s;
extra = 0;
- }
+ }
else if (!(s & 0x40))
{
return -1;
}
if (extra > len)
return -1;
-
+
while (extra--)
{
result <<= 6;
int clen;
FcChar32 c;
FcChar32 max;
-
+
n = 0;
max = 0;
while (len)
{
int bits;
FcChar8 *d = dest;
-
+
if (ucs4 < 0x80) { *d++= ucs4; bits= -6; }
else if (ucs4 < 0x800) { *d++= ((ucs4 >> 6) & 0x1F) | 0xC0; bits= 0; }
else if (ucs4 < 0x10000) { *d++= ((ucs4 >> 12) & 0x0F) | 0xE0; bits= 6; }
if (len < 2)
return 0;
-
+
a = GetUtf16 (src, endian); src += 2; len -= 2;
-
- /*
- * Check for surrogate
+
+ /*
+ * Check for surrogate
*/
if ((a & 0xfc00) == 0xd800)
{
int clen;
FcChar32 c;
FcChar32 max;
-
+
n = 0;
max = 0;
while (len)
FcStrCopyFilename (const FcChar8 *s)
{
FcChar8 *new;
-
+
if (*s == '~')
{
FcChar8 *home = FcConfigHome ();
return slash;
}
-
+
FcChar8 *
FcStrDirname (const FcChar8 *file)
{
}
return file;
}
-
+
#ifdef _WIN32
/*
- * Convert '\\' to '/' , remove double '/'
+ * Convert '\\' to '/' , remove double '/'
*/
static void
FcConvertDosPath (char *str)
* copy remaining string pointers and trailing
* NULL
*/
- memmove (&set->strs[i], &set->strs[i+1],
+ memmove (&set->strs[i], &set->strs[i+1],
(set->num - i) * sizeof (FcChar8 *));
set->num--;
return FcTrue;
if (--set->ref == 0)
{
int i;
-
+
for (i = 0; i < set->num; i++)
FcStrFree (set->strs[i]);
if (set->strs)
ftglue_log( const char* format, ... )
{
va_list ap;
-
+
va_start( ap, format );
vfprintf( stderr, format, ap );
va_end( ap );
FT_Error error;
LOG(( "ftglue_face_goto_table( %p, %c%c%c%c, %p )\n",
- face,
- (int)((the_tag >> 24) & 0xFF),
- (int)((the_tag >> 16) & 0xFF),
- (int)((the_tag >> 8) & 0xFF),
+ face,
+ (int)((the_tag >> 24) & 0xFF),
+ (int)((the_tag >> 16) & 0xFF),
+ (int)((the_tag >> 8) & 0xFF),
(int)(the_tag & 0xFF),
stream ));
FT_UNUSED(checksum);
FT_UNUSED(size);
-
+
if ( tag == the_tag )
{
LOG(( "TrueType table (start: %ld) (size: %ld)\n", start, size ));
Exit:
LOG(( "TrueType error=%d\n", error ));
-
+
return error;
-}
+}
#undef QALLOC
#define __ftglue__