<?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>470782</bug_id>
          
          <creation_ts>2023-06-08 11:45:59 +0000</creation_ts>
          <short_desc>Changing font size in text tool does not update the canvas</short_desc>
          <delta_ts>2023-07-22 10:26:11 +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>nightly build (please specify the git hash!)</version>
          <rep_platform>Microsoft Windows</rep_platform>
          <op_sys>Microsoft Windows</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="Alvin Wong">alvin</reporter>
          <assigned_to name="wolthera">griffinvalley</assigned_to>
          <cc>acc4commissions</cc>
    
    <cc>griffinvalley</cc>
    
    <cc>keyth2363214</cc>
          
          <cf_commitlink>https://invent.kde.org/graphics/krita/-/commit/b3e539c3ede5aa6f8af578ac2e2acd0994181874</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>2235371</commentid>
    <comment_count>0</comment_count>
    <who name="Alvin Wong">alvin</who>
    <bug_when>2023-06-08 11:45:59 +0000</bug_when>
    <thetext>SUMMARY

Changing font size in text tool does not update the text size on canvas.

STEPS TO REPRODUCE
1. Create a new file: 1280x1280 px, 300 ppi
2. Create a text element
3. Set font to &quot;Noto Sans&quot;, font size should be &quot;9&quot; by default
4. Input the following text:
    The quick
    brown fox
    jumps over
    the lazy dog.
5. Click &quot;Save&quot;.
6. Change font size to &quot;12&quot;
7. Click &quot;Save&quot;.

OBSERVED RESULT

After changing the font size and pressing &quot;Save&quot; the second time, the line height updates with the new font size, but the text itself is still rendered in the previous font size.

EXPECTED RESULT

Font size of the text should update.

SOFTWARE/OS VERSIONS
Windows: Win10 21H2 (19044.2846)
Krita: krita-nightly-x64-5.2.0-prealpha-55965ad53a</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2235375</commentid>
    <comment_count>1</comment_count>
    <who name="wolthera">griffinvalley</who>
    <bug_when>2023-06-08 11:54:20 +0000</bug_when>
    <thetext>I can reproduce. I think it might be caused by font-size adjust....</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2237821</commentid>
    <comment_count>2</comment_count>
    <who name="Bug Janitor Service">bug-janitor</who>
    <bug_when>2023-06-22 16:55:46 +0000</bug_when>
    <thetext>A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1832</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2238097</commentid>
    <comment_count>3</comment_count>
    <who name="Alvin Wong">alvin</who>
    <bug_when>2023-06-24 11:20:17 +0000</bug_when>
    <thetext>Git commit b3e539c3ede5aa6f8af578ac2e2acd0994181874 by Alvin Wong.
Committed on 24/06/2023 at 11:19.
Pushed by alvinwong into branch &apos;master&apos;.

Fix font-size-adjust calculation from QTextDocument

The previous calculation was wrong, causing text to be stuck in a
specific size regardless of the actual font size setting in the rich
text editor.

When trying to fix it, I found that QFontMetricsF gives bogus values for
xHeight (at least on Windows) so it cannot be used. I ended up
calculating the value by reading the parameters with FreeType. If the
font does not have xHeight, then we just don&apos;t write the property.

The value of this property is calculated so that the font size of the
primary font is the same as when this property is not set.

M  +18   -3    libs/flake/text/KoSvgTextShapeMarkupConverter.cpp

https://invent.kde.org/graphics/krita/-/commit/b3e539c3ede5aa6f8af578ac2e2acd0994181874</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2238569</commentid>
    <comment_count>4</comment_count>
    <who name="Halla Rempt">halla</who>
    <bug_when>2023-06-28 10:48:42 +0000</bug_when>
    <thetext>*** Bug 465870 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2242132</commentid>
    <comment_count>5</comment_count>
    <who name="Alvin Wong">alvin</who>
    <bug_when>2023-07-22 10:26:11 +0000</bug_when>
    <thetext>*** Bug 467848 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>