Created attachment 160196 [details] test svg SUMMARY STEPS TO REPRODUCE 1. Test the attached SVG (uses "Noto Sans" font) OBSERVED RESULT Line height appears a bit taller than in Firefox or Inkscape. EXPECTED RESULT Line height should be similar. SOFTWARE/OS VERSIONS Windows 10 Krita at d9959dfda2cd0b753a56570056789014d0820f02 ADDITIONAL INFORMATION
Ok, I can confirm, but it took me a while to find the nature of the bug. we're expected to use os/2 sTypo metrics for ascent and descent. https://www.w3.org/TR/css-inline-3/#ascent-descent However, for line-height we need to multiply by font-size (https://www.w3.org/TR/css-inline-3/#propdef-line-height) for percentage and number values. This is a problem because Noto's em square is 1000 divided into 800 ascent and 200 descent, but its metrics are set to 1069 ascent and 293 descent, which is afaik because it tries to work around bugs with glyphs larger than the em-square. I'll need to puzzle out how to tackle this.
Git commit 4e0194fe73cfd5816d24aadad1e618fdbdb06cae by Wolthera van Hövell tot Westerflier. Committed on 11/07/2023 at 12:54. Pushed by woltherav into branch 'wolthera/text-fixes-july-11'. Fix empty-lined hardbreaks not contributing their line-height. Not 100% sure this is correct, but it would require some tests. M +1 -1 libs/flake/text/KoSvgTextShape.cpp https://invent.kde.org/graphics/krita/-/commit/4e0194fe73cfd5816d24aadad1e618fdbdb06cae
Git commit 6f4a855cfc177cb94a50d4029a46b5471776e4eb by Alvin Wong, on behalf of Wolthera van Hövell tot Westerflier. Committed on 23/07/2023 at 16:17. Pushed by alvinwong into branch 'master'. Fix empty-lined hardbreaks not contributing their line-height. Not 100% sure this is correct, but it would require some tests. Closes !1850 M +18 -0 libs/flake/text/KoSvgTextShape.cpp https://invent.kde.org/graphics/krita/-/commit/6f4a855cfc177cb94a50d4029a46b5471776e4eb
Git commit 09c836c6d7ccf9f76008500298796bb3321c31c5 by Alvin Wong, on behalf of Wolthera van Hövell tot Westerflier. Committed on 23/07/2023 at 16:17. Pushed by alvinwong into branch 'master'. Fix BUG:472073, use font-size for line-height ratio calculation. Sometimes ascent-descent is larger than the font-size. Percentage also uses font-size but also has different parsing, and thus should already have been covered. Closes !1850 M +1 -1 libs/flake/text/KoSvgTextShape.cpp https://invent.kde.org/graphics/krita/-/commit/09c836c6d7ccf9f76008500298796bb3321c31c5