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

New commits:
commit 3d16a6e9d32ff98929b79446cb5e5f3471ea2481
Author:     Tor Lillqvist <[email protected]>
AuthorDate: Mon Dec 8 15:47:00 2025 +0100
Commit:     Tor Lillqvist <[email protected]>
CommitDate: Sat Jan 17 20:59:03 2026 +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/+/195230
    Tested-by: Andras Timar <[email protected]>
    Reviewed-by: Andras Timar <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197506
    Tested-by: Jenkins
    Reviewed-by: Tor Lillqvist <[email protected]>

diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx 
b/vcl/unx/generic/fontmanager/fontconfig.cxx
index f7c63cbb55b9..b33675cd7b2a 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