summaryrefslogtreecommitdiff
path: root/canvas
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2018-10-30 23:43:10 +0800
committerMark Hung <marklh9@gmail.com>2018-11-01 14:28:00 +0100
commitbeaba5f1abbb9a1461286fc831ea6a30131bb3b5 (patch)
tree0146d8bc609b3695932b401dcea7649a18e783cf /canvas
parent17cd7dd708631f7af9e66860b403627416e4545e (diff)
tdf#43671 set emphasis mark of vcl::Font (opengl).
Change-Id: Ib61765b495c867bcb461ee7324eb7b92ed4da864 Reviewed-on: https://gerrit.libreoffice.org/62631 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com>
Diffstat (limited to 'canvas')
-rw-r--r--canvas/source/opengl/ogl_canvasfont.cxx6
-rw-r--r--canvas/source/opengl/ogl_canvasfont.hxx3
-rw-r--r--canvas/source/opengl/ogl_canvashelper.cxx3
3 files changed, 10 insertions, 2 deletions
diff --git a/canvas/source/opengl/ogl_canvasfont.cxx b/canvas/source/opengl/ogl_canvasfont.cxx
index 0434bb0856cb..18621b544930 100644
--- a/canvas/source/opengl/ogl_canvasfont.cxx
+++ b/canvas/source/opengl/ogl_canvasfont.cxx
@@ -11,22 +11,24 @@
#include <com/sun/star/rendering/PanoseWeight.hpp>
#include <com/sun/star/rendering/XSpriteCanvas.hpp>
+#include <canvas/canvastools.hxx>
#include "ogl_canvasfont.hxx"
#include "ogl_textlayout.hxx"
-
using namespace ::com::sun::star;
namespace oglcanvas
{
CanvasFont::CanvasFont( const rendering::FontRequest& rFontRequest,
- const uno::Sequence< beans::PropertyValue >& /*extraFontProperties*/,
+ const uno::Sequence< beans::PropertyValue >& extraFontProperties,
const geometry::Matrix2D& fontMatrix ) :
CanvasFontBaseT( m_aMutex ),
maFontRequest( rFontRequest ),
+ mnEmphasisMark(0),
maFontMatrix( fontMatrix )
{
+ ::canvas::tools::extractExtraFontProperties(extraFontProperties, mnEmphasisMark);
}
uno::Reference< rendering::XTextLayout > SAL_CALL CanvasFont::createTextLayout( const rendering::StringContext& aText,
diff --git a/canvas/source/opengl/ogl_canvasfont.hxx b/canvas/source/opengl/ogl_canvasfont.hxx
index 1743bc3c985e..eb2307a7720e 100644
--- a/canvas/source/opengl/ogl_canvasfont.hxx
+++ b/canvas/source/opengl/ogl_canvasfont.hxx
@@ -50,8 +50,11 @@ namespace oglcanvas
const css::geometry::Matrix2D& getFontMatrix() const { return maFontMatrix; }
+ sal_uInt32 getEmphasisMark() const { return mnEmphasisMark; }
+
private:
css::rendering::FontRequest maFontRequest;
+ sal_uInt32 mnEmphasisMark;
css::geometry::Matrix2D maFontMatrix;
};
}
diff --git a/canvas/source/opengl/ogl_canvashelper.cxx b/canvas/source/opengl/ogl_canvashelper.cxx
index c4bfde0bed8e..2902c2e9b8db 100644
--- a/canvas/source/opengl/ogl_canvashelper.cxx
+++ b/canvas/source/opengl/ogl_canvashelper.cxx
@@ -701,6 +701,9 @@ namespace oglcanvas
aFont.SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) );
aFont.SetItalic( (rFontRequest.FontDescription.FontDescription.Letterform<=8) ? ITALIC_NONE : ITALIC_NORMAL );
+ if (pFont->getEmphasisMark())
+ aFont.SetEmphasisMark(FontEmphasisMark(pFont->getEmphasisMark()));
+
// adjust to stretched font
if(!::rtl::math::approxEqual(rFontMatrix.m00, rFontMatrix.m11))
{