From 6058de61bb1c59cb3307bdcb9551a68f9702bf81 Mon Sep 17 00:00:00 2001 From: Jabiertxof Date: Thu, 12 Sep 2019 18:57:44 +0200 Subject: Line height fixes --- src/libnrtype/Layout-TNG-Input.cpp | 12 ++++++++++++ src/libnrtype/Layout-TNG.h | 8 +++++++- 2 files changed, 19 insertions(+), 1 deletion(-) (limited to 'src/libnrtype') diff --git a/src/libnrtype/Layout-TNG-Input.cpp b/src/libnrtype/Layout-TNG-Input.cpp index b523649e7..7a01d4ca2 100644 --- a/src/libnrtype/Layout-TNG-Input.cpp +++ b/src/libnrtype/Layout-TNG-Input.cpp @@ -115,6 +115,18 @@ void Layout::appendControlCode(TextControlCode code, void *source_cookie, double _input_stream.push_back(new_code); } +void Layout::hideWrapShapes() +{ + _input_wrap_shapes_hided = _input_wrap_shapes; + _input_wrap_shapes.clear(); +} + +void Layout::showWrapShapes() +{ + _input_wrap_shapes = _input_wrap_shapes_hided; + _input_wrap_shapes_hided.clear(); +} + // more saving of the parameters void Layout::appendWrapShape(Shape const *shape, DisplayAlign display_align) { diff --git a/src/libnrtype/Layout-TNG.h b/src/libnrtype/Layout-TNG.h index 8a0d74f69..fe775d37c 100644 --- a/src/libnrtype/Layout-TNG.h +++ b/src/libnrtype/Layout-TNG.h @@ -159,6 +159,7 @@ public: /** Used to specify orientation of glyphs in vertical text. */ enum Orientation {ORIENTATION_UPRIGHT, ORIENTATION_SIDEWAYS}; + /** Display alignment for shapes. See appendWrapShape(). */ enum DisplayAlign {DISPLAY_ALIGN_BEFORE, DISPLAY_ALIGN_CENTER, DISPLAY_ALIGN_AFTER}; @@ -302,7 +303,11 @@ public: */ void appendWrapShape(Shape const *shape, DisplayAlign display_align = DISPLAY_ALIGN_BEFORE); - //@} + // Hide wrap shapes + void hideWrapShapes(); + + // Show wrap shapes + void showWrapShapes(); // ************************** textLength and friends ************************* @@ -798,6 +803,7 @@ private: DisplayAlign display_align; /// as passed to Layout::appendWrapShape() }; std::vector _input_wrap_shapes; + std::vector _input_wrap_shapes_hided; // ******************* output -- cgit v1.2.3