diff options
author | Mark Hung <marklh9@gmail.com> | 2018-10-24 00:03:41 +0800 |
---|---|---|
committer | Mark Hung <marklh9@gmail.com> | 2018-10-31 00:28:33 +0100 |
commit | 144416c428712b039927ff9d6b1eae05bc2c2478 (patch) | |
tree | 13021606ad165ff233a5212aa8f1c671c32d4cee | |
parent | 4fa9e6f7f891b335ae1b432e0848c1e46c8fe3ef (diff) |
tdf#43671 creatCanvasFont with EmphasisMark.
Change-Id: I8c7592e9bdb212fcbb07655e81faadd07ed880f7
Reviewed-on: https://gerrit.libreoffice.org/62244
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
-rw-r--r-- | cppcanvas/source/inc/outdevstate.hxx | 4 | ||||
-rw-r--r-- | cppcanvas/source/mtfrenderer/implrenderer.cxx | 14 |
2 files changed, 14 insertions, 4 deletions
diff --git a/cppcanvas/source/inc/outdevstate.hxx b/cppcanvas/source/inc/outdevstate.hxx index 1a087fdc63c4..36f4c6fda57f 100644 --- a/cppcanvas/source/inc/outdevstate.hxx +++ b/cppcanvas/source/inc/outdevstate.hxx @@ -57,7 +57,7 @@ namespace cppcanvas mapModeTransform(), fontRotation(0.0), - textEmphasisMarkStyle(FontEmphasisMark::NONE), + textEmphasisMark(FontEmphasisMark::NONE), pushFlags(PushFlags::ALL), textDirection(css::rendering::TextDirection::WEAK_LEFT_TO_RIGHT), textAlignment(0), // TODO(Q2): Synchronize with implrenderer @@ -99,7 +99,7 @@ namespace cppcanvas ::basegfx::B2DHomMatrix mapModeTransform; double fontRotation; - FontEmphasisMark textEmphasisMarkStyle; + FontEmphasisMark textEmphasisMark; PushFlags pushFlags; sal_Int8 textDirection; sal_Int8 textAlignment; diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index 8108ffbb4564..237f69bf7af3 100644 --- a/cppcanvas/source/mtfrenderer/implrenderer.cxx +++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx @@ -306,7 +306,7 @@ namespace cppcanvas aCalculatedNewState.textOverlineStyle = rNewState.textOverlineStyle; aCalculatedNewState.textUnderlineStyle = rNewState.textUnderlineStyle; aCalculatedNewState.textStrikeoutStyle = rNewState.textStrikeoutStyle; - aCalculatedNewState.textEmphasisMarkStyle = rNewState.textEmphasisMarkStyle; + aCalculatedNewState.textEmphasisMark = rNewState.textEmphasisMark; aCalculatedNewState.isTextEffectShadowSet = rNewState.isTextEffectShadowSet; aCalculatedNewState.isTextWordUnderlineSet = rNewState.isTextWordUnderlineSet; aCalculatedNewState.isTextOutlineModeSet = rNewState.isTextOutlineModeSet; @@ -840,6 +840,16 @@ namespace cppcanvas } aFontRequest.CellSize = (rState.mapModeTransform * vcl::unotools::b2DSizeFromSize(rFontSizeLog)).getY(); + if (rFont.GetEmphasisMark() != FontEmphasisMark::NONE) + { + uno::Sequence< beans::PropertyValue > aProperties(1); + aProperties[0].Name = "EmphasisMark"; + aProperties[0].Value <<= sal_uInt32(rFont.GetEmphasisMark()); + return rParms.mrCanvas->getUNOCanvas()->createFont(aFontRequest, + aProperties, + aFontMatrix); + } + return rParms.mrCanvas->getUNOCanvas()->createFont( aFontRequest, uno::Sequence< beans::PropertyValue >(), aFontMatrix ); @@ -1488,7 +1498,7 @@ namespace cppcanvas (*rParms.maFontUnderline ? sal_Int8(LINESTYLE_SINGLE) : sal_Int8(LINESTYLE_NONE)) : static_cast<sal_Int8>(rFont.GetUnderline()); rState.textStrikeoutStyle = static_cast<sal_Int8>(rFont.GetStrikeout()); - rState.textEmphasisMarkStyle = rFont.GetEmphasisMark() & FontEmphasisMark::Style; + rState.textEmphasisMark = rFont.GetEmphasisMark(); rState.isTextEffectShadowSet = rFont.IsShadow(); rState.isTextWordUnderlineSet = rFont.IsWordLineMode(); rState.isTextOutlineModeSet = rFont.IsOutline(); |