diff options
Diffstat (limited to 'src/gui/text/qfontengine.cpp')
-rw-r--r-- | src/gui/text/qfontengine.cpp | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index 4f0c6d25f7..74ea8d15b7 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -418,6 +418,13 @@ glyph_metrics_t QFontEngine::boundingBox(glyph_t glyph, const QTransform &matrix return metrics; } +QFixed QFontEngine::calculatedCapHeight() const +{ + const glyph_t glyph = glyphIndex('H'); + glyph_metrics_t bb = const_cast<QFontEngine *>(this)->boundingBox(glyph); + return bb.height; +} + QFixed QFontEngine::xHeight() const { const glyph_t glyph = glyphIndex('x'); @@ -1700,6 +1707,11 @@ QFixed QFontEngineBox::ascent() const return _size; } +QFixed QFontEngineBox::capHeight() const +{ + return _size; +} + QFixed QFontEngineBox::descent() const { return 0; @@ -1842,7 +1854,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) { @@ -1880,7 +1896,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) { @@ -2152,6 +2172,9 @@ glyph_metrics_t QFontEngineMulti::boundingBox(glyph_t glyph) QFixed QFontEngineMulti::ascent() const { return engine(0)->ascent(); } +QFixed QFontEngineMulti::capHeight() const +{ return engine(0)->capHeight(); } + QFixed QFontEngineMulti::descent() const { return engine(0)->descent(); } |