diff options
Diffstat (limited to 'include/drawinglayer/primitive2d')
4 files changed, 37 insertions, 1 deletions
diff --git a/include/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx b/include/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx index 015d0befe32f..8989f77c6b8b 100644 --- a/include/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx +++ b/include/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx @@ -112,6 +112,7 @@ #define PRIMITIVE2D_ID_POLYPOLYGONRGBAPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 78) #define PRIMITIVE2D_ID_BITMAPALPHAPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 79) #define PRIMITIVE2D_ID_POLYPOLYGONALPHAGRADIENTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 80) +#define PRIMITIVE2D_ID_TEXTHIERARCHYEMPHASISMARKPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 81) // When you add a new primitive, please update the drawinglayer::primitive2d::idToString() function // in drawinglayer/source/primitive2d/Tools.cxx. diff --git a/include/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx b/include/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx index 62cb9099c985..0efebc0a7f0c 100644 --- a/include/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx @@ -177,6 +177,16 @@ namespace drawinglayer::primitive2d /// provide unique ID virtual sal_uInt32 getPrimitive2DID() const override; }; + + class DRAWINGLAYER_DLLPUBLIC TextHierarchyEmphasisMarkPrimitive2D final : public GroupPrimitive2D + { + public: + /// constructor + explicit TextHierarchyEmphasisMarkPrimitive2D(Primitive2DContainer&& aContent); + + /// provide unique ID + virtual sal_uInt32 getPrimitive2DID() const override; + }; } // end of namespace drawinglayer::primitive2d diff --git a/include/drawinglayer/primitive2d/textlayoutdevice.hxx b/include/drawinglayer/primitive2d/textlayoutdevice.hxx index de7a1e214a2a..5a0849100142 100644 --- a/include/drawinglayer/primitive2d/textlayoutdevice.hxx +++ b/include/drawinglayer/primitive2d/textlayoutdevice.hxx @@ -22,9 +22,11 @@ #include <drawinglayer/drawinglayerdllapi.h> #include <basegfx/range/b2drange.hxx> +#include <drawinglayer/primitive2d/textenumsprimitive2d.hxx> #include <vector> #include <basegfx/polygon/b2dpolypolygon.hxx> #include <vcl/svapp.hxx> +#include <tools/fontenum.hxx> #include <span> // predefines @@ -37,6 +39,10 @@ namespace vcl { class Font; } +namespace vcl::font +{ +class EmphasisMark; +} namespace tools { class Rectangle; @@ -118,7 +124,12 @@ public: sal_uInt32 nLength, const basegfx::B2DPoint& rStartPoint, const KernArray& rDXArray, - std::span<const sal_Bool> pKashidaAry); + std::span<const sal_Bool> pKashidaAry) const; + void + createEmphasisMarks(SalLayout& rSalLayout, TextEmphasisMark aTextEmphasisMark, bool bAbove, + std::function<void(const basegfx::B2DPoint&, const basegfx::B2DPolyPolygon&, + bool, const tools::Rectangle&, const tools::Rectangle&)> + aCallback) const; }; // helper methods for vcl font handling diff --git a/include/drawinglayer/primitive2d/textprimitive2d.hxx b/include/drawinglayer/primitive2d/textprimitive2d.hxx index b5cff99f4047..44c59ae47828 100644 --- a/include/drawinglayer/primitive2d/textprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/textprimitive2d.hxx @@ -30,10 +30,18 @@ #include <tools/long.hxx> #include <basegfx/color/bcolor.hxx> #include <com/sun/star/lang/Locale.hpp> +#include <memory> #include <vector> namespace drawinglayer::primitive2d { +class TextLayouterDevice; +} + +class SalLayout; + +namespace drawinglayer::primitive2d +{ /** TextSimplePortionPrimitive2D class This is the basic primitive for representing a text portion. It contains @@ -134,6 +142,12 @@ protected: create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const override; public: + /// helpers to create a TextLayouterDevice and SalLayout, e.g. needed for SDPRs + // and decompose. NOTE: the TextLayouterDevice is filled, but should always only + // be used temporary (do not try to buffer) + void createTextLayouter(TextLayouterDevice& rTextLayouter) const; + std::unique_ptr<SalLayout> createSalLayout(TextLayouterDevice& rTextLayouter) const; + /// constructor TextSimplePortionPrimitive2D(basegfx::B2DHomMatrix aNewTransform, OUString aText, sal_Int32 nTextPosition, sal_Int32 nTextLength, |