tdf#108243: semicolon separated fonts substitution pb (Linux/fontconfig)

The pb was that a substitution for the nonexisting font was done and successful
without taking into account a explicitely font provided.
So before calling FindFontSubstitute, test nTokenPos to know if there's
a substitute font.

I started from https://bugs.documentfoundation.org/show_bug.cgi?id=108243#c13
but the root cause was found and a fix proposed by ChatGpt (GPT-5.6 Luna).

I tested the initial odt file provided in the bugtracker it worked.
I also did the same test without substitution font provided, it was ok too
since it was replaced by a Noto font.

Change-Id: I992d1ed5e4ebcf8795718001d17f8afda32e4735
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/210680
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
This commit is contained in:
Julien Nabet
2026-09-16 08:48:51 +02:00
parent dd2838cc25
commit 137f0c8cc6
+1 -1
View File
@@ -1139,7 +1139,7 @@ PhysicalFontFamily* PhysicalFontCollection::FindFontFamily(FontSelectPattern& rF
return pFoundData;
}
if (mpPreMatchHook && mpPreMatchHook->FindFontSubstitute(rFSD))
if (nTokenPos == -1 && mpPreMatchHook && mpPreMatchHook->FindFontSubstitute(rFSD))
{
rFSD.maSearchName = GetEnglishSearchFontName(rFSD.maSearchName);
}