Commit Graph

2214 Commits

Author SHA1 Message Date
Akira TAGOH 500e77a01d Drop a line to include uuid.h 2019-04-03 12:02:09 +00:00
Akira TAGOH 04f75fce0b Add FcDirCacheCreateUUID doc back to pass make check 2019-04-03 12:02:09 +00:00
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
Keith Packard 4cde12bfda Remove UUID-related tests
Remove test-hash
Remove UUID tests from run-test.sh

Signed-off-by: Keith Packard <keithp@keithp.com>
2019-04-03 12:02:09 +00:00
Keith Packard a8c4fc5e1f Add delays to test-bz106632, check UptoDate separately
On a file system with one-second time stamps, extra delays are needed
between cache modification operations to ensure that fontconfig isn't
fooled.

And, when the timestamps are checked correctly, we need to make sure
that FcConfigUptoDate returns false whenever we change a font
directory, so separate that out from the call to reinitialize the core
config.

Signed-off-by: Keith Packard <keithp@keithp.com>
2019-04-03 12:02:09 +00:00
Keith Packard 2a81aa51f0 Remove '-u' option from run-test-conf.sh
This causes a failure when evaluating $OSTYPE on systems which do not
set that variable (everything but Msys/MinGW)

Signed-off-by: Keith Packard <keithp@keithp.com>
2019-04-03 12:02:09 +00:00
Keith Packard 67e9c12c5a Fetch FONTCONFIG_SYSROOT in FcConfigCreate
This saves the value of FONTCONFIG_SYSROOT in the config instead of
having to call getenv every time we need this value.

This also uses 'realpath' to construct a canonical path to sysroot,
eliminating symlinks and relative path names.

Signed-off-by: Keith Packard <keithp@keithp.com>
2019-04-03 12:02:09 +00:00
Akira TAGOH 97fa77d27f Reset errno to do error handling properly
This fixes the weird behavior when running with SOURCE_DATE_EPOCH=0:

Fontconfig: SOURCE_DATE_EPOCH: strtoull: No such file or directory: 0
2019-04-03 11:49:42 +00:00
Akira TAGOH 809f040bc3 Don't test bind-mount thing for MinGW 2019-03-23 07:19:08 +00:00
Akira TAGOH 4cb490b0b9 Install wine for CI on MinGW 2019-03-23 07:05:23 +00:00
Akira TAGOH 73b300dc7c Correct configure option to cross-compile 2019-03-23 06:57:19 +00:00
Akira TAGOH 33b372e20f Update requirement for gettext 2019-03-23 06:49:32 +00:00
Akira TAGOH 92caab9c76 Fix make distcheck error 2019-03-23 06:27:39 +00:00
Akira TAGOH 10e13fc748 Add build test for MinGW 2019-03-22 07:58:04 +00:00
Akira TAGOH f6810ede60 Fix make check on cross-compiled env 2019-03-22 16:51:38 +09:00
Akira TAGOH 98099ffc9f Ifdef'ed unnecessary code for Win32
Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/147
2019-03-22 07:47:33 +00:00
Akira TAGOH 8a9435958a autogen.sh: Make AUTORECONF_FLAGS overwritable 2019-03-22 07:40:24 +00:00
Akira TAGOH 9b0c093a6a Fix build issue on Win32.
Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/148
2019-03-19 18:47:57 +09:00
Akira TAGOH 3eca37c1e5 Fix misleading summary in docs for FcStrStrIgnoreCase
Reported by Jonathan Kew

Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/146
2019-03-15 18:53:08 +09:00
Akira TAGOH dba84600e1 Add system-ui generic family
The generic family of 'system-ui' name is being proposed in a draft of next CSS Fonts.
This would be nice to support in fontconfig too.

https://www.w3.org/TR/css-fonts-4/
2019-02-27 16:38:12 +09:00
Ben Wagner 40e27f5d98 Better document sysroot.
All non trivial users of FontConfig must use FcConfigGetSysRoot to
resolve file properties in patterns. In order to support sysroot the
filename in the file property must be relative to the sysroot, but the
value of the file property in a pattern is directly exposed, making it
impossible for FontConfig to resolve the filename itself transparently.
2019-02-19 00:40:32 +00:00
Robert Yang 586e35450e src/fccache.c: Fix define for HAVE_POSIX_FADVISE
Otherwise, there would be build errors in the following 2 cases:
* define HAVE_POSIX_FADVISE
Or:
* undef HAVE_POSIX_FADVISE

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
2019-01-25 03:48:26 +00:00
Akira TAGOH 699d6e4d84 Fix a crash with invalid matrix element
Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/140
2019-01-23 05:59:34 +00:00
Akira TAGOH b047e29954 Fix a dereference of a null pointer
When exiting from for loop by not satisfying the condition of `(s = next[i])` at FcCacheRemoveUnlocked()
referring s->alloated will be invalid.
2018-11-30 10:42:26 +00:00
Akira TAGOH 3a45b8ef65 covscan: fix compiler warnings 2018-11-30 07:41:16 +00:00
Akira TAGOH c44fda28e1 Don't call unlink_dirs if basedir is null 2018-11-30 07:41:16 +00:00
Akira TAGOH a57647e155 covscan fix: get rid of unnecessary condition check 2018-11-30 07:41:16 +00:00
Akira TAGOH 65c7427c01 Warn when constant name is used for unexpected object
This fixes the sort of weird things like `fc-match :size=rgb` done without any errors.
This might be annoyed but the error messages should helps to fix an application bug or
suggest more useful constant names to fontconfig.

Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/137
2018-11-30 07:04:22 +00:00
Akira TAGOH 71c9c7892a Add a test case for FcFontList 2018-11-27 09:39:15 +00:00
Akira TAGOH 9d5149ac41 Fix FcFontList doesn't return a font with FC_COLOR=true
"color" property has a value more than 1 because the value of FT_HAS_COLOR
is directly set to it. this seems breaking the behavior of FcFontList with FC_COLOR=true
because it is more than FcDontCare.

So changing comparison that way.
2018-11-27 09:39:15 +00:00
Chris McDonald 3c75a5a935 Lowered temporary rooted_dir variable inside loop 2018-11-26 11:46:21 -07:00
Chris McDonald d36f977c76 Respect sysroot option for file path passed to stat 2018-11-19 15:19:19 -07:00
Akira TAGOH 2bd559f75d Add doc for description element and update fonts.dtd
Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/133
2018-11-15 20:55:36 +09:00
Akira TAGOH 13b4ba9135 Use Rachana instead of Meera for Malayalam
Meera is a sans-serif font for Malayalam. that should be substituted for serif.
2018-11-13 06:34:11 +00:00
Akira TAGOH 648e0cf3d5 Use FC_PATH_MAX instead of PATH_MAX
Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/131
2018-11-06 16:33:03 +09:00
Akira TAGOH 6dde9b5be3 Enable bubblewrap test case 2018-11-06 15:44:40 +09:00
Akira TAGOH 9bb9010137 Drop Mitra Mono from 65-nonlatin.conf
This font seems totally broken.

Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/128
2018-10-29 12:25:03 +00:00
Behdad Esfahbod f7036d589b Fix name-table language code mapping for Mongolian 2018-10-25 07:31:44 +00:00
Akira TAGOH e9113a764a Do not run a test case for .uuid deletion 2018-10-25 07:16:32 +00:00
Keith Packard 5f12f564f8 Do not remove UUID file when a scanned directory is empty
Because FcDirCacheDeleteUUID does not reset the modification time on
the directory, and because FcDirCacheRead unconditionally creates the
UUID file each time it is run, any empty directory in the cache will
get its timestamp changed each time the cache for that directory is
read.

Instead, just leave the UUID file around as it is harmless.

The alternative would be to only create the UUID file after the cache
has been created and the directory has been discovered to be
non-empty, but that would delay the creation of the UUID file.

Signed-off-by: Keith Packard <keithp@keithp.com>
2018-10-25 16:02:55 +09:00
Akira TAGOH 5f5ec5676c Do not try updating mtime when unlink was failed 2018-10-05 02:32:09 +00:00
Akira TAGOH ff5b49be2b Do not update mtime when removing .uuid file
This avoids a situation triggers updating caches on a directory where .uuid file was removed.

Resolves: https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/107
2018-10-05 02:32:07 +00:00
Akira TAGOH 8badaae15b CI: Add more logs 2018-10-04 08:30:40 +00:00
Akira TAGOH 5771c48863 Fix test case 2018-10-04 08:20:45 +00:00
Akira TAGOH e4788c5a96 add missing the case of prefix="default" as documented 2018-10-04 08:07:09 +00:00
Akira TAGOH 942db25fbc Update docs for 1aa8b700 2018-10-04 08:07:07 +00:00
Akira TAGOH 67b4090321 Update fonts.dtd for last commit 2018-10-04 08:07:05 +00:00
Akira TAGOH 1aa8b700c3 Add more prefix support in <dir> element
Added two prefix modes:
  "relative" that makes the relative path be relative to current file
  "cwd" for relative to current working directory which implies current behavior.

Resolves: https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/15
2018-10-02 10:12:14 +00:00
Akira TAGOH f0aae4455e Fix CI 2018-09-28 09:17:37 +00:00
Akira TAGOH ba206df9b9 Add a test case for d1f48f11 2018-09-05 12:08:52 +00:00