--- src/ports/SkScalerContext_mac_ct.cpp.orig 2026-04-26 18:39:49.904132776 +0000 +++ src/ports/SkScalerContext_mac_ct.cpp 2026-04-26 18:40:08.983626802 +0000 @@ -19,6 +19,12 @@ #include #endif +// kCTFontOrientationHorizontal was introduced in macOS 10.8 +// Use kCTFontDefaultOrientation (value 0) for older systems +#ifndef kCTFontOrientationHorizontal +#define kCTFontOrientationHorizontal kCTFontDefaultOrientation +#endif + #include "include/core/SkColor.h" #include "include/core/SkFontMetrics.h" #include "include/core/SkFontTypes.h" @@ -287,7 +293,15 @@ // So always make the font transform identity and place the transform on the context. point = CGPointApplyAffineTransform(point, context.fInvTransform); +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 + // For macOS 10.6: use CGContextShowGlyphsAtPositions instead of CTFontDrawGlyphs + // CTFontDrawGlyphs was introduced in macOS 10.7 + CGContextSetFont(fCG.get(), context.fCGFont.get()); + CGContextSetFontSize(fCG.get(), CTFontGetSize(context.fCTFont.get())); + CGContextShowGlyphsAtPositions(fCG.get(), &glyphID, &point, 1); +#else CTFontDrawGlyphs(context.fCTFont.get(), &glyphID, &point, 1, fCG.get()); +#endif SkASSERT(rowBytesPtr); *rowBytesPtr = rowBytes;