https://bugs.documentfoundation.org/show_bug.cgi?id=91400

خالد حسني <kha...@aliftype.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|kha...@aliftype.com         |

--- Comment #10 from خالد حسني <kha...@aliftype.com> ---
I gave this a try again and I couldn’t find a clean way to handle this.

Here is my attempt:

diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 7985905cc404..55a756c1d179 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -541,6 +541,25 @@ bool SystemFontList::Init()
     const CFRange aFullRange = CFRangeMake( 0, nFontCount );
     CFArrayApplyFunction( mpCTFontArray, aFullRange, fontEnumCallBack, this );

+    {
+        CTFontRef pFont = CTFontCreateUIFontForLanguage(kCTFontUIFontSystem,
0, nullptr);
+        CTFontDescriptorRef pDesc = CTFontCopyFontDescriptor(pFont);
+        FontAttributes rAttr = DevFontFromCTFontDescriptor(pDesc, nullptr);
+        rAttr.SetFamilyName(".AppleSystemUIFont");
+        rtl::Reference<CoreTextFontFace> pFontData = new
CoreTextFontFace(rAttr, reinterpret_cast<sal_IntPtr>(pDesc));
+        AddFont(pFontData.get());
+        CFRelease(pDesc);
+    }
+    {
+        CTFontRef pFont =
CTFontCreateUIFontForLanguage(kCTFontUIFontEmphasizedSystem, 0, nullptr);
+        CTFontDescriptorRef pDesc = CTFontCopyFontDescriptor(pFont);
+        FontAttributes rAttr = DevFontFromCTFontDescriptor(pDesc, nullptr);
+        rAttr.SetFamilyName(".AppleSystemUIFont");
+        rtl::Reference<CoreTextFontFace> pFontData = new
CoreTextFontFace(rAttr, reinterpret_cast<sal_IntPtr>(pDesc));
+        AddFont(pFontData.get());
+        CFRelease(pDesc);
+    }
+
     return true;
 }

This allow loading a .AppleSystemUIFont (which is the name returned by [NSFont
systemFontOfSize: 0]), but it will be also available in the font menu which we
don’t. The spacing is also worse than the existing font (it seems to suffer
more from VCL lack of subpixel positioning than the current font).

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to