summaryrefslogtreecommitdiff
path: root/fc-cache
AgeCommit message (Collapse)AuthorFilesLines
2008-04-18Fix build with !ENABLE_DOCS and no built manpages.Eric Anholt1-2/+6
2008-01-08Eliminate references to freetype from utility Makefile.am'sKeith Packard1-2/+2
The utility programs don't use any freetype interfaces, so they don't need to directly refer to freetype headers or libraries.
2007-11-13Workaround for stat() brokenness in Microsoft's C library (bug 8526)Tor Lillqvist1-0/+3
Fix a couple of longstanding problems with fontconfig on Windows that manifest themselves especially in GIMP. The root cause to the problems is in Microsoft's incredibly stupid stat() implementation. Basically, stat() returns wrong timestamp fields for files on NTFS filesystems on machines that use automatic DST switching. See for instance http://bugzilla.gnome.org/show_bug.cgi?id=154968 and http://www.codeproject.com/datetime/dstbugs.asp As fccache.c now looks at more fields in the stat struct I fill in them all. I noticed that fstat() is used only on a fd just after opening it, so on Win32 I just call my stat() replacement before opening instead... Implementing a good replacement for fstat() would be harder because the code in fccache.c wants to compare inode numbers. There are no (readily accessible) inode numbers on Win32, so I fake it with the hash of the full file name, in the case as it is on disk. And fstat() doesn't know the full file name, so it would be rather hard to come up with a inode number to identify the file. The patch also adds similar handling for the cache directory as for the fonts directory: If a cachedir element in fonts.conf contains the magic string "WINDOWSTEMPDIR_FONTCONFIG_CACHE" it is replaced at runtime with a path under the machine's (or user's) temp folder as returned by GetTempPath(). I don't want to hardcode any pathnames in a fonts.conf intended to be distributed to end-users, most of which who wouldn't know how to edit it anyway. And requiring an installer to edit it gets complicated.
2007-11-03Don't check cache file time stamps when cleaning cache dir.Keith Packard1-9/+1
Cache file mtime is meaningless now that the directory time is encoded in the cache.
2007-10-25Distribute man source files for command line programs (bug 9678).Keith Packard1-3/+3
For systems on whch DOCBOOK is unavailable, distribute command line program manual pages in .man format.
2007-10-18Have fc-cache remove invalid cache files from cache directories.Keith Packard1-16/+18
Old cache file versions, or corrupted cache files should be removed when cleaning cache directories with fc-cache. This only affects filenames which match the fontconfig cache file format, so other files will be left alone.
2007-10-18Don't use X_OK bit when checking for writable directories (bug 12438)Keith Packard1-1/+1
Some mingw versions have broken X_OK checking; instead of trying to work around this in a system-depedent manner, simply don't bother checking for X_OK along with W_OK as such cases are expected to be mistakes, and not sensible access control.
2007-10-18Verbose message about cleaning directories was impreciseKeith Packard1-1/+2
Non-existent directories are now described as 'non-existent' instead of 'unwritable'.
2007-10-18Improve verbose messages from fc-cache.Keith Packard1-2/+2
fc-cache would say 'skipping: %d fonts, %d dirs' or 'caching: %d fonts, %d dirs', which could easily mislead the user. Add 'existing cache is valid' or 'new cache contents' to these messages to explain what it is doing.
2007-10-18Remove unneeded call to access(2) in fc-cache.Keith Packard1-15/+3
This call was followed by a call to stat(2) which provided the necessary information. This call to access(2) was necessary when cache files were stored in the font directory as that would check for write permission correctly.
2006-10-27Do not clean cache files for different architecturesMike FABIAN1-0/+9
Use filenames to clean cache files for current architecture only. This is sufficient as cache files live in their own directory where filenames are under fontconfig control.
2006-09-13Add warning flags to fc-cache build. Clean up warnings in fc-cache.Keith Packard2-24/+9
Looks like the last directory in the project which didn't use $(WARN_CFLAGS) for some reason. Adding that found the usual collection of char * vs FcChar8 * issues (why, oh why is FcChar8 not just char...)
2006-09-04Hide private functions in shared library. Export functionality for utilities.Keith Packard1-17/+13
Borrowing header stuff written for cairo, fontconfig now exposes in the shared library only the symbols which are included in the public header files. All private symbols are hidden using suitable compiler directives. A few new public functions were required for the fontconfig utility programs (fc-cat and fc-cache) so those were added, bumping the .so minor version number in the process.
2006-09-03Remove all .cvsignore filesKeith Packard1-6/+0
2006-09-02Unify directory canonicalization into FcStrAddFilename.Keith Packard1-1/+1
Instead of making filename canonicalization occur in multiple places, it occurs only in FcStrAddFilename now, as all filenames pass through that function at one point.
2006-09-01Fix memory leaks in fc-cache directory cleaning code.Keith Packard1-0/+9
valgrind found a few leaks in the new cache cleaning code.
2006-09-01Pass directory information around in FcCache structure. Freeze charsets.Keith Packard1-63/+46
Instead of passing directory information around in separate variables, collect it all in an FcCache structure. Numerous internal and tool interfaces changed as a result of this. Charsets are now pre-frozen before being serialized. This causes them to share across multiple fonts in the same cache.
2006-08-31Change $(pkgcachedir) to $(fc_cachedir) in fc-cat and fc-cache Makefile.amKeith Packard1-4/+2
make distcheck caught this bug; the effect of 'make uninstall' would have been to execute 'rm -rf /', somewhat less that desirable.
2006-08-31Revert ABI changes from version 2.3Keith Packard1-2/+2
Accidental ABI changes and additions were discovered by looking at the differences in fontconfig.h. All of those have been reverted.
2006-08-31Automatically remove invalid cache files.Keith Packard2-2/+130
Cache files for missing or more recently modified directories are automatically removed at the end of every fc-cache run.
2006-08-30Skip broken caches. Cache files are auto-written, don't rewrite in fc-cache.Keith Packard1-13/+12
Validate cache contents and skip broken caches, looking down cache path for valid ones. Every time a directory is scanned, it will be written to a cache file if possible, so fc-cache doesn't need to re-write the cache file. This makes detecting when the cache was generated a bit tricky, so we guess that if the cache wasn't valid before running and is valid afterwards, the cache file was written. Also, allow empty charsets to be serialized with null leaves/numbers. Eliminate a leak in FcEdit by switching to FcObject sooner. Call FcFini from fc-match to make valgrind happy.
2006-08-27Fix up fc-cache and fc-cat for no global cache changes.Keith Packard1-1/+1
fc-cache and fc-cat use internal (fcint.h) APIs that have changed with the elimination of the global cache.
2006-08-27Eliminate global cache. Eliminate multi-arch cache code.Keith Packard1-2/+1
With the removal of the in-directory cache files, and the addition of per-user cache directories, there is no longer any reason to preserve the giant global cache file. Eliminating of this unifies the cache structure and simplifies the overall caching strategies greatly.
2006-08-27Eliminate NormalizeDir. Eliminate gratuitous stat/access calls per dir.Keith Packard1-5/+2
Normalized directory names offer protection against looped directory trees but cost enormous numbers of system calls (stat per file in the hierarchy). Also, cache file directory name contents are validated each time the directory is modified, don't re-validate every time the cache file is loaded with an access and stat call.
2006-08-042006-08-04 Keith Packard (keithp@keithp.com) reviewed by: plamPatrick Lam1-4/+3
Make cache directories configurable. Simplify and correct some code which deals with per-directory caches.
2006-04-25Include $(top_srcdir), $(top_srcdir)/src before anything else.Patrick Lam1-7/+8
Shuffle order of includes for building out of srcdir on win32. reviewed by: plam
2006-04-07LD_ADD missing dependencies for binaries. Reported by Edson Alves Pereira.Patrick Lam1-1/+1
reviewed by: plam
2006-04-07Patrick Lam <plam@mit.edu>Patrick Lam1-0/+7
Make fontconfig compile under MinGW: 1) remove unneeded #includes; 2) make use of mmap and sysconf conditional; 3) replace rand_r by srand/rand if needed; 4) use chsize instead of ftruncate; and 5) update libtool exports file
2006-04-06Reduce amount of dirty rss by const'ing some data structures.Patrick Lam1-2/+2
Don't fail if we can't create or remove $(pkgcachedir) i.e. /var/cache/fontconfig. (reported by Quanah Gibson-Mount). reviewed by: plam
2006-02-18Fix the underlying cause of the below segfault (must usually callPatrick Lam1-0/+2
FcDirCacheHasCurrentArch after FcDirCacheValid).
2006-02-16Add -r --really-force option which blows away cache files and thenPatrick Lam1-7/+18
regenerates them.
2006-02-16Don't bail if fontconfig can't remove a dir cache file. Skip the ID of aPatrick Lam1-6/+10
cache file when copying. Eliminate 'source file too small' bug in FcDirCacheWrite.
2006-02-06Don't loop infinitely on recursive symlinks.Patrick Lam1-0/+18
reviewed by: plam
2006-02-05Make 'make distcheck' work with automake 1.6.3.Patrick Lam1-1/+1
reviewed by: plam
2006-01-31Stephan Kulow <coolo@suse.de> reviewed by: plamPatrick Lam1-10/+3
Replace 'stamp' target with mkinstalldirs.
2006-01-31Don't stop scanning if a directory in fonts.conf doesn't exist, becausePatrick Lam1-6/+14
subsequent directories might exist. reviewed by: plam
2006-01-27Move FcConfigNormalizeFontDir call so that it doesn't result in infinitePatrick Lam1-1/+5
recursion (reported by Ronny V. Vindenes).
2006-01-14Compare device numbers as well as inodes. Always normalize directory namesPatrick Lam1-1/+1
before comparing them. Allocate extra space for appended '/' in directory name. reviewed by: plam
2006-01-10Explicitly add font dirs to config.fontDirs even if they're empty. SetPatrick Lam1-0/+1
current config in fc-cache.c. Fix treatment of cache directory as read from cache file; don't use string equality to determine if we have the right file, use inode equality.
2006-01-09Normalize font dirs by using the form, as given in fonts.conf, and recordedPatrick Lam1-1/+1
in FcConfig's fontDirs string set, as canonical. Actually update config.fontDirs as font directories are scanned.
2005-12-21Bump version to 2.3.93.fc-2_3_93Patrick Lam1-0/+8
Use open instead of fopen (requested by Phil Race for Sun). src/fccache.c (FcDirCacheWrite); Fix GCC4 warning and Makefile brokenness for /var/cache/fontconfig dir.
2005-12-12Improve error message when fc-cache can't write the cache. Add missingPatrick Lam2-1/+8
slash. Reported by Behdad. Incorporate Behdad's patch to create /var/cache/fontconfig when appropriate.
2005-12-09Migrate cache files from fonts directories to /var/cache/fontconfig. ThisPatrick Lam1-0/+2
helps make fontconfig FHS-compliant, but requires that all caches get rebuilt. Also, autogen.sh now needs the additional parameter --localstatedir=/var.
2005-11-02Revert the previous patch and commit the correct patch: I forgot aPatrick Lam1-9/+0
canonicalization in FcValueListSerialize, so that it would choke on already-serialized input files. Duh!
2005-11-02Forcibly rescan a directory before writing a fresh local cache file forPatrick Lam1-0/+9
that directory, fixing the losing-fonts problem reported by Mike Fabian and also apparently the font cache file corruption.
2005-10-05Add new API which unlinks directory caches and checks dir caches forPatrick Lam1-1/+5
existence of appropriate sections. Fix fc-cache to unlink stale cache files and save directory caches that lack relevant sections.
2005-09-23Add new command-line utility, fc-cat, to convert fonts.cache-2 files intoPatrick Lam2-3/+2
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-23Update documentation -- fc-cache's man page now says that you need to runPatrick Lam1-0/+7
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-01:Patrick Lam1-1/+1
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-08-31Only load requested fonts for fc-cache, and cleanup memory handling:Patrick Lam1-2/+1
*Serialize no longer mutates original FcPatterns, it creates a new copy in the supplied buffer. Fix thinkos in global cache freeing and in FcCacheSkipToArch.