<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>391160</bug_id>
          
          <creation_ts>2018-02-27 11:41:51 +0000</creation_ts>
          <short_desc>Handmade SVG file using list values for the x, y, dx, and dy values won&apos;t load right.</short_desc>
          <delta_ts>2018-03-19 14:32:44 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>krita</product>
          <component>Tool/Text</component>
          <version>git master (please specify the git hash!)</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="wolthera">griffinvalley</reporter>
          <assigned_to name="Dmitry Kazakov">dimula73</assigned_to>
          <cc>halla</cc>
          
          <cf_commitlink>https://commits.kde.org/krita/3fb3824e436df7a997c02f3ab59472be9e114de2</cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1734197</commentid>
    <comment_count>0</comment_count>
    <who name="wolthera">griffinvalley</who>
    <bug_when>2018-02-27 11:41:51 +0000</bug_when>
    <thetext>(From phabricator)
There&apos;s a weird thing going on with the character offsets, the following SVG loads properly in Firefox and Inkscape, but not in Krita:

------------------------------------------------------------------------
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;svg viewbox=&quot;0 0 1800 1200&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
    
    &lt;text x=&quot;200&quot; y=&quot;50&quot; style=&quot;font-family:Noto mono; font-size:12pt; text-anchor:start&quot;&gt;
    &lt;tspan dy=&quot;0 -3 -3 -3 -3 3 3 3 3 0 -3 -3 -3 -3 3 3 3 3 0 -3 -3 -3 -3 3 3 3 3 0 -3 -3 -3 -3 3 3 3 3 0&quot;&gt;Lorem ipsum dolor sit amet&lt;/tspan&gt;
    &lt;/text&gt;
    
    &lt;text x=&quot;200&quot; y=&quot;100&quot; style=&quot;font-family:Noto mono; font-size:12pt; text-anchor:start&quot;&gt;
    &lt;tspan dx=&quot;0 -3 -3 -3 -3 3 3 3 3 0 -3 -3 -3 -3 3 3 3 3 0 -3 -3 -3 -3 3 3 3 3 0 -3 -3 -3 -3 3 3 3 3 0&quot;&gt;consectetur adipiscing elit.&lt;/tspan&gt;
    &lt;/text&gt;
    
    &lt;text x=&quot;200&quot; y=&quot;150&quot; style=&quot;font-family:Noto mono; font-size:12pt; text-anchor:start&quot;&gt;
    &lt;tspan y=&quot;150 155 160 155 150 155 160 155 150 155 160 155 150 155 160 155 150 155 160 155 150 155 160 155 150 155 160 155&quot;&gt;Lorem ipsum dolor sit amet&lt;/tspan&gt;
    &lt;/text&gt;
    &lt;text x=&quot;150&quot; y=&quot;200&quot; style=&quot;font-family:Noto mono; font-size:12pt; text-anchor:start&quot;&gt;
    &lt;tspan x=&quot;150 170 190 210 230 250 270 290 310 330 350 370 390 410 430 450 470 490 510 530 550 570 590 610 630 650 670 690&quot;&gt;Lorem ipsum dolor sit amet&lt;/tspan&gt;
    &lt;/text&gt;
