summaryrefslogtreecommitdiff
path: root/include/drawinglayer
diff options
context:
space:
mode:
Diffstat (limited to 'include/drawinglayer')
-rw-r--r--include/drawinglayer/attribute/fontattribute.hxx34
-rw-r--r--include/drawinglayer/primitive2d/baseprimitive2d.hxx8
-rw-r--r--include/drawinglayer/processor2d/baseprocessor2d.hxx2
-rw-r--r--include/drawinglayer/processor2d/textlayoutdevice.hxx11
4 files changed, 34 insertions, 21 deletions
diff --git a/include/drawinglayer/attribute/fontattribute.hxx b/include/drawinglayer/attribute/fontattribute.hxx
index 1a7250170b6e..ed0be642f615 100644
--- a/include/drawinglayer/attribute/fontattribute.hxx
+++ b/include/drawinglayer/attribute/fontattribute.hxx
@@ -23,6 +23,8 @@
#include <o3tl/cow_wrapper.hxx>
#include <rtl/ustring.hxx>
+#include <basegfx/text/ITextLayouter.hxx>
+
namespace drawinglayer::attribute
{
class ImpFontAttribute;
@@ -35,7 +37,7 @@ namespace drawinglayer::attribute
This attribute class is able to hold all parameters needed/used
to completely define the parametrisation of a text portion.
*/
-class DRAWINGLAYER_DLLPUBLIC FontAttribute
+class DRAWINGLAYER_DLLPUBLIC FontAttribute : public gfx::IFontAttribute
{
public:
typedef o3tl::cow_wrapper<ImpFontAttribute> ImplType;
@@ -50,26 +52,26 @@ public:
bool bMonospaced = false, bool bOutline = false, bool bRTL = false,
bool bBiDiStrong = false);
FontAttribute();
- FontAttribute(const FontAttribute&);
- FontAttribute(FontAttribute&&);
- FontAttribute& operator=(const FontAttribute&);
- FontAttribute& operator=(FontAttribute&&);
- ~FontAttribute();
+ FontAttribute(const FontAttribute& rOther);
+ FontAttribute(FontAttribute&& rOther) noexcept;
+ FontAttribute& operator=(const FontAttribute& rOther);
+ FontAttribute& operator=(FontAttribute&& rOther) noexcept;
+ virtual ~FontAttribute();
// compare operator
bool operator==(const FontAttribute& rCandidate) const;
/// data read access
- const OUString& getFamilyName() const;
- const OUString& getStyleName() const;
- sal_uInt16 getWeight() const;
- bool getSymbol() const;
- bool getVertical() const;
- bool getItalic() const;
- bool getOutline() const;
- bool getRTL() const;
- bool getBiDiStrong() const;
- bool getMonospaced() const;
+ const OUString& getFamilyName() const override;
+ const OUString& getStyleName() const override;
+ sal_uInt16 getWeight() const override;
+ bool getSymbol() const override;
+ bool getVertical() const override;
+ bool getItalic() const override;
+ bool getOutline() const override;
+ bool getRTL() const override;
+ bool getBiDiStrong() const override;
+ bool getMonospaced() const override;
};
} // end of namespace drawinglayer::attribute
diff --git a/include/drawinglayer/primitive2d/baseprimitive2d.hxx b/include/drawinglayer/primitive2d/baseprimitive2d.hxx
index 486bf031daf7..69ff76ae0c4c 100644
--- a/include/drawinglayer/primitive2d/baseprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/baseprimitive2d.hxx
@@ -30,6 +30,7 @@
#include <cppuhelper/basemutex.hxx>
#include <basegfx/range/b2drange.hxx>
#include <com/sun/star/graphic/XPrimitive2D.hpp>
+#include <basegfx/text/ITextLayouter.hxx>
#include <drawinglayer/geometry/viewinformation2d.hxx>
@@ -39,10 +40,13 @@ class DRAWINGLAYERCORE_DLLPUBLIC VisitingParameters
{
private:
geometry::ViewInformation2D maViewInformation;
+ std::shared_ptr<gfx::ITextLayouter> mpTextLayouter;
public:
- explicit VisitingParameters(const geometry::ViewInformation2D& rViewInformation)
+ explicit VisitingParameters(geometry::ViewInformation2D const& rViewInformation,
+ std::shared_ptr<gfx::ITextLayouter> const& pTextLayouter)
: maViewInformation(rViewInformation)
+ , mpTextLayouter(pTextLayouter)
{
}
@@ -54,6 +58,8 @@ public:
}
const geometry::ViewInformation2D& getViewInformation() const { return maViewInformation; }
+
+ const std::shared_ptr<gfx::ITextLayouter>& getTextLayouter() const { return mpTextLayouter; }
};
typedef cppu::WeakComponentImplHelper<css::graphic::XPrimitive2D, css::util::XAccounting>
diff --git a/include/drawinglayer/processor2d/baseprocessor2d.hxx b/include/drawinglayer/processor2d/baseprocessor2d.hxx
index 802434fd9009..c723c5c0c619 100644
--- a/include/drawinglayer/processor2d/baseprocessor2d.hxx
+++ b/include/drawinglayer/processor2d/baseprocessor2d.hxx
@@ -24,7 +24,7 @@
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
#include <drawinglayer/geometry/viewinformation2d.hxx>
-
+#include <basegfx/text/ITextLayouter.hxx>
namespace drawinglayer::processor2d
{
diff --git a/include/drawinglayer/processor2d/textlayoutdevice.hxx b/include/drawinglayer/processor2d/textlayoutdevice.hxx
index ddcdf06bc0dd..edcefec190e1 100644
--- a/include/drawinglayer/processor2d/textlayoutdevice.hxx
+++ b/include/drawinglayer/processor2d/textlayoutdevice.hxx
@@ -25,6 +25,7 @@
#include <vector>
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <vcl/svapp.hxx>
+#include <basegfx/text/ITextLayouter.hxx>
// predefines
class VirtualDevice;
@@ -58,7 +59,7 @@ namespace drawinglayer::processor2d
When in the future FontHandling may move to an own library independent
from VCL, primitives will be prepared.
*/
-class DRAWINGLAYER_DLLPUBLIC TextLayouterDevice
+class DRAWINGLAYER_DLLPUBLIC TextLayouterDevice : public gfx::ITextLayouter
{
/// internally used VirtualDevice
SolarMutexGuard maSolarGuard;
@@ -71,6 +72,10 @@ public:
/// tooling methods
void setFont(const vcl::Font& rFont);
+
+ void setFontAttribute(const gfx::IFontAttribute& rFontAttribute, double fFontScaleX,
+ double fFontScaleY, const css::lang::Locale& rLocale) override;
+
void setFontAttribute(const attribute::FontAttribute& rFontAttribute, double fFontScaleX,
double fFontScaleY, const css::lang::Locale& rLocale);
@@ -84,7 +89,7 @@ public:
double getTextWidth(const OUString& rText, sal_uInt32 nIndex, sal_uInt32 nLength) const;
void getTextOutlines(basegfx::B2DPolyPolygonVector&, const OUString& rText, sal_uInt32 nIndex,
- sal_uInt32 nLength, const ::std::vector<double>& rDXArray) const;
+ sal_uInt32 nLength, const ::std::vector<double>& rDXArray) const override;
basegfx::B2DRange getTextBoundRect(const OUString& rText, sal_uInt32 nIndex,
sal_uInt32 nLength) const;
@@ -111,7 +116,7 @@ public:
fFontScaleY == fFontScaleX
*/
vcl::Font DRAWINGLAYER_DLLPUBLIC getVclFontFromFontAttribute(
- const attribute::FontAttribute& rFontAttribute, double fFontScaleX, double fFontScaleY,
+ const gfx::IFontAttribute& rFontAttribute, double fFontScaleX, double fFontScaleY,
double fFontRotation, const css::lang::Locale& rLocale);
/** Generate FontAttribute DataSet derived from the given VCL-Font.