]> git.wh0rd.org Git - fontconfig.git/commitdiff
Fix problem with missing 'en' due to euro.patch: change cache file format
authorPatrick Lam <plam@MIT.EDU>
Thu, 9 Feb 2006 15:25:57 +0000 (15:25 +0000)
committerPatrick Lam <plam@MIT.EDU>
Thu, 9 Feb 2006 15:25:57 +0000 (15:25 +0000)
    slightly to coincide with that generated by fc-lang.

ChangeLog
src/fccharset.c

index 0881999f70bd8b85ce066f5f722b218f1120ce58..df5b0ae9f2273aae0a6a96969769be359df31b46 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-02-09  Patrick Lam  <plam@mit.edu>
+       * src/fccharset.c (FcCharSetNeededBytes, FcCharSetSerialize, 
+                          FcCharSetGetLeaf):
+
+       Fix problem with missing 'en' due to euro.patch: change
+       cache file format slightly to coincide with that generated
+       by fc-lang.
+
 2006-02-07  Patrick Lam  <plam@mit.edu>
        * src/fccache.c (FcCacheReadDirs):
 
index e42b82d329359743aaa6d7a5a53e79be85f124e0..460789221e6b9d6f87aa40a473874584c5170166 100644 (file)
@@ -1323,11 +1323,11 @@ FcCharSetNeededBytes (const FcCharSet *c)
 {
     /* yes, there's redundancy */
     charset_count++;
-    charset_leaf_idx_count++;
+    charset_leaf_idx_count += c->num;
     charset_leaf_count += c->num;
     charset_numbers_count += c->num;
     return sizeof (FcCharSet) + 
-       sizeof (int) +                  /* leaf_idx */
+       sizeof (int) * c->num +         /* leaf_idx */
        sizeof (FcCharLeaf) * c->num +  /* leaf */
        sizeof (FcChar16) * c->num;     /* number */
 }
@@ -1421,9 +1421,9 @@ FcCharSetSerialize(int bank, FcCharSet *c)
 
     charsets[bi][charset_ptr++] = new;
 
-    leaf_idx[bi][charset_leaf_idx_ptr++] = charset_leaf_ptr;
     for (i = 0; i < c->num; i++)
     {
+       leaf_idx[bi][charset_leaf_idx_ptr++] = charset_leaf_ptr;
        memcpy (&leaves[bi][charset_leaf_ptr++], 
                c->u.dyn.leaves[i], sizeof(FcCharLeaf));
        numbers[bi][charset_numbers_ptr++] = c->u.dyn.numbers[i];
@@ -1467,7 +1467,7 @@ FcCharSetGetLeaf(const FcCharSet *c, int i)
        return c->u.dyn.leaves[i];
     bi = FcCacheBankToIndex(c->bank);
 
-    return &leaves[bi][leaf_idx[bi][c->u.stat.leafidx_offset]+i];
+    return &leaves[bi][leaf_idx[bi][c->u.stat.leafidx_offset+i]];
 }
 
 FcChar16 *