diff options
author | xukai <xukai@multicorewareinc.com> | 2014-09-22 19:01:31 +0800 |
---|---|---|
committer | Kohei Yoshida <libreoffice@kohei.us> | 2014-09-23 14:58:36 +0000 |
commit | 98cb400d08a35d26e211fffda24e5b7c6e6672bf (patch) | |
tree | e6f6e932de4875f427bfd760377ac6d34e0ec9e5 /chart2 | |
parent | 35d4c21bf0faaffb87c5197f6d0b3d798aca33bd (diff) |
3D fonts suport
Change-Id: Id8142586e8ace4ba91a30b2f78d1216f89f22148
Reviewed-on: https://gerrit.libreoffice.org/11585
Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
Tested-by: Kohei Yoshida <libreoffice@kohei.us>
Diffstat (limited to 'chart2')
-rwxr-xr-x[-rw-r--r--] | chart2/source/view/inc/3DChartObjects.hxx | 6 | ||||
-rwxr-xr-x[-rw-r--r--] | chart2/source/view/main/3DChartObjects.cxx | 12 |
2 files changed, 11 insertions, 7 deletions
diff --git a/chart2/source/view/inc/3DChartObjects.hxx b/chart2/source/view/inc/3DChartObjects.hxx index 49b21a33cd88..39d09b419c3a 100644..100755 --- a/chart2/source/view/inc/3DChartObjects.hxx +++ b/chart2/source/view/inc/3DChartObjects.hxx @@ -37,7 +37,7 @@ struct TextCacheItem class TextCache { public: - const TextCacheItem &getText(OUString const & rText); + const TextCacheItem &getText(OUString const & rText, bool bIs3dText = false); private: typedef boost::ptr_map<OUString const, TextCacheItem> TextCacheType; @@ -108,8 +108,8 @@ private: class ScreenText : public Renderable3DObject { public: - ScreenText(OpenGL3DRenderer* pRenderer, TextCache& rTextCache, const OUString& rStr, - const glm::vec4& rColor, sal_uInt32 nId); + ScreenText(OpenGL3DRenderer* pRenderer, TextCache& rTextCache, + const OUString& rStr, glm::vec4 rColor, sal_uInt32 nId, bool bIs3dText = false); virtual void render() SAL_OVERRIDE; void setPosition(const glm::vec2& rTopLeft, const glm::vec2& rBottomRight, diff --git a/chart2/source/view/main/3DChartObjects.cxx b/chart2/source/view/main/3DChartObjects.cxx index c0992e472aae..13d1fb38f76b 100644..100755 --- a/chart2/source/view/main/3DChartObjects.cxx +++ b/chart2/source/view/main/3DChartObjects.cxx @@ -70,14 +70,18 @@ void Line::setLineColor(const Color& rColor) maLineColor = rColor; } -const TextCacheItem& TextCache::getText(OUString const & rText) +const TextCacheItem& TextCache::getText(OUString const & rText, bool bIs3dText) { TextCacheType::const_iterator itr = maTextCache.find(rText); if(itr != maTextCache.end()) return *itr->second; VirtualDevice aDevice(*Application::GetDefaultDevice(), 0, 0); - vcl::Font aFont = aDevice.GetFont(); + vcl::Font aFont; + if(bIs3dText) + aFont = vcl::Font("postoffice Bold",Size(0,0)); + else + aFont = aDevice.GetFont(); aFont.SetSize(Size(0, 96)); static bool bOldRender = getenv("OLDRENDER"); if (bOldRender) @@ -129,9 +133,9 @@ void Text::setPosition(const glm::vec3& rTopLeft, const glm::vec3& rTopRight, co } ScreenText::ScreenText(OpenGL3DRenderer* pRenderer, TextCache& rTextCache, - const OUString& rStr, const glm::vec4& rColor, sal_uInt32 nId): + const OUString& rStr, glm::vec4 rColor, sal_uInt32 nId, bool bIs3dText): Renderable3DObject(pRenderer, nId), - maText(rTextCache.getText(rStr)), + maText(rTextCache.getText(rStr,bIs3dText)), maColor(rColor) { } |