| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
|
|
|
|
|
|
| |
This makes sure that fullname can be constructed at least even if a style is missing
and "Regular" is omitted for fullname so this change won't affect in that case.
Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/259
|
| |
|
|
|
|
| |
So user's changes in family and style will be reflected into fullname.
|
|
|
|
|
|
|
|
|
|
| |
OpenType spec says that the Regular descriptor would generally be
omitted from fullname. but some fonts doesn't follow on it.
So decided to construct a fullname from family and style instead of
relying on the meta data in a font.
Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/208
|
|
|
|
|
|
| |
and fix scanning to get things work with sysroot
Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/225
|
| |
|
|
|
|
|
|
| |
COPYING is missing non-expat license terms for some files and some files is also missing license terms. This is changes to makes it clearer and update.
Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/219
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We were using the family names from the pattern without
copying, and this was leading to a valgrind warning:
==53167== Invalid read of size 1
==53167== at 0x58B0238: FcStrCaseWalkerNextNonBlank (fcstr.c:198)
==53167== by 0x58B0238: FcStrCaseWalkerNextNonBlank (fcstr.c:186)
==53167== by 0x58B02C7: FcStrCmpIgnoreBlanksAndCase (fcstr.c:281)
==53167== by 0x58A4D44: FcHashTableFind (fchash.c:109)
==53167== by 0x5895E76: FamilyTableAdd (fccfg.c:1634)
==53167== by 0x589646A: FcConfigAdd.isra.0 (fccfg.c:1823)
==53167== by 0x58988CF: IA__FcConfigSubstituteWithPat.part.0 (fccfg.c:2228)
==53167== by 0x55F4F1A: pango_cairo_fc_font_map_fontset_key_substitute (pangocairo-fcfontmap.c:106)
==53167== by 0x5B88AF6: pango_fc_default_substitute (pangofc-fontmap.c:1795)
==53167== by 0x5B88D15: pango_fc_font_map_get_patterns (pangofc-fontmap.c:1850)
==53167== by 0x5B88FC7: pango_fc_font_map_load_fontset (pangofc-fontmap.c:1952)
==53167== by 0x5623627: pango_font_map_load_fontset (pango-fontmap.c:161)
==53167== by 0x5621743: pango_context_get_metrics (pango-context.c:1782)
==53167== Address 0x150d3450 is 0 bytes inside a block of size 10 free'd
==53167== at 0x483B9F5: free (vg_replace_malloc.c:538)
==53167== by 0x58ABE70: FcValueListDestroy (fcpat.c:147)
==53167== by 0x5898A08: IA__FcConfigSubstituteWithPat.part.0 (fccfg.c:2203)
==53167== by 0x55F4F1A: pango_cairo_fc_font_map_fontset_key_substitute (pangocairo-fcfontmap.c:106)
==53167== by 0x5B88AF6: pango_fc_default_substitute (pangofc-fontmap.c:1795)
==53167== by 0x5B88D15: pango_fc_font_map_get_patterns (pangofc-fontmap.c:1850)
==53167== by 0x5B88FC7: pango_fc_font_map_load_fontset (pangofc-fontmap.c:1952)
==53167== by 0x5623627: pango_font_map_load_fontset (pango-fontmap.c:161)
==53167== by 0x5621743: pango_context_get_metrics (pango-context.c:1782)
Use copies of the strings as keys in the hash table to avoid this.
|
|
|
|
|
|
|
| |
__builtin_expect returns the same type as the expression,
so enforce that we pass in a boolean expression.
Pointed out by Emmanuele Bassi.
|
|
|
|
| |
Pointed out by Akira Tagoh.
|
| |
|
|
|
|
| |
These wrap __builtin_expect where it exists.
|
|
|
|
| |
Pointed out by Akira Tagoh.
|
|
|
|
|
|
| |
utf8 is extremely rare in the strings we see in
font configuration, so this seems to be a good
case for __builtin_expect.
|
|
|
|
|
|
| |
Use the same approach we used for FcFontMatch, and
keep a hash table of family names. We only speed
up the no-match case, for now.
|
|
|
|
| |
Avoid FcCanonicalize here too.
|
|
|
|
|
| |
Avoid FcValueCanonicalize when we can, to avoid
unnecessary copying of FcValue structs.
|
|
|
|
|
|
|
|
|
|
| |
Make FcConfigPromote use a switch instead of
an if-else cascade, and avoid calling it when
we can.
Note that we need to add a case for integers
in FcConfigCompareValue, since we are no longer
promoting integers to doubles unconditionally.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When we don't need to differentiate between weak and strong,
we can exit the loop in FcCompareValueList once we found a
best match.
This change helps reducing the amount of list walking we do
for fonthashint, where careless config files end up creating
lists with ~100 booleans :( We don't want to walk all those
to the end, over and over again.
We are already special-casing family, and the only other case
where weak != strong, PostScript names, doesn't have long lists
of values, so the limitation to weak == strong doesn't matter
much in practice.
|
|
|
|
|
|
|
|
|
| |
When checking whether a test matches a pattern,
we cut the loop short for FcQualAll when we see
the first non-matching value, but for FcQualAny
we were always walking the full list. This patch
cuts the loop short for FcQualAny when we see the
first matching value.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With the way typical font configurations look, matching the lists
of families is the bottleneck for both FcFontMatch and FcFontSort.
After installing the Noto fonts on my system, an innocent match
pattern like "Cantarell 14" turns into a monster with a list of
300 family names after calling FcConfigSubstitute().
With this setup, every FcFontSort call takes 80-100 ms, which is
entirely incompatible with using FcFontSort for anything interactive.
And many font choosers render every font in itself, causing on average
one FcFontSort call per font.
On my system, it takes more than 20 seconds to open the GTK font
chooser dialog, with frequent stalls when scrolling.
This patch special-cases font families and replaces the list
walking for comparison with a hash table lookup. With this
patch, the FcFontSort time goes to ~10ms per call. Which is
still not good enough for calling it dozens of times when
scrolling, but a significant improvement.
|
|
|
|
|
|
|
| |
Add a hash function that behaves like family
comparison: ignoring case and blanks. This
will be used to replace the list walking for
finding family matches with a hash table.
|
|
|
|
|
|
|
|
|
| |
Make variants of FcStrCaseWalkerNext for the two
common cases, delim == NULL and delim == " ", to
speed things up.
These are inner loops, and having the conditions
as simple as possible helps.
|
|
|
|
|
|
|
| |
When a cached pattern contains a range,
FcPatternHash will crash.
Fixes #254.
|
|
|
|
|
| |
As far as I can tell, fontconfig can recover from encountering an unknown attribute.
And unknown elements already print a warning instead of an error, so let's make this a warning too.
|
|
|
|
| |
Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/248
|
|
|
|
| |
See https://mesonbuild.com
|
|
|
|
| |
Might not be available on Windows.
|
|
|
|
| |
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
|
|
|
|
| |
Use the default $HOME/.cache one for empty XDG_CACHE_HOME.
Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/243
|
|
|
|
| |
FreeType is trying to hide FT_UNUSED, so use FC_UNUSED instead.
|
|
|
|
| |
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/access-waccess?view=vs-2019
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
"fontversion" used to be modified to sort out fonts as a technique.
But that lost the original purpose to do the version control between
releases.
This change adds the dedicated property into the cache.
Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/226
|
|
|
|
|
|
|
|
|
|
|
|
| |
mtime isn't reliable to detect updates of fonts on OSTree based system
since they reset mtime to 0 for system files.
Due to this, there are the situation likely to happen where mtime is
newer but content is older.
Fortunately, OSTree based system requires reboot to deploy changes. so
we can assume we won't see any changes on system fonts. so system caches
are always up-to-date. we can ignore meta data for system fonts in
user caches.
|
|
|
|
|
|
| |
To avoid risk of double-free.
Fixes #237.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous fix in fbc05949ef52c8a8d69233eed77f6636dffec280 was wrong. reverting.
When reading older caches, FcDirCacheMapHelper() returns FcFalse and
it became the return value from FcDirCacheProcess() too, which is wrong.
Actually one of calls for FcDirCacheMapHelper() should be successfully
finished and closure should have a valid pointer for cache.
Due to this, the proper finalization process wasn't running against
cache in closure.
Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/227
|
|
|
|
|
|
| |
iPhone 2.1 was released a long time ago, and the macro for checking
the target iOS SDK version has changed. We can simplify everything and
do a very basic check.
|
|
|
|
| |
This is a regression since 48e9e5f4
|
|
|
|
|
|
|
|
| |
Due to the unproper initialization of `latest_mtime', the duplicate caches
was still in fcCacheChains with no references. which means no one frees
them. thus, the memory leak was happened.
Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/227
|
| |
|
|
|
|
| |
Don't address the real filename when a named pipe is given in FONTCONFIG_FILE.
|
|
|
|
|
|
| |
Try to build a fullname from a family and a style name for a named-instance.
Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/185
|
|
|
|
|
|
|
| |
FC_FULLNAME is affected by variables and could be different
against it. FC_FULLNAME should be dropped from meta face.
Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/185
|
| |
|
|
|
|
|
|
| |
This may improves to be MT-safe.
Reported at https://bugs.chromium.org/p/chromium/issues/detail?id=1004254
|
| |
|