summaryrefslogtreecommitdiff
path: root/drawinglayer/source/primitive2d/Tools.cxx
diff options
context:
space:
mode:
authorArmin Le Grand (Collabora) <Armin.Le.Grand@me.com>2024-08-13 14:50:24 +0200
committerArmin Le Grand <Armin.Le.Grand@me.com>2024-08-14 10:48:51 +0200
commit4a0cd8990467466a04bafd7bb1a780247535ab83 (patch)
tree0ad062668269da8435c78bebc766f0e1531afe32 /drawinglayer/source/primitive2d/Tools.cxx
parentcf23025faabdae03f4d4706410c80c7c46c683e9 (diff)
CairoSDPR: Handle EmphasisMarks
Handling EmphasisMarks for direct text rendering was a hard task - the EmphasisMark stuff is deeply buried in vcl (would have needed to move quite some includes from vcl to public) and thus hard to use. It is also quite old (tools Polygon, Rectangle). It was missing in the decomposition of the TextDecoratedPortionPrimitive2D (for good reason), but is needed now. I found a way using a callback lambda function to create the needed geometry in vcl and hand back the needed data to the caller, in this case to the decomposition. Adding it to the decomposition of TextDecoratedPortionPrimitive2D also guarantees that other renderers/usages will do the correct thing and all will look identical. Interestingly EmphasisMarks were never added to Metafiles (see OutputDevice::ImplDrawEmphasisMarks) so they were not 'missing' in Metafile-based exports. But for SDPRs they have to work. I added another encapsulating TextHierarchyPrimitive to encapsulate primitives that do represent EmphasisMarks and added to ignore these in the VclMetafileProcessor2D (as needed). Change-Id: I5b5c1528d86a123df2beb57d8366f05aa71e77cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171826 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'drawinglayer/source/primitive2d/Tools.cxx')
-rw-r--r--drawinglayer/source/primitive2d/Tools.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/drawinglayer/source/primitive2d/Tools.cxx b/drawinglayer/source/primitive2d/Tools.cxx
index 52545212b8cc..e1c3dfe96e80 100644
--- a/drawinglayer/source/primitive2d/Tools.cxx
+++ b/drawinglayer/source/primitive2d/Tools.cxx
@@ -241,6 +241,8 @@ OUString idToString(sal_uInt32 nId)
return u"BITMAPALPHAPRIMITIVE2D"_ustr;
case PRIMITIVE2D_ID_POLYPOLYGONALPHAGRADIENTPRIMITIVE2D:
return u"POLYPOLYGONALPHAGRADIENTPRIMITIVE2D"_ustr;
+ case PRIMITIVE2D_ID_TEXTHIERARCHYEMPHASISMARKPRIMITIVE2D:
+ return u"TEXTHIERARCHYEMPHASISMARKPRIMITIVE2D"_ustr;
default:
return OUString::number((nId >> 16) & 0xFF) + "|" + OUString::number(nId & 0xFF);
}