Commit Graph

505 Commits

Author SHA1 Message Date
Patrick Lam 2eb8437406 When fc-cache is run without --force, use directory cache files to speed up
fc-cache run time.
2005-10-12 07:55:42 +00:00
Patrick Lam 23787a8f1b Add padding to make valgrind and glibc not hate each other when calling
strlen().
2005-10-06 20:45:25 +00:00
Patrick Lam edffd3b964 Fix typo in manually applying patch. 2005-10-05 21:12:25 +00:00
Patrick Lam 328929f5ea Modify config file to use Greek fonts before Asian fonts with Greek glyphs.
reviewed by: plam & keithp
2005-10-05 19:38:40 +00:00
Patrick Lam 1ed67f658c Use libtool -no-undefined flag on all platforms.
reviewed by: plam & keithp
2005-10-05 19:32:41 +00:00
Patrick Lam 751932ddb1 Implement move-to-front array for banks (perf regression reported by Ronny
V. Vindenes).
2005-10-05 18:41:55 +00:00
Patrick Lam 55c8fa4f08 Add new API which unlinks directory caches and checks dir caches for
existence of appropriate sections. Fix fc-cache to unlink stale cache
    files and save directory caches that lack relevant sections.
2005-10-05 00:34:52 +00:00
Patrick Lam 6bf2380478 Ensure that a directory cache has the appropriate section before reporting
that it is valid (reported by Matthias Clasen).
2005-10-03 19:51:11 +00:00
Patrick Lam bc5784ff00 Bump version number to 2.3.91. 2005-10-01 19:18:51 +00:00
Patrick Lam e99f0f0a45 Use libxml2 if requested (with --enable-libxml2) or if expat is not
available.
reviewed by: plam
2005-09-29 20:53:30 +00:00
Patrick Lam 649cc3616d Fix multi-arch cache files: compute the position for the block to be added
using info from OrigFile, not NewFile.
2005-09-29 05:14:04 +00:00
Patrick Lam cd3109114c Cast results of sizeof() to unsigned int to get rid of warnings on x86_64
(thanks Matthias Clasen).
2005-09-28 16:21:14 +00:00
Patrick Lam 9ecb9a9a06 Update ChangeLog. 2005-09-28 00:23:39 +00:00
Patrick Lam 1d879de2d9 Use FcAtomic to rewrite cache files. 2005-09-28 00:23:15 +00:00
Patrick Lam 099f9a8683 Don't unlink the fonts.cache-2 file even if there's no data to write; just
write an empty cache file. (thanks Lubos Lunak)
2005-09-27 15:52:58 +00:00
Patrick Lam 6aee8c6faa Allocate room for the subdirectory names in each directory cache. Thanks to
James Cloos for finding and diagnosing this bug!
2005-09-27 05:43:08 +00:00
Patrick Lam 2633bc3843 Fix .cvsignore file after copying across directories. 2005-09-27 05:26:59 +00:00
Patrick Lam d75bef7bc8 Add comment about needing docbook-utils to run make distcheck; hope it'll
save pain to others later.
2005-09-23 21:42:32 +00:00
Patrick Lam 35c2c7f1e9 Update ChangeLog for 2.3.90. 2005-09-23 14:41:40 +00:00
Patrick Lam f28f090d25 Add new command-line utility, fc-cat, to convert fonts.cache-2 files into
fonts.cache-1 files (e.g. for grepping and validation of the mmap
    codepath), as per James Cloos' request.
