Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 80b75bc

Browse files
committed
Bug 1690235 - Don't use a font descriptor for variation fonts on systems before macOS 10.15. r=lsalzman, a=pascalc
Differential Revision: https://phabricator.services.mozilla.com/D103916
1 parent 0a9f78a commit 80b75bc

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

gfx/2d/ScaledFontMac.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#ifdef MOZ_WIDGET_UIKIT
1919
# include <CoreFoundation/CoreFoundation.h>
2020
#endif
21+
#include "gfxPlatform.h" // just for HasVariationFontSupport()
2122
#include "nsCocoaFeatures.h"
2223
#include "mozilla/gfx/Logging.h"
2324

@@ -374,6 +375,17 @@ bool UnscaledFontMac::GetFontDescriptor(FontDescriptorOutput aCb,
374375
return false;
375376
}
376377

378+
// Bug 1690235: using a font descriptor may fail for variation fonts
379+
// on systems prior to 10.15, so we return false in this case.
380+
if (gfxPlatform::GetPlatform()->HasVariationFontSupport() &&
381+
!nsCocoaFeatures::OnCatalinaOrLater()) {
382+
CFDataRef data = CGFontCopyTableForTag(mFont, 0x66766172); // 'fvar'
383+
if (data) {
384+
CFRelease(data);
385+
return false;
386+
}
387+
}
388+
377389
AutoRelease<CFStringRef> psname(CGFontCopyPostScriptName(mFont));
378390
if (!psname) {
379391
return false;

0 commit comments

Comments
 (0)