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.
Add new helper program 'fc-case' to construct case folding tables from
standard Unicode CaseFolding.txt file
Re-implement case insensitive functions with Unicode aware versions
(including full case folding mappings)
On Windows with gcc (a.k.a. mingw) build as a DLL.
We don't want to hardcode the fonts.conf file location in the DLL, so we
look up the DLL location at run-time in a DllMain() function. The
fonts.conf location is deduced from that.
The colon can't be used as path separator on Windows, semicolon is used
instead. File path components can be separated with either slash or
backslash. Absolute paths can also begin with a drive letter.
Add internal function FcStrLastSlash that strrchr's the last slash, or
backslash on Windows.
There is no link() on Windows. For atomicity checks, mkdir a lock directory
instead.
In addition to HOME, also look for USERPROFILE.
Recognize the special font directory token WINDOWSFONTDIR, to use the
system's font directory.
Remove the fontconfig-def.cpp that was obsolete. Add fontconfig.def(.in),
without internal functions.
Add a fontconfig-zip(.in) script, used to build a binary distribution.