diff --git a/desktop/Executable_soffice_bin.mk b/desktop/Executable_soffice_bin.mk index 5c895ed0e7cb..b238a64c7efc 100644 --- a/desktop/Executable_soffice_bin.mk +++ b/desktop/Executable_soffice_bin.mk @@ -31,7 +31,7 @@ ifeq ($(OS),MACOSX) # -_version_min flag", clang/test/Driver/darwin-ld-platform-version-macos.c in particular, # for the -platform_version that Clang passes by default to new-enough ld): $(eval $(call gb_Executable_add_ldflags,soffice_bin, \ - -Xlinker -platform_version -Xlinker macos -Xlinker $(MACOSX_DEPLOYMENT_TARGET) -Xlinker 0.0.0 \ + -Xlinker -platform_version -Xlinker macos -Xlinker $(MACOSX_DEPLOYMENT_TARGET) -Xlinker 10.14.0 \ )) endif diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx index 83aebe2abc82..60476168086a 100644 --- a/vcl/quartz/salgdi.cxx +++ b/vcl/quartz/salgdi.cxx @@ -368,6 +368,12 @@ bool AquaSalGraphics::AddTempDevFont( PhysicalFontCollection*, return ::AddTempDevFont(rFontFileURL); } +extern "C" +{ + void CGContextSetFontSmoothingStyle(CGContextRef context, int style); + void CGContextSetFontSmoothingContrast(CGContextRef, CGFloat); +} + void AquaSalGraphics::DrawTextLayout(const GenericSalLayout& rLayout) { #ifdef IOS @@ -449,7 +455,60 @@ void AquaSalGraphics::DrawTextLayout(const GenericSalLayout& rLayout) // The view is vertically flipped (no idea why), flip it back. CGContextScaleCTM(maContextHolder.get(), 1.0, -1.0); - CGContextSetShouldAntialias(maContextHolder.get(), !mbNonAntialiasedText); + + // [[this->mpFrame->mpNSView layer] setContentsScale:1]; + if (getenv("RASTERIZE")) + [[this->mpFrame->mpNSView layer] setShouldRasterize:YES]; + + if (getenv("SCALE")) { + double scale = std::strtod(getenv("SCALE"), nullptr); + [[this->mpFrame->mpNSView layer] setRasterizationScale:scale]; + } + + if (getenv("DONTTOUCH")) { + CGContextSetShouldAntialias(maContextHolder.get(), !mbNonAntialiasedText); + } else { + static bool allowaa = getenv("ALLOWAA"); + CGContextSetAllowsAntialiasing(maContextHolder.get(), allowaa); + + static bool shouldaa = getenv("SHOULDAA"); + CGContextSetShouldAntialias(maContextHolder.get(), shouldaa); + + static bool allowsmooth = getenv("ALLOWSMOOTH"); + CGContextSetAllowsFontSmoothing(maContextHolder.get(), allowsmooth); + + static bool shouldsmooth = getenv("SHOULDSMOOTH"); + CGContextSetShouldSmoothFonts(maContextHolder.get(), shouldsmooth); + + if (getenv("SMOOTH")) { + int smooth = atoi(getenv("SMOOTH")); + if (smooth <= 0 || smooth > 4) + ; + else + CGContextSetFontSmoothingStyle(maContextHolder.get(), smooth<<4); + } + + if (getenv("CONTRAST")) { + double contrast = std::strtod(getenv("CONTRAST"), nullptr); + if (contrast < 0 || contrast > 100) + ; + else + CGContextSetFontSmoothingContrast(maContextHolder.get(), contrast); + } + + static bool allowsubpixelpos = getenv("ALLOWSUBPIXELPOS"); + CGContextSetAllowsFontSubpixelPositioning(maContextHolder.get(), allowsubpixelpos); + + static bool shouldsubpixelpos = getenv("SHOULDSUBPIXELPOS"); + CGContextSetShouldSubpixelPositionFonts(maContextHolder.get(), shouldsubpixelpos); + + static bool allowsubpixelquant = getenv("ALLOWSUBPIXELQUANT"); + CGContextSetAllowsFontSubpixelQuantization(maContextHolder.get(), allowsubpixelquant); + + static bool shouldsubpixelquant = getenv("SHOULDSUBPIXELQUANT"); + CGContextSetShouldSubpixelQuantizeFonts(maContextHolder.get(), shouldsubpixelquant); + } + CGContextSetFillColor(maContextHolder.get(), maTextColor.AsArray()); if (rStyle.mbFauxBold)