Accepting request 800355 from home:Vogtinator:qt5.15
- Add patch to fix kerning with certain labels (QTBUG-49646): * fix-subpixel-positioned-text.patch OBS-URL: https://build.opensuse.org/request/show/800355 OBS-URL: https://build.opensuse.org/package/show/KDE:Qt:5.15/libqt5-qtdeclarative?expand=0&rev=7
This commit is contained in:
parent
0aa1d82e66
commit
6243d3142d
59
fix-subpixel-positioned-text.patch
Normal file
59
fix-subpixel-positioned-text.patch
Normal file
@ -0,0 +1,59 @@
|
||||
From 40ba29cae5cdb2ebd6330870a0f15e2e75d40de0 Mon Sep 17 00:00:00 2001
|
||||
From: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
|
||||
Date: Tue, 05 May 2020 11:36:24 +0200
|
||||
Subject: [PATCH] Fix subpixel positioned text with Text.NativeRendering
|
||||
|
||||
We would be generating subpixel positioned glyphs based on the
|
||||
relative positions of the glyphs, ignoring the fractional part
|
||||
contributed by the origin of the text. So if the text origin was
|
||||
inside a pixel, the subpixel antialiasing would be wrong and we
|
||||
would see kerning errors.
|
||||
|
||||
This was especially visible when using AlignHCenter on text
|
||||
with hinting disabled and resizing the item it was aligning to.
|
||||
|
||||
Pick-to: 5.15
|
||||
Task-number: QTBUG-49646
|
||||
Change-Id: I0e709ba2b5d2440e34c94c6f819befe0a65a113a
|
||||
---
|
||||
|
||||
diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
|
||||
index be6ef25..831586c 100644
|
||||
--- a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
|
||||
+++ b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
|
||||
@@ -789,11 +789,12 @@
|
||||
const QMargins &margins)
|
||||
{
|
||||
Q_ASSERT(m_font.isValid());
|
||||
+ QPointF position(p.x(), p.y() - m_font.ascent());
|
||||
QVector<QFixedPoint> fixedPointPositions;
|
||||
const int glyphPositionsSize = glyphPositions.size();
|
||||
fixedPointPositions.reserve(glyphPositionsSize);
|
||||
for (int i=0; i < glyphPositionsSize; ++i)
|
||||
- fixedPointPositions.append(QFixedPoint::fromPointF(glyphPositions.at(i)));
|
||||
+ fixedPointPositions.append(QFixedPoint::fromPointF(position + glyphPositions.at(i)));
|
||||
|
||||
QTextureGlyphCache *cache = glyphCache();
|
||||
|
||||
@@ -815,18 +816,16 @@
|
||||
Q_ASSERT(geometry->sizeOfVertex() == sizeof(QVector4D));
|
||||
ushort *ip = geometry->indexDataAsUShort();
|
||||
|
||||
- QPointF position(p.x(), p.y() - m_font.ascent());
|
||||
bool supportsSubPixelPositions = fontD->fontEngine->supportsSubPixelPositions();
|
||||
for (int i=0; i<glyphIndexes.size(); ++i) {
|
||||
+ QPointF glyphPosition = glyphPositions.at(i) + position;
|
||||
QFixed subPixelPosition;
|
||||
if (supportsSubPixelPositions)
|
||||
- subPixelPosition = fontD->fontEngine->subPixelPositionForX(QFixed::fromReal(glyphPositions.at(i).x()));
|
||||
+ subPixelPosition = fontD->fontEngine->subPixelPositionForX(QFixed::fromReal(glyphPosition.x()));
|
||||
|
||||
QTextureGlyphCache::GlyphAndSubPixelPosition glyph(glyphIndexes.at(i), subPixelPosition);
|
||||
const QTextureGlyphCache::Coord &c = cache->coords.value(glyph);
|
||||
|
||||
- QPointF glyphPosition = glyphPositions.at(i) + position;
|
||||
-
|
||||
// On a retina screen the glyph positions are not pre-scaled (as opposed to
|
||||
// eg. the raster paint engine). To ensure that we get the same behavior as
|
||||
// the raster engine (and CoreText itself) when it comes to rounding of the
|
||||
|
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue May 5 11:16:16 UTC 2020 - Fabian Vogt <fvogt@suse.com>
|
||||
|
||||
- Add patch to fix kerning with certain labels (QTBUG-49646):
|
||||
* fix-subpixel-positioned-text.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Apr 24 07:11:08 UTC 2020 - Fabian Vogt <fabian@ritter-vogt.de>
|
||||
|
||||
|
@ -31,6 +31,8 @@ Group: Development/Libraries/X11
|
||||
URL: https://www.qt.io
|
||||
Source: https://download.qt.io/development_releases/qt/5.15/%{real_version}/submodules/%{tar_version}.tar.xz
|
||||
Source1: baselibs.conf
|
||||
# PATCH-FIX-UPSTREAM https://codereview.qt-project.org/c/qt/qtdeclarative/+/299258/1
|
||||
Patch1: fix-subpixel-positioned-text.patch
|
||||
# PATCH-FIX-OPENSUSE sse2_nojit.patch -- enable JIT and sse2 only on sse2 case
|
||||
Patch100: sse2_nojit.patch
|
||||
# PATCH-FIX-OPENSUSE Switch to use python3 at build time
|
||||
|
Loading…
Reference in New Issue
Block a user