Remove last traces of old Harfbuzz
In Qt 6, we removed the "old" Harfbuzz and Harfbuzz-NG became the only option. But the QT_HARFBUZZ=old environment variable would still be read and would disable certain parts of the code path. This has caused some confusion when porting older applications, where QT_HARFBUZZ=old was used to work around issues with the earlier versions of Harfbuzz-NG. Setting it now causes text to disappear completely. To avoid this confusion, we remove traces of the QT_HARFBUZZ environment variable as well. [ChangeLog][Text] Fixed an issue where setting the legacy environment variable QT_HARFBUZZ=old would cause text to disappear from the application. Fixes: QTBUG-102774 Change-Id: I0f07cdb2418202fc36b82e766ad9547c34477175 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
This commit is contained in:
parent
6eb9439809
commit
7fa2a1a479
@ -90,17 +90,6 @@ static inline bool qSafeFromBigEndian(const uchar *source, const uchar *end, T *
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Harfbuzz helper functions
|
|
||||||
|
|
||||||
#if QT_CONFIG(harfbuzz)
|
|
||||||
Q_GLOBAL_STATIC_WITH_ARGS(bool, useHarfbuzzNG,(qgetenv("QT_HARFBUZZ") != "old"))
|
|
||||||
|
|
||||||
bool qt_useHarfbuzzNG()
|
|
||||||
{
|
|
||||||
return *useHarfbuzzNG();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int QFontEngine::getPointInOutline(glyph_t glyph, int flags, quint32 point, QFixed *xpos, QFixed *ypos, quint32 *nPoints)
|
int QFontEngine::getPointInOutline(glyph_t glyph, int flags, quint32 point, QFixed *xpos, QFixed *ypos, quint32 *nPoints)
|
||||||
{
|
{
|
||||||
Q_UNUSED(glyph);
|
Q_UNUSED(glyph);
|
||||||
@ -199,20 +188,20 @@ void *QFontEngine::harfbuzzFont() const
|
|||||||
{
|
{
|
||||||
Q_ASSERT(type() != QFontEngine::Multi);
|
Q_ASSERT(type() != QFontEngine::Multi);
|
||||||
#if QT_CONFIG(harfbuzz)
|
#if QT_CONFIG(harfbuzz)
|
||||||
if (qt_useHarfbuzzNG())
|
|
||||||
return hb_qt_font_get_for_engine(const_cast<QFontEngine *>(this));
|
return hb_qt_font_get_for_engine(const_cast<QFontEngine *>(this));
|
||||||
#endif
|
#else
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void *QFontEngine::harfbuzzFace() const
|
void *QFontEngine::harfbuzzFace() const
|
||||||
{
|
{
|
||||||
Q_ASSERT(type() != QFontEngine::Multi);
|
Q_ASSERT(type() != QFontEngine::Multi);
|
||||||
#if QT_CONFIG(harfbuzz)
|
#if QT_CONFIG(harfbuzz)
|
||||||
if (qt_useHarfbuzzNG())
|
|
||||||
return hb_qt_face_get_for_engine(const_cast<QFontEngine *>(this));
|
return hb_qt_face_get_for_engine(const_cast<QFontEngine *>(this));
|
||||||
#endif
|
#else
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QFontEngine::supportsScript(QChar::Script script) const
|
bool QFontEngine::supportsScript(QChar::Script script) const
|
||||||
@ -227,7 +216,6 @@ bool QFontEngine::supportsScript(QChar::Script script) const
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
#if QT_CONFIG(harfbuzz)
|
#if QT_CONFIG(harfbuzz)
|
||||||
if (qt_useHarfbuzzNG()) {
|
|
||||||
// in AAT fonts, 'gsub' table is effectively replaced by 'mort'/'morx' table
|
// in AAT fonts, 'gsub' table is effectively replaced by 'mort'/'morx' table
|
||||||
uint lenMort = 0, lenMorx = 0;
|
uint lenMort = 0, lenMorx = 0;
|
||||||
if (getSfntTableData(MAKE_TAG('m','o','r','t'), nullptr, &lenMort) || getSfntTableData(MAKE_TAG('m','o','r','x'), nullptr, &lenMorx))
|
if (getSfntTableData(MAKE_TAG('m','o','r','t'), nullptr, &lenMort) || getSfntTableData(MAKE_TAG('m','o','r','x'), nullptr, &lenMorx))
|
||||||
@ -244,7 +232,6 @@ bool QFontEngine::supportsScript(QChar::Script script) const
|
|||||||
if (hb_ot_layout_table_select_script(face, HB_OT_TAG_GSUB, script_count, script_tags, nullptr, nullptr))
|
if (hb_ot_layout_table_select_script(face, HB_OT_TAG_GSUB, script_count, script_tags, nullptr, nullptr))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1354,10 +1354,6 @@ void QTextEngine::shapeLine(const QScriptLine &line)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_CONFIG(harfbuzz)
|
|
||||||
extern bool qt_useHarfbuzzNG(); // defined in qfontengine.cpp
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void applyVisibilityRules(ushort ucs, QGlyphLayout *glyphs, uint glyphPosition, QFontEngine *fontEngine)
|
static void applyVisibilityRules(ushort ucs, QGlyphLayout *glyphs, uint glyphPosition, QFontEngine *fontEngine)
|
||||||
{
|
{
|
||||||
// hide characters that should normally be invisible
|
// hide characters that should normally be invisible
|
||||||
@ -1517,7 +1513,7 @@ void QTextEngine::shapeText(int item) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if QT_CONFIG(harfbuzz)
|
#if QT_CONFIG(harfbuzz)
|
||||||
if (Q_LIKELY(shapingEnabled && qt_useHarfbuzzNG())) {
|
if (Q_LIKELY(shapingEnabled)) {
|
||||||
si.num_glyphs = shapeTextWithHarfbuzzNG(si, string, itemLength, fontEngine, itemBoundaries, kerningEnabled, letterSpacing != 0);
|
si.num_glyphs = shapeTextWithHarfbuzzNG(si, string, itemLength, fontEngine, itemBoundaries, kerningEnabled, letterSpacing != 0);
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
@ -1578,7 +1574,6 @@ void QTextEngine::shapeText(int item) const
|
|||||||
QGlyphLayout glyphs = shapedGlyphs(&si);
|
QGlyphLayout glyphs = shapedGlyphs(&si);
|
||||||
|
|
||||||
#if QT_CONFIG(harfbuzz)
|
#if QT_CONFIG(harfbuzz)
|
||||||
if (Q_LIKELY(qt_useHarfbuzzNG()))
|
|
||||||
qt_getJustificationOpportunities(string, itemLength, si, glyphs, logClusters(&si));
|
qt_getJustificationOpportunities(string, itemLength, si, glyphs, logClusters(&si));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user