&lt;/svg&gt;
-----------------------------------------------------------------------------
And the code for handling the offsets like this is there, it&apos;s just not interpreted properly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1738463</commentid>
    <comment_count>1</comment_count>
    <who name="Dmitry Kazakov">dimula73</who>
    <bug_when>2018-03-16 05:46:21 +0000</bug_when>
    <thetext>Oups, after my recent fix for text bounding rect, this test file just crashes Krita :(</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1738677</commentid>
    <comment_count>2</comment_count>
    <who name="Dmitry Kazakov">dimula73</who>
    <bug_when>2018-03-17 07:14:40 +0000</bug_when>
    <thetext>Git commit 7317b69c9464fe3600cf672ebea1cb18ac97bfe1 by Dmitry Kazakov.
Committed on 17/03/2018 at 07:14.
Pushed by dkazakov into branch &apos;master&apos;.

Fix crash when a format range wraps a fully whitespace run of symbols

M  +5    -0    libs/flake/text/KoSvgTextShape.cpp

https://commits.kde.org/krita/7317b69c9464fe3600cf672ebea1cb18ac97bfe1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1738678</commentid>
    <comment_count>3</comment_count>
    <who name="Dmitry Kazakov">dimula73</who>
    <bug_when>2018-03-17 07:15:32 +0000</bug_when>
    <thetext>After the crash is fixed it is just a bug, not a release blocker anymore</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1738697</commentid>
    <comment_count>4</comment_count>
    <who name="Halla Rempt">halla</who>
    <bug_when>2018-03-17 08:53:31 +0000</bug_when>
    <thetext>Git commit 72c4f497f733ee85a620874f00234c54988d5aa0 by Boudewijn Rempt, on behalf of Dmitry Kazakov.
Committed on 17/03/2018 at 08:53.
Pushed by rempt into branch &apos;krita/4.0&apos;.

Fix crash when a format range wraps a fully whitespace run of symbols
(cherry picked from commit 7317b69c9464fe3600cf672ebea1cb18ac97bfe1)

M  +5    -0    libs/flake/text/KoSvgTextShape.cpp

https://commits.kde.org/krita/72c4f497f733ee85a620874f00234c54988d5aa0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1739088</commentid>
    <comment_count>5</comment_count>
    <who name="Dmitry Kazakov">dimula73</who>
    <bug_when>2018-03-19 12:23:21 +0000</bug_when>
    <thetext>Git commit c764a68e1df604e7ccd453bac4ccf23182038479 by Dmitry Kazakov.
Committed on 19/03/2018 at 12:15.
Pushed by dkazakov into branch &apos;master&apos;.

Fix rendering of the text with relative offsets

1) Relative offsets were calculated incorrectly: null offsets should
   not repeat itself, but define a new noop offset, which will
   be handled on a lower level

2) Workaround QTextLayout &quot;weirdness&quot; that makes it skip the space
   characters and not include them into &quot;horizontal advance&quot; of the
   text chunk

M  +80   -0    libs/flake/tests/TestSvgText.cpp
M  +3    -0    libs/flake/tests/TestSvgText.h
A  +-    --    libs/flake/tests/data/svg_render/load_text_multiple_absolute_offsets_arabic.png
A  +-    --    libs/flake/tests/data/svg_render/load_text_multiple_relative_offsets.png
M  +3    -1    libs/flake/text/KoSvgTextChunkShape.cpp
M  +104  -31   libs/flake/text/KoSvgTextShape.cpp

https://commits.kde.org/krita/c764a68e1df604e7ccd453bac4ccf23182038479</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1739128</commentid>
    <comment_count>6</comment_count>
    <who name="Halla Rempt">halla</who>
    <bug_when>2018-03-19 14:32:44 +0000</bug_when>
    <thetext>Git commit 3fb3824e436df7a997c02f3ab59472be9e114de2 by Boudewijn Rempt, on behalf of Dmitry Kazakov.
Committed on 19/03/2018 at 14:32.
Pushed by rempt into branch &apos;krita/4.0&apos;.

Fix rendering of the text with relative offsets

1) Relative offsets were calculated incorrectly: null offsets should
   not repeat itself, but define a new noop offset, which will
   be handled on a lower level

2) Workaround QTextLayout &quot;weirdness&quot; that makes it skip the space
   characters and not include them into &quot;horizontal advance&quot; of the
   text chunk

M  +80   -0    libs/flake/tests/TestSvgText.cpp
M  +3    -0    libs/flake/tests/TestSvgText.h
A  +-    --    libs/flake/tests/data/svg_render/load_text_multiple_absolute_offsets_arabic.png
A  +-    --    libs/flake/tests/data/svg_render/load_text_multiple_relative_offsets.png
M  +3    -1    libs/flake/text/KoSvgTextChunkShape.cpp
M  +104  -31   libs/flake/text/KoSvgTextShape.cpp

https://commits.kde.org/krita/3fb3824e436df7a997c02f3ab59472be9e114de2</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>