vcl/unx/generic/fontmanager/fontconfig.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
New commits: commit 63910ad6e5471b282803d6a25bb2e2546d1ce562 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Tue Jul 9 17:01:07 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Wed Jul 10 11:05:55 2024 +0200 prefer higher version of "Noto Sans Arabic" of system vs bundled I have "Noto Sans Arabic" installed system wide: file: "/usr/share/fonts/google-noto-vf/NotoSansArabic[wght].ttf"(s) fontversion: 131858(i)(s) and there is the bundled version: file: "./instdir/share/fonts/truetype/NotoSansArabic.ttf"(w) fontversion: 131727(i)(w) what we generally want to do is pick just one font, the version with the higher number, but in this case we don't see them as near-duplicates and so add both of them. In my case then using any font/glyph fallback for a "en" font suggests "Noto Sans Arabic", presumably because the bundled one has those glyphs, but we seem to end up rendering with the system one which doesn't have them, so font/glyph fallback for fonts that are non explicitly configured somewhere in fontconfig end up with missing glyph symbol. So additionally disregard the FC_INDEX and FC_POSTSCRIPT_NAME fields when comparing fonts to find the higher version. https://bugzilla.redhat.com/show_bug.cgi?id=2262410 has a similar sounding problem but in the end I think it is a different issue, but maybe the same trigger of having "Noto Sans Arabic" at the start of the list of possibilities. Change-Id: I500fb9cad793b63d0fbeb8c4bc1246fd68be39fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170251 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Jenkins diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx index a189ab3f1161..2cf486a23582 100644 --- a/vcl/unx/generic/fontmanager/fontconfig.cxx +++ b/vcl/unx/generic/fontmanager/fontconfig.cxx @@ -272,7 +272,7 @@ namespace //See if this font is a duplicate with equal attributes which has already been //inserted, or if it an older version of an inserted fonts. Depends on FcFontSet - //on being sorted with SortFont + //being sorted with SortFont bool isPreviouslyDuplicateOrObsoleted(FcFontSet const *pFSet, int i) { const FcPattern *a = pFSet->fonts[i]; @@ -282,7 +282,9 @@ namespace FcPatternDel(pTestPatternA, FC_CHARSET); FcPatternDel(pTestPatternA, FC_CAPABILITY); FcPatternDel(pTestPatternA, FC_FONTVERSION); + FcPatternDel(pTestPatternA, FC_INDEX); FcPatternDel(pTestPatternA, FC_LANG); + FcPatternDel(pTestPatternA, FC_POSTSCRIPT_NAME); bool bIsDup(false); @@ -299,7 +301,9 @@ namespace FcPatternDel(pTestPatternB, FC_CHARSET); FcPatternDel(pTestPatternB, FC_CAPABILITY); FcPatternDel(pTestPatternB, FC_FONTVERSION); + FcPatternDel(pTestPatternB, FC_INDEX); FcPatternDel(pTestPatternB, FC_LANG); + FcPatternDel(pTestPatternB, FC_POSTSCRIPT_NAME); bIsDup = FcPatternEqual(pTestPatternA, pTestPatternB);