summaryrefslogtreecommitdiff
path: root/vcl/quartz/salgdi.cxx
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2019-04-20 21:50:37 +0900
committerAndras Timar <andras.timar@collabora.com>2019-04-30 16:03:23 +0200
commitc17588930688b01253434a3d8acb4b9c0c58adf7 (patch)
tree49dc6db6fd783071ba233e6a20829598f5a4f687 /vcl/quartz/salgdi.cxx
parente20c57976583cb2721dd91949d8ff0e8db446351 (diff)
tdf#101854 Move to CommonSalLayout removed faux bold in macos
Previously faux bold was drawn with setting a dictionary key kCTStrokeWidthAttributeName and a value of the stroke width. This stopped working because we don't use attributedString for drawing anymore but we always use CTFontDrawGlyphs and draw the glyphs, which doesn't have a way to set this attributes. It took me a while to find a workaround (thanks to Apple's great documentation), where we switch text drawing to fill and stroke, and after that we can modify the stroke by changing the line width. Change-Id: I594fcb9c796a9c04ea8234a9938ca2f719706199 Reviewed-on: https://gerrit.libreoffice.org/71012 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit eb5606511fac2a8ee1af7cc03c12d6c5b16f7c96) Reviewed-on: https://gerrit.libreoffice.org/71061 Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'vcl/quartz/salgdi.cxx')
-rw-r--r--vcl/quartz/salgdi.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index d64fc8677ce7..33ca4573e382 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -460,6 +460,15 @@ void AquaSalGraphics::DrawTextLayout(const GenericSalLayout& rLayout)
SAL_INFO("vcl.cg", "CGContextSetFillColor(" << mrContext << "," << maTextColor << ")");
CGContextSetFillColor(mrContext, maTextColor.AsArray());
+ if (rStyle.mbFauxBold)
+ {
+
+ float fSize = rFontSelect.mnHeight / 23.0f;
+ CGContextSetStrokeColor(mrContext, maTextColor.AsArray());
+ CGContextSetLineWidth(mrContext, fSize);
+ CGContextSetTextDrawingMode(mrContext, kCGTextFillStroke);
+ }
+
auto aIt = aGlyphOrientation.cbegin();
while (aIt != aGlyphOrientation.cend())
{