Add line feed and carriage return to blacklisted characters
In order to avoid loading and checking all fonts on the system when the string contains a line separator, we blacklisted it in 98a23b974509bd1b6d9459e6c79677bdcbaa0108 in Qt 4. The same logic applies for paragraph separators, line feeds and carriage returns. Task-number: QTBUG-51934 Change-Id: I121dce17a8ac79b5b790e24c6596438e501e871a Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
This commit is contained in:
parent
06f920399b
commit
4c56466f43
@ -1846,7 +1846,11 @@ QFontEngine *QFontEngineMulti::loadEngine(int at)
|
||||
glyph_t QFontEngineMulti::glyphIndex(uint ucs4) const
|
||||
{
|
||||
glyph_t glyph = engine(0)->glyphIndex(ucs4);
|
||||
if (glyph == 0 && ucs4 != QChar::LineSeparator) {
|
||||
if (glyph == 0
|
||||
&& ucs4 != QChar::LineSeparator
|
||||
&& ucs4 != QChar::LineFeed
|
||||
&& ucs4 != QChar::CarriageReturn
|
||||
&& ucs4 != QChar::ParagraphSeparator) {
|
||||
if (!m_fallbackFamiliesQueried)
|
||||
const_cast<QFontEngineMulti *>(this)->ensureFallbackFamiliesQueried();
|
||||
for (int x = 1, n = qMin(m_engines.size(), 256); x < n; ++x) {
|
||||
@ -1884,7 +1888,11 @@ bool QFontEngineMulti::stringToCMap(const QChar *str, int len,
|
||||
QStringIterator it(str, str + len);
|
||||
while (it.hasNext()) {
|
||||
const uint ucs4 = it.peekNext();
|
||||
if (glyphs->glyphs[glyph_pos] == 0 && ucs4 != QChar::LineSeparator) {
|
||||
if (glyphs->glyphs[glyph_pos] == 0
|
||||
&& ucs4 != QChar::LineSeparator
|
||||
&& ucs4 != QChar::LineFeed
|
||||
&& ucs4 != QChar::CarriageReturn
|
||||
&& ucs4 != QChar::ParagraphSeparator) {
|
||||
if (!m_fallbackFamiliesQueried)
|
||||
const_cast<QFontEngineMulti *>(this)->ensureFallbackFamiliesQueried();
|
||||
for (int x = 1, n = qMin(m_engines.size(), 256); x < n; ++x) {
|
||||
|
Loading…
Reference in New Issue
Block a user