[Fontconfig] Re: [patch]: mmapping FontConfig data structures

Keith Packard keithp at keithp.com
Sat Jun 11 03:07:57 EST 2005


Ok, now that I'm a bit more awake, here's what I'd *like* to see in an
mmap-based patch for fontconfig:


 1)  The mmap-able files are a *replacement* for the existing
     cache files.

 2)  Automatic discovery of new fonts still works, which
     means timestamp checking of font directories at
     application startup.

 3)  mmap'able files are address-independent

 4)  mmap'able files are architecture-independent

1) means that the existing 'fc-cache' program will generate these files
and no new per-user action is required.

2) provides the same guarantee that fontconfig does today --
the user need simply drop new fonts in ~/.fonts and things "just work".
The old X mkfontdir mess was a bad idea from
the very start.

3) is necessary if these files are to replace the existing cache as
being unable to map the cache files would be
catastrophic in the absense of another level of caching.

4) could be solved by making fc-cache store multiple
versions of the cache information in the same file with a small header
that provides a mapping into that data.
Applications would read the header and mmap the appropriate section of
the file.

I assume that these changes would require a redesign of most of the
fontconfig internal data structures to switch from pointers to offsets.
I believe the necessary data structures are all hidden from the
application so that this should be possible.

-keith

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20050610/8ab5eae8/attachment.pgp


More information about the Fontconfig mailing list