vcl/unx/generic/fontmanager/fontconfig.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 51a3d6e02cdd0aab086932e8c532b0fdb502ca7a
Author:     Tor Lillqvist <[email protected]>
AuthorDate: Mon Dec 8 15:47:00 2025 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Mon Dec 8 16:09:54 2025 +0100

    Skip private system fonts found by fontcofig on macOS
    
    They have family names starting with a period. They are not intended
    to be used by apps, and not normally visible in apps that use just
    Apple APIs. So we should not use them even if they are found by
    fontconfig. (Letting them be found leads to an assertion failure in
    boost, even. Did not investigate further.)
    
    See for instance
    
https://eclecticlight.co/2015/11/10/qa-how-to-use-san-francisco-font-in-docs/
    , from which I quote:
    
    πŸ‘‰ This is accomplished by prefacing its name and ID with a period
    (.), so that its TrueType Unique ID record, for example, describes it
    as β€œ.SF NS Text”, and it is explicitly identified as a System Font.
    This ensures that it is omitted from font selection menus and
    dialogs. πŸ‘ˆ
    
    Change-Id: I4efea606331c5c37a321b30e908a0c8c789816e1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195231
    Reviewed-by: Andras Timar <[email protected]>
    Tested-by: Andras Timar <[email protected]>

diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx 
b/vcl/unx/generic/fontmanager/fontconfig.cxx
index 642a1a7ef733..bf2a0da22370 100644
--- a/vcl/unx/generic/fontmanager/fontconfig.cxx
+++ b/vcl/unx/generic/fontmanager/fontconfig.cxx
@@ -660,6 +660,12 @@ void PrintFontManager::countFontconfigFonts()
             if( eFileRes != FcResultMatch || eFamilyRes != FcResultMatch || 
eScalableRes != FcResultMatch || eStyleRes != FcResultMatch )
                 continue;
 
+#ifdef MACOSX
+            // Skip system fonts not intended for app use
+            if (family && family[0] == '.')
+                continue;
+#endif
+
             SAL_INFO(
                 "vcl.fonts.detail",
                 "found font \"" << family << "\" in file " << file << ", 
weight = "

Reply via email to