Instead of relying on mtime ordering between a directory and its associated
cache file, write the directory mtime into the cache file itself. This makes
cache file checks more reliable across file systems.
This change is made in a way that old programs can use new cache files, but
new programs will need new cache files.
In FcDirCacheUnlink(), the line
cache_hashed = FcStrPlus (cache_dir, cache_base);
allocates memory in cache_hashed that is never free()'d before the function
exits.
Reported by Ben Combee.
Recent versions of FreeType do not correctly deal with glyph name buffers
that are too small; work around this by declaring a buffer that can hold any
PS name (127 bytes).
I noticed that Qt always uses a different font than fc-match advertises.
Debugging the issue, I found that a call that looks pretty innocent is
changing all weak bindings to strong bindings and as such changes the
semantic of the match: FcPatternDuplicate.
Adapt documentation to reality.
(1) The fc-cat usage message should reflect the
options accepted by the program.
(2) The fc-cat.1 manpage was fairly broken (unreadable).
Missing NULL font check before attempting to edit scanned pattern.
Also, <match target="scan"> rules are now checked to ensure all
edited variables are in the predefined set; otherwise, the resulting
cache files will not be stable.
src/fccache.c uses a trick to try and use a function name that is also a
macro name. It does this using the varargs args() macro. Replace that
with separate macros for each number of formals.
grep -l -w '^foo' doesn't work on Solaris. Replace with
grep -l '^foo\>' instead which does. Also, grep -l will
report the filename more than once (!), so add | head -1
to pick just the first one.
The union inside the FcValue structure contains pad bytes. Instead of
copying the whole structure to the cache block, copy only the initialized
fields to avoid writing whichever bytes serve as padding within the
structure.
When updating from older fontconfig versions, if the config file
is not replaced, it will not contain <cachedir> elements. Lacking these,
fontconfig has no place to store cached font information and cannot operate
reasonably.
Add code to check and see if the loaded configuration has no cache
directories, and if so, warn the user and add both the default system cache
directory and the normal per-user cache directory.
Instead of accepting whatever order names appear in the font file,
use an explicit ordering for both platform and nameid.
Platforms are high precedence than nameids.
The platform order is:
microsoft, apple unicode, macintosh, (other)
The family nameid order is:
preferred family, font family
The fullname nameid order is:
mac full name, full name
The style nameid order is
preferred subfamily, font subfamily
This will change the names visible to users in various application UIs, but
should not change how existing font names are matched as all names remain
present in the resulting database. The hope is that family names will, in
general, be less ambiguous. Testing here shows that commercial fonts
have longer names now while DejaVu has a shorter family name, and moves more
of the font description to the style name.
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.
Our build system barfs on autogen.sh, which ignores --noconfigure. Configure
needs a host of options to make the cross compile work in our case.
Fix typo in fccache.c
FcStrCanonFileName checks whether s[0] == '/', and recurses if not.
This only works on POSIX. On dos, this crashes with a stack overflow.
The patch attached splits this functionality in two functions
(FcStrCanonAbsoluteFilename) and uses GetFullPathName on windows to get an
absolute path. It also fixes a number of other issues. With this patch,
LilyPond actually produces output on Windows.
Instead of attempting to track exported symbols manually in
fontconfig.def.in, build it directly from the public fontconfig header files
to ensure it exports the public API.
With the cache restructuring of 2.4.0, the ability to add
application-specific font files and directories was accidentally lost.
Reimplement this using by sharing the logic used to load configured font
directories.
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...)
Most of the remaining elements in fonts.conf have been moved to separate
files. The numbering scheme for conf.d files has been documented in the
README and the files have been renumbered. Config files have been
validated against the DTD and a few minor errors fixed.
All caches used in the application must be in the cache reference list so
internal references can be tracked correctly. Failing to have newly created
caches in the list would cause the cache to be deallocated while references
were still present.
Locale environment variables (LC_ALL, LC_CTYPE, LANG) must contain language,
and may contain territory and encoding. Don't accidentally require territory
as that will cause fontconfig to fall back to 'en'.
makealias was using a gnu-extension to sed addressing, replace that with a
simple (and more robuse) grep command. Also, found a bug in the public
header file that was leaving one symbol out of the process.
The existing loop for discovering which characters map to glyphs is ugly and
inefficient. The replacement is functionally identical, but far cleaner and
faster.
Charset hashing actually use the value of the leaf pointers, which is
clearly wrong, especially now that charsets are not shared across multiple
font directories.