fontconfig/test
Keith Packard c4324f54ee Replace UUID file mechanism with per-directory 'map' attribute [v2]
The UUID files would be placed in each font directory to provide the
unique cache name, independent of path, for that directory. The UUID
files are undesireable for a couple of reasons:

 1) They must be placed in the font directories to be useful. This
    requires modifying the font directories themselves, introducing
    potential visible timestamp changes when running multiple
    applications, and makes the cache processing inconsistent between
    applications with permission to write to the font directories and
    applications without such permission.

 2) The UUID contents were generated randomly, which makes the font
    cache not reproducible across multiple runs.

One proposed fix for 2) is to make the UUID dependent on the font
directory path, but once we do that, we can simply use the font
directory path itself as the key as the original MD5-based font cache
naming mechanism did.

The goal of the UUID file mechanism was to fix startup time of
flatpaks; as the font path names inside the flatpak did not match the
font path names in the base system, the font cache would need to be
reconstructed the first time the flatpak was launched.

The new mechanism for doing this is to allow each '<dir>' element in
the configuration include a 'map' attribute. When looking for a cache
file for a particular directory, if the directory name starts with the
contents of the <dir> element, that portion of the name will be
replaced with the value of the 'map' attribute.

Outside of the flatpak, nothing need change -- fontconfig will build
cache files using real directory names.

Inside the flatpak, the custom fonts.conf file will now include
mappings such as this:

	<dir map="/usr/share/fonts">/run/host/fonts</dir>

When scanning the directory /run/host/fonts/ttf, fontconfig will
use the name /usr/share/fonts/ttf as the source for building the cache
file name.

The existing FC_FILE replacement code used for the UUID-based
implementation continues to correctly adapt font path names seen by
applications.

v2:
	Leave FcDirCacheCreateUUID stub around to avoid removing
	public API function.

	Document 'map' attribute of <dir> element in
	fontconfig-user.sgml

	Suggested-by: Akira TAGOH <akira@tagoh.org>

Signed-off-by: Keith Packard <keithp@keithp.com>
2019-04-03 12:02:09 +00:00
..
4x6.pcf Add simple tests 2003-03-01 05:55:17 +00:00
8x16.pcf Add simple tests 2003-03-01 05:55:17 +00:00
Makefile.am Replace UUID file mechanism with per-directory 'map' attribute [v2] 2019-04-03 12:02:09 +00:00
fonts.conf.in Replace UUID file mechanism with per-directory 'map' attribute [v2] 2019-04-03 12:02:09 +00:00
out.expected-long-family-names Add the check of PCF_CONFIG_OPTION_LONG_FAMILY_NAMES back 2017-11-20 17:29:39 +05:30
out.expected-no-long-family-names Add the check of PCF_CONFIG_OPTION_LONG_FAMILY_NAMES back 2017-11-20 17:29:39 +05:30
run-test-conf.sh Remove '-u' option from run-test-conf.sh 2019-04-03 12:02:09 +00:00
run-test-map.sh Replace UUID file mechanism with per-directory 'map' attribute [v2] 2019-04-03 12:02:09 +00:00
run-test.sh Replace UUID file mechanism with per-directory 'map' attribute [v2] 2019-04-03 12:02:09 +00:00
test-60-generic.json Add a test case for FcFontList 2018-11-27 09:39:15 +00:00
test-90-synthetic.json Add a test case for 90-synthetic.conf 2018-05-11 22:15:39 +09:00
test-bz89617.c Fix a couple of minor memory leaks 2016-05-30 10:30:10 +09:00
test-bz96676.c Bug 96676 - Check range of FcWeightFromOpenType argument 2016-07-08 14:18:35 +09:00
test-bz106618.c Add a test case for bz#106618 2018-05-25 15:24:44 +09:00
test-bz106632.c Add delays to test-bz106632, check UptoDate separately 2019-04-03 12:02:09 +00:00
test-bz131804.c Fix compiler warnings 2018-01-04 20:37:26 +09:00
test-conf.c Add a test case for FcFontList 2018-11-27 09:39:15 +00:00
test-d1f48f11.c Fix make check on cross-compiled env 2019-03-22 16:51:38 +09:00
test-issue107.c Fix make check on cross-compiled env 2019-03-22 16:51:38 +09:00
test-issue110.c Fix make check on cross-compiled env 2019-03-22 16:51:38 +09:00
test-migration.c trivial fix 2018-01-05 16:06:16 +09:00
test-name-parse.c Minor: fix warnings 2018-03-15 07:51:06 -07:00
test-pthread.c Add missing license headers 2014-01-17 13:05:25 +09:00
wrapper-script.sh Fix make check on cross-compiled env 2019-03-22 16:51:38 +09:00