vcl/unx/generic/fontmanager/fontmanager.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 36de29fe80bfc451d026b986c331afe7ae1129be
Author:     Andras Timar <andras.ti...@collabora.com>
AuthorDate: Mon Apr 28 08:58:22 2025 +0200
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Tue Apr 29 22:34:06 2025 +0200

    prefer the last fontFamily name, like fontconfig
    
    There was a report that font names of the "Helvetica Neue LT Pro"
    font family were different, when the fonts were added to the system,
    and when the fonts were added via AddTempDevFont() (remote font config
    in COOL).
    E.g. the font names were expected to be
    - HelveticaNeueLT Pro 45 Lt
    - HelveticaNeueLT Pro 65 Md
    - etc.
    Instead, we always got "Helvetica Neue LT Pro" which did not match, and
    we had a single font name for multiple fonts.
    In these fonts, in the name table there are two platform specific tables,
    macintosh and windows. The fontFamily values are different in these
    tables. In vcl/unx/generic/fontmanager/fontconfig.cxx we reverse the
    order of names. In the case of these fonts the windows table is used.
    With this patch we do the same for the AddTempDevFont() route.
    
    Change-Id: Iaceaabb406dbe63bc76f1066169268de6364b8e6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184698
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx 
b/vcl/unx/generic/fontmanager/fontmanager.cxx
index 7661d3ace605..2e454aa13d08 100644
--- a/vcl/unx/generic/fontmanager/fontmanager.cxx
+++ b/vcl/unx/generic/fontmanager/fontmanager.cxx
@@ -446,7 +446,7 @@ OUString analyzeSfntFamilyName(void const * pTTFont)
                     nMatch = 1000;
             }
             OUString aName = convertSfntName( aNameRecords[i] );
-            if (!(aName.isEmpty()) && nMatch > nLastMatch)
+            if (!(aName.isEmpty()) && nMatch >= nLastMatch)
             {
                 nLastMatch = nMatch;
                 aFamily = aName;

Reply via email to