Remove done 'TODO' comment.
Updates for development release 2.3.90.
2005-09-23 05:59:19 +00:00
Patrick Lam a9698bed65 Update documentation -- fc-cache's man page now says that you need to run
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).
2005-09-23 04:09:37 +00:00
Patrick Lam e3ff8a4ea6 Remove debugging printf (oops). 2005-09-23 02:33:55 +00:00
Patrick Lam bef069e19e Convert fromcode to char[12] from char *. 2005-09-23 02:08:40 +00:00
Patrick Lam c7beacf916 Small patch for output in case where lineno not defined. 2005-09-23 01:48:33 +00:00
Patrick Lam 67accef4d3 Fix more gcc4 warnings:
- Cast sizeof to int, to shut up signedness warnings in comparison.
- Add consts where appropriate.
reviewed by: Patrick Lam <plam@mit.edu>
2005-09-22 23:45:53 +00:00
Patrick Lam 141432505a Fix bug when clients use FcNameRegisterObjectTypes; fontconfig was
returning bogus (i.e. duplicate) FcObjectPtr values. Now use negative
    values for dynamic object strings and positive values for built-in and
    FcNameRegisterObjectType strings. Thanks to Matthias Clasen for
    pinpointing this bus!
2005-09-22 20:49:24 +00:00
Patrick Lam 9fe2bd7ab0 Add missing FcValueCanonicalize on call to FcPatternAdd. 2005-09-16 04:57:18 +00:00
Patrick Lam 13cdf60753 Revert ill-advised addition of FC_RENDER. Add strategy for handling objects
that aren't hardcoded into fontconfig, but generated by fontconfig
    clients: keep another array of user-defined objects (indexed after the
    built-in objects).
Fix compilation warning (uninitialized variable).
Add comment.
2005-09-15 20:36:44 +00:00
Patrick Lam 0fa237d1e0 Add a global binding for the 'render' pattern element used by Xft; the lack
of said binding prevented programs from using FcPatterns through Xft.
2005-09-11 05:17:28 +00:00
Patrick Lam 8245771d5a Merge with HEAD and finish the GCC 4 cleanups (no more warnings!) 2005-09-11 02:16:09 +00:00
Patrick Lam 8cb4c56d99 Robustness fixes: check return values from read and lseek; fix
uninitialized variables; ensure progress on FcCacheSkipToArch.
2005-09-07 15:38:46 +00:00
Patrick Lam 03a212e525 Really fix the global cache: make sure we're reading and writing the same
data format. Also match subdirectories when consuming cache
    information. Also check dates for global cache: a dir is out of date if
    it is newer than the global cache; scan it manually if that's the case.
2005-09-03 04:56:56 +00:00
Patrick Lam f6ee3db5f0 Fix addressing in the global cache file, preventing infinite loops. Get rid
of unused variables.
2005-09-02 06:16:49 +00:00
Patrick Lam 07b3e57663 Apply Matthias Clasen's patch to fix obvious bogosity (i.e. missing
FcObjectPtrU).
2005-09-01 18:29:28 +00:00
Patrick Lam 0230c9f887 Fix embarassing attempt to free a static buffer. 2005-09-01 06:59:44 +00:00
Patrick Lam 2304e38f9b :
Save subdirectory names in cache files to save time. This completely
    restores the original fontconfig API, BTW. Note that directories
    without fonts don't get a cache file; but then how many files would it
    have in that directory...
2005-09-01 06:14:46 +00:00
Patrick Lam 5e678e9459 Only load requested fonts for fc-cache, and cleanup memory handling:
*Serialize no longer mutates original FcPatterns, it creates a new copy
    in the supplied buffer. Fix thinkos in global cache freeing and in
    FcCacheSkipToArch.
2005-08-31 15:12:41 +00:00
Patrick Lam fd77c154af Fix compilation error exposed with gcc 2.95. 2005-08-30 23:03:42 +00:00
Patrick Lam eb0cf67144 src/fcint.c
The global cache now uses the same mmap-based cache infrastructure as the
    per-directory caches. Furthermore, the global cache is automatically
    updated (if possible) whenever fontconfig is used. Rip out remnants of
    the old cache infrastructure.
2005-08-30 05:55:13 +00:00
Patrick Lam 2dbe759762 Emit and verify machine signature (sizeof (stuff) + endianness) in cache
files. Fix bugs in FcCacheBankToIndex.
2005-08-28 05:20:23 +00:00
Patrick Lam 7f37423d8c Replace FcObjectStaticName by FcStrStaticName. Implement serialization of
'object' table (strings pointed to by FcPatternElt->object and used as
    keys) and loading of object table from cache file if more strings are
    present in cache file than in current version of fontconfig. Hash the
    object table in memory.
