]> git.wh0rd.org - fontconfig.git/commitdiff
Update documentation -- fc-cache's man page now says that you need to run
authorPatrick Lam <plam@MIT.EDU>
Fri, 23 Sep 2005 04:09:37 +0000 (04:09 +0000)
committerPatrick Lam <plam@MIT.EDU>
Fri, 23 Sep 2005 04:09:37 +0000 (04:09 +0000)
    fc-cache once per cached architecture; add some documentation to the
    FcCache structure.
Make fc-cache write out fonts.cache-2 files for directories with no fonts
    (i.e. only subdirectories).

fc-cache/fc-cache.sgml
src/fccache.c
src/fcint.h

index acc31ec455801ab10a540daa7a62d17703c45308..72df17e483878f0fde1b3496205e7bf6347c0e22 100644 (file)
@@ -88,6 +88,13 @@ manpage.1: manpage.sgml
         This cache is used to speed up application startup when using
         the fontconfig library.</para>
 
+      <para>Note that <command>&dhpackage;</command> must be executed
+        once per architecture to generate font information customized
+        for that architecture.  On a subsequent run,
+        <command>&dhpackage;</command> will augment the cache
+        information files with the information for the new
+        architecture. </para>
+
   </refsect1>
   <refsect1>
     <title>OPTIONS</title>
index 31630f1dc7a0bf8b69b832e1d43240baf1115f52..1121f31e56dbcdf5b85841008211ee125be5cc80 100644 (file)
@@ -744,14 +744,14 @@ FcDirCacheWrite (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir)
 
     current_dir_block = FcDirCacheProduce (set, &metadata);
 
-    if (!metadata.count)
+    if (!metadata.count && !dirs->size)
     {
        unlink ((char *)cache_file);
        free (cache_file);
        return FcTrue;
     }
 
-    if (!current_dir_block)
+    if (metadata.count && !current_dir_block)
        goto bail;
 
     if (FcDebug () & FC_DBG_CACHE)
@@ -788,9 +788,12 @@ FcDirCacheWrite (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir)
     FcCacheWriteString (fd, "");
 
     write (fd, &metadata, sizeof(FcCache));
-    lseek (fd, FcCacheNextOffset (lseek(fd, 0, SEEK_END)), SEEK_SET);
-    write (fd, current_dir_block, metadata.count);
-    free (current_dir_block);
+    if (metadata.count)
+    {
+       lseek (fd, FcCacheNextOffset (lseek(fd, 0, SEEK_END)), SEEK_SET);
+       write (fd, current_dir_block, metadata.count);
+       free (current_dir_block);
+    }
 
     /* this actually serves to pad out the cache file, if needed */
     if (ftruncate (fd, current_arch_start + truncate_to) == -1)
index 416501166f97f767ec3fab28446d3a61d43e862e..834f08585c4a1f78637fd36b77b55a5d33dbd7bc 100644 (file)
@@ -251,10 +251,10 @@ typedef struct _FcCache {
     int     pattern_count;      /* number of FcPatterns */
     int     patternelt_count;   /* number of FcPatternElts */
     int     valuelist_count;    /* number of FcValueLists */
-    int     str_count;          /* number of FcStrs */
-    int            langset_count;
-    int     charset_count;
-    int     charset_numbers_count;
+    int     str_count;          /* size of strings appearing as FcValues */
+    int            langset_count;      /* number of FcLangSets */
+    int     charset_count;      /* number of FcCharSets */
+    int     charset_numbers_count; 
     int     charset_leaf_count;
     int     charset_leaf_idx_count;
 } FcCache;