File inkscape-pango-line-breaks.patch of Package inkscape.24910

From cccc6c3481838567a07917261d1280b34681137b Mon Sep 17 00:00:00 2001
From: Tavmjong Bah <tavmjong@free.fr>
Date: Fri, 5 Nov 2021 18:49:43 +0100
Subject: [PATCH] Remove mandatory break from end of paragraphs, added in Pango
 1.49. This broke Inkscape's multiline text (sodipodi:role = line).

(cherry picked from commit b3dabef2245d4e4e977ee9d6776be9a134493515)
---
 src/libnrtype/Layout-TNG-Compute.cpp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff -urp a/src/libnrtype/Layout-TNG-Compute.cpp b/src/libnrtype/Layout-TNG-Compute.cpp
--- a/src/libnrtype/Layout-TNG-Compute.cpp	2020-09-07 04:02:10.000000000 -0500
+++ b/src/libnrtype/Layout-TNG-Compute.cpp	2022-06-13 19:12:38.941219985 -0500
@@ -1301,7 +1301,7 @@ void  Layout::Calculator::_buildPangoIte
     }
 
     TRACE(("whole para: \"%s\"\n", para_text.data()));
-    TRACE(("%d input sources used\n", input_index - para->first_input_index));
+//    TRACE(("%d input sources used\n", input_index - para->first_input_index));
     // do the pango_itemize()
     GList *pango_items_glist = nullptr;
     para->direction = LEFT_TO_RIGHT; // CSS default
@@ -1337,6 +1337,10 @@ void  Layout::Calculator::_buildPangoIte
     para->char_attributes.resize(para_text.length() + 1);
     pango_get_log_attrs(para_text.data(), para_text.bytes(), -1, nullptr, &*para->char_attributes.begin(), para->char_attributes.size());
 
+    // Fix for Pango 1.49 which changes the end of a paragraph to a mandatory break.
+    // This breaks Inkscape's multiline text (i.e. sodipodi:role line).
+    para->char_attributes[para_text.length()].is_mandatory_break = 0;
+
     TRACE(("end para itemize, direction = %d\n", para->direction));
 }
 
@@ -1449,7 +1453,7 @@ unsigned Layout::Calculator::_buildSpans
                 unsigned const text_source_bytes = ( text_source->text_end.base()
                                                      - text_source->text_begin.base()
                                                      - span_start_byte_in_source );
-                TRACE(("New Span\n"));
+                TRACE(("New Unbroken Span\n"));
                 UnbrokenSpan new_span;
                 new_span.text_bytes = std::min(text_source_bytes, pango_item_bytes);
                 new_span.input_stream_first_character = Glib::ustring::const_iterator(text_source->text_begin.base() + span_start_byte_in_source);
openSUSE Build Service is sponsored by