2005-08-27 02:34:24 +00:00
Patrick Lam 1b7be37790 Reinstate the old global cache code. For the forseeable future, it's
probably all right to use the global cache as it was previously and
    just store filenames and font info, as long as no mmap cache exists in
    the directory. Of course, if an mmap cache exists, use that instead.
If a directory cache does not exist or is invalid, load the fonts for just
    that directory using the old codepath.
Fix premature free of the FcPatterns belonging to the FcFontSet which we
    create from the mmapped files.
2005-08-25 07:38:02 +00:00
Patrick Lam 4262e0b385 Overhaul the serialization system to create one mmapable file per directory
and distribute bytes for each directory from a single malloc for that
    directory. Store pointers as differences between the data pointed to
    and the pointer's address (s_off = s - v). Don't serialize data
    structures that never actually get serialized. Separate strings used
    for keys from strings used for values (in FcPatternElt and FcValue,
    respectively). Bump FC_CACHE_VERSION to 2.
2005-08-24 06:21:30 +00:00
Patrick Lam 212c9f437e #ifdef out old cache stuff, replace with first version of new mmapping
cache. Add *Read and *Write procedures which mmap in and write out the
    fontconfig data structures to disk. Currently, create cache in /tmp,
    with different sections for each architecture (as returned by uname's
    .machine field. Run the fc-cache binary to create a new cache file;
    fontconfig then uses this cache file on subsequent runs, saving lots of
    memory. Also fixes a few bugs and leaks.
2005-07-25 04:10:09 +00:00
Patrick Lam e1b9d091c6 Forward port cworth's patch to branch. 2005-07-15 18:49:12 +00:00
Patrick Lam 0fa680f076 Convert ObjectPtr from a fat structure to a simple index into an id table;
ids can be positive (for static strings) or negative (for dynamic
    strings). Static strings belong to a single buffer, while dynamic
    strings are independently allocated.
2005-07-07 12:09:10 +00:00
Patrick Lam cd2ec1a940 Add functionality to allow fontconfig data structure serialization.
This patch allows the fundamental fontconfig data structures to be
    serialized. I've converted everything from FcPattern down to be able to
    use *Ptr objects, which can be either static or dynamic (using a union
    which either contains a pointer or an index) and replaced storage of
    pointers in the heap with the appropriate *Ptr object. I then changed
    all writes of pointers to the heap with a *CreateDynamic call, which
    creates a dynamic Ptr object pointing to the same object as before.
    This way, the fundamental fontconfig semantics should be unchanged; I
    did not have to change external signatures this way, although I did
    change some internal signatures. When given a *Ptr object, just run *U
    to get back to a normal pointer; it gives the right answer regardless
    of whether we're using static or dynamic storage.
I've also implemented a Fc*Serialize call. Calling FcFontSetSerialize
    converts the dynamic FcFontSets contained in the config object to
    static FcFontSets and also converts its dependencies (e.g. everything
    you'd need to write to disk) to static objects. Note that you have to
    call Fc*PrepareSerialize first; this call will count the number of
    objects that actually needs to be allocated, so that we can avoid
    realloc. The Fc*Serialize calls then check the static pointers for
    nullness, and allocate the buffers if necessary. I've tested the
    execution of fc-list and fc-match after Fc*Serialize and they appear to
    work the same way.
2005-06-28 03:41:02 +00:00
Keith Packard f1a42f6b5f Make FcOpNotContains use FcStrStr for strings so that it matches semantics
for !FcOpContains.
reviewed by: keithp
2005-06-17 03:01:43 +00:00
Keith Packard adc7abacbf Move fontconfig source package to libs as per override 2005-05-20 16:21:39 +00:00
Keith Packard a65a77aecf The ka.orth file requires several characters which are not used anymore in
modern Georgian and which are missing in the free Georgian TrueType
    fonts downloadable at:
http://aiet.qartuli.net/docs/georgian_on_linux_en.php
reviewed by: Mike Fabian Bug: 3352
2005-05-20 15:56:51 +00:00