Commit Graph

2114 Commits

Author SHA1 Message Date
Akira TAGOH 806fd4c2c5 Fix the issue that '~' wasn't extracted to the proper homedir
'~' in the filename was extracted to the home directory name in FcConfigFilename() though,
this behavior was broken by d1f48f11. this change fixes it back to the correct behavior.

https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/110
2018-09-04 09:55:20 +00:00
Akira TAGOH 8208f99fa1 Fix the build issue with --enable-static
Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/109
2018-09-03 07:24:42 +00:00
Akira TAGOH 844d8709a1 Bump version to 2.13.1 2018-08-30 17:20:15 +09:00
Akira TAGOH e62b922318 Bump the libtool revision 2018-08-30 08:18:25 +00:00
Akira TAGOH a059ce315d Add .gitlab-ci.yml 2018-08-29 10:13:13 +00:00
Akira TAGOH a887659706 Fix distcheck fail 2018-08-29 10:01:45 +00:00
Akira TAGOH 0ce32973c8 Update the issue tracker URL 2018-08-28 19:22:11 +09:00
Akira TAGOH ddeec818cc Fix missing closing bracket in FcStrIsAbsoluteFilename()
Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/96
2018-08-21 03:08:58 +00:00
Akira TAGOH a1efb5ea8c Fix the build issue with gperf
GPerf seems not allowing the empty lines though, current recipes are supposed to drop them.
but seems not working on some env.
So taking the proper way to do that instead of incompatible things against platforms.
2018-08-01 08:10:35 +00:00
Tom Anderson 1451f829e7 Fix build with CFLAGS="-std=c11 -D_GNU_SOURCE" 2018-07-26 02:57:07 +00:00
Akira TAGOH 9f1b92f27f Fix memory leak 2018-07-25 13:41:47 +09:00
Akira TAGOH 5b277806df Drop the redundant code
"value == FcTypeInteger" won't be true because it was converted to FcTypeDouble earlier
2018-07-25 12:44:38 +09:00
Akira TAGOH a1ad5fe2ba Allocate sufficient memory to terminate with null 2018-07-25 12:40:17 +09:00
Akira TAGOH 5ea2ab6a38 Make a call fail on ENOMEM 2018-07-25 12:39:53 +09:00
Akira TAGOH 38569f2f2e Fix allocating insufficient memory for terminating null of the string 2018-07-19 08:31:59 +00:00
Akira TAGOH b1762935c3 Fix possibly dereferencing a null pointer 2018-07-19 08:31:14 +00:00
Akira TAGOH 8e97d745cc Fix a typo 2018-07-19 08:21:33 +00:00
Akira TAGOH efac784b01 Fix dereferencing null pointer 2018-07-19 07:55:40 +00:00
Akira TAGOH 1ac2218467 do not pass null pointer to memcpy 2018-07-19 07:50:20 +00:00
Akira TAGOH f3981a8bcd Fix access in a null pointer dereference 2018-07-19 16:44:03 +09:00
Akira TAGOH 586ac3b6c0 Fix array access in a null pointer dereference
FcFontSetFont() accesses fs->fonts in that macro though, there was no error checks
if it is null or not.
As a result, there was a code path that it could be a null.
Even though this is unlikely to see in usual use, it might be intentionally created
in a cache.

So if fs->fonts is a null, we should consider a cache is invalid.
2018-07-19 07:09:39 +00:00
Akira TAGOH 51afd09d62 Fix unterminated string issue 2018-07-19 05:51:02 +00:00
Akira TAGOH 37c9c16dad Fix memory leak 2018-07-19 04:29:01 +00:00
Akira TAGOH 433718fb77 Fix memory leak 2018-07-19 04:17:21 +00:00
Akira TAGOH eafa931ff9 Fix memory leak 2018-07-19 03:15:01 +00:00
Akira TAGOH 12be797387 Fix memory leaks 2018-07-19 03:14:58 +00:00
Akira TAGOH 4b1276e240 Fix memory leak 2018-07-19 03:14:54 +00:00
Akira TAGOH e9d3177557 Fix the leak of file handle 2018-07-19 11:32:50 +09:00
Tom Anderson d1f48f11d5 Return canonicalized paths from FcConfigRealFilename
FcConfigRealFilename() follows symlinks, but the link may be relative to the
directory containing the link.  For example, on my system, I have this file:

/etc/fonts/conf.d/99-language-selector-zh.conf ->
    ../conf.avail/99-language-selector-zh.conf

Since /etc/fonts/conf.d is probably not in PATH, open()ing the file would fail.
This change makes FcConfigRealFilename() return the canonicalized filename
instead.  So for the example above, it would return:

/etc/fonts/conf.avail/99-language-selector-zh.conf

This was causing bad font rendering in Chromium [1] after the regression I
introduced in 7ad010e80b.

[1] https://bugs.chromium.org/p/chromium/issues/detail?id=857511
2018-07-16 18:00:35 +02:00
Behdad Esfahbod 48e9e5f4f0 Use FT_HAS_COLOR 2018-07-16 17:59:54 +02:00
Matthieu Herrb 5a46d572c0 FcCacheFindByStat(): fix checking of nanoseconds field. 2018-07-10 12:27:16 +09:00
Tom Anderson 6cc99d6a82 Fix heap use-after-free 2018-06-13 17:05:54 +09:00
Akira TAGOH f5dd8512bd Remove .uuid when no font files exists on a directory
https://bugs.freedesktop.org/show_bug.cgi?id=106632
2018-06-11 17:03:46 +09:00
Tom Anderson 096e8019be Fix CFI builds
CFI [1] is a dynamic analysis tool that checks types at runtime.  It reports an
error when using a function with signature eg. (void (*)(char*)) as
(void (*)(void*)).  This change adds some wrapper functions to avoid this issue.
In optimized builds, the functions should get optimized away.

[1] https://clang.llvm.org/docs/ControlFlowIntegrity.html
2018-06-11 16:02:57 +09:00
Akira TAGOH d1771cfbd1 Update CaseFolding.txt to Unicode 11 2018-06-08 21:16:15 +09:00
Akira TAGOH 3fa8381336 Add a test case for bz#106618 2018-05-25 15:24:44 +09:00
Akira TAGOH 14c23a5715 Fix double-free 2018-05-25 15:20:10 +09:00
Alexander Larsson 3ea70f9368 Cache: Remove alias_table
There is really no need for this anymore

https://bugs.freedesktop.org/show_bug.cgi?id=106618
2018-05-25 14:43:06 +09:00
Alexander Larsson c42402d0b8 Cache: Rewrite relocated paths in earlier
This changes the rewriting of the FC_FILE values for relocated caches to an earlier stage
while reading the cache. This is better, because it means all APIs will report the
rewritten paths, not just the once that use the list apis.

We do this by detecting the relocated case and duplicating the FcPattern and FcPatternElm
in an cache allocation (which will die with the cache) and then reusing the FcValueLists
from the cache.

This means that in the rewritten case we will use some more memory, but not the full
size of the cache. In a test here I had 800k of relocated caches, but ~200k of wasted
on duplicating the objects.

This should fix https://bugs.freedesktop.org/show_bug.cgi?id=106618
2018-05-25 14:42:52 +09:00
Alexander Larsson a63b9c622e Add FcCacheAllocate() helper
This lets you allocate a chunk of memory that will be freed when the cache
is freed.

https://bugs.freedesktop.org/show_bug.cgi?id=106618
2018-05-25 14:42:05 +09:00
Akira TAGOH 94080c3d48 Fix -Wstringop-truncation warning 2018-05-25 14:02:58 +09:00
Akira TAGOH 684c3ce685 Fix leaks 2018-05-25 13:51:10 +09:00
Chris Lamb f098adac54 Ensure cache checksums are deterministic
Whilst working on the Reproducible Builds[0] effort, we noticed that
fontconfig generates unreproducible cache files.

This is due to fc-cache uses the modification timestamps of each
directory in the "checksum" and "checksum_nano" members of the _FcCache
struct. This is so that it can identify which cache files are valid
and/or require regeneration.

This patch changes the behaviour of the checksum calculations to prefer
the value of the SOURCE_DATE_EPOCH[1] environment variable over the
directory's own mtime. This variable can then be exported by build
systems to ensure reproducible output.

If SOURCE_DATE_EPOCH is not set or is newer than the mtime of the
directory, the existing behaviour is unchanged.

This work was sponsored by Tails[2].

 [0] https://reproducible-builds.org/
 [1] https://reproducible-builds.org/specs/source-date-epoch/
 [2] https://tails.boum.org/
2018-05-16 16:06:46 +09:00
Akira TAGOH 0b85e77ede Bug 106459 - fc-cache doesn't use -y option for .uuid files
https://bugs.freedesktop.org/show_bug.cgi?id=106459
2018-05-13 16:21:58 +09:00
Akira TAGOH cfb21c7d85 Bug 106497 - better error description when problem reading font configuration
https://bugs.freedesktop.org/show_bug.cgi?id=106497
2018-05-13 14:48:10 +09:00
Akira TAGOH af964f7897 Add a test case for 90-synthetic.conf 2018-05-11 22:15:39 +09:00
Akira TAGOH f665852df9 Add a testrunner for conf 2018-05-11 21:54:24 +09:00
Akira TAGOH 307639cff1 Bug 43367 - RFE: iterator to peek objects in FcPattern
Add various APIs to obtain things in FcPattern through the iterator

https://bugs.freedesktop.org/show_bug.cgi?id=43367
2018-05-11 20:48:30 +09:00
Akira TAGOH 454923709a Change the emboldening logic again
enable emboldening when request was >= bold and font was <= medium

https://bugs.freedesktop.org/show_bug.cgi?id=106460
2018-05-11 12:14:26 +09:00
Tom Anderson 730deada8c Add FONTCONFIG_SYSROOT environment variable 2018-05-05 17:57:21 +09:00