diff options
author | Khaled Hosny <khaled@aliftype.com> | 2022-11-20 17:45:51 +0200 |
---|---|---|
committer | خالد حسني <khaled@aliftype.com> | 2022-11-20 22:17:22 +0100 |
commit | d4005521e4fe4379381605b63af1950c5aecd798 (patch) | |
tree | 771daec8bd28ca4b0a23133822643dc15edfc431 /vcl/quartz | |
parent | f88e7632b745a9b18af36cd901399c40e8b7378f (diff) |
vcl: add NeedsArtificialBold/Italic() to LogicalFontInstance
Change-Id: Ie8bab5d7653a22d0f56b4c859fb2260d96e655c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142998
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@aliftype.com>
Diffstat (limited to 'vcl/quartz')
-rw-r--r-- | vcl/quartz/ctfonts.cxx | 17 | ||||
-rw-r--r-- | vcl/quartz/salgdi.cxx | 2 |
2 files changed, 3 insertions, 16 deletions
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx index 1f7be532db31..89460c3943a1 100644 --- a/vcl/quartz/ctfonts.cxx +++ b/vcl/quartz/ctfonts.cxx @@ -45,7 +45,6 @@ CoreTextFont::CoreTextFont(const CoreTextFontFace& rPFF, const vcl::font::FontSe : LogicalFontInstance(rPFF, rFSP) , mfFontStretch( 1.0 ) , mfFontRotation( 0.0 ) - , mbFauxBold(false) , mpCTFont(nullptr) { double fScaledFontHeight = rFSP.mfExactHeight; @@ -63,21 +62,9 @@ CoreTextFont::CoreTextFont(const CoreTextFontFace& rPFF, const vcl::font::FontSe aMatrix = CGAffineTransformConcat(aMatrix, CGAffineTransformMakeScale(mfFontStretch, 1.0F)); } - // fake bold - if ( (rFSP.GetWeight() >= WEIGHT_BOLD) && - ((rPFF.GetWeight() < WEIGHT_SEMIBOLD) && - (rPFF.GetWeight() != WEIGHT_DONTKNOW)) ) - { - mbFauxBold = true; - } - - // fake italic - if (((rFSP.GetItalic() == ITALIC_NORMAL) || - (rFSP.GetItalic() == ITALIC_OBLIQUE)) && - (rPFF.GetItalic() == ITALIC_NONE)) - { + // artificial italic + if (NeedsArtificialItalic()) aMatrix = CGAffineTransformConcat(aMatrix, CGAffineTransformMake(1, 0, ARTIFICIAL_ITALIC_SKEW, 1, 0, 0)); - } CTFontDescriptorRef pFontDesc = rPFF.GetFontDescriptorRef(); mpCTFont = CTFontCreateWithFontDescriptor( pFontDesc, fScaledFontHeight, &aMatrix ); diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx index a9f879dfea90..661a7e76735e 100644 --- a/vcl/quartz/salgdi.cxx +++ b/vcl/quartz/salgdi.cxx @@ -391,7 +391,7 @@ void AquaGraphicsBackend::drawTextLayout(const GenericSalLayout& rLayout, bool b CGContextSetShouldAntialias(mrShared.maContextHolder.get(), !mrShared.mbNonAntialiasedText); CGContextSetFillColor(mrShared.maContextHolder.get(), textColor.AsArray()); - if (rFont.mbFauxBold) + if (rFont.NeedsArtificialBold()) { float fSize = rFontSelect.mnHeight / 23.0f; |