diff options
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qfontdatabase.cpp | 12 | ||||
-rw-r--r-- | src/gui/text/qtextdocument_p.cpp | 5 | ||||
-rw-r--r-- | src/gui/text/qtextdocumentlayout.cpp | 7 | ||||
-rw-r--r-- | src/gui/text/qtextengine.cpp | 10 |
4 files changed, 20 insertions, 14 deletions
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index cf716df669..a657a8c516 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -2509,13 +2509,12 @@ bool QFontDatabasePrivate::isApplicationFont(const QString &fileName) with removeApplicationFont() or to retrieve the list of family names contained in the font. +//! [add-application-font-doc] The function returns -1 if the font could not be loaded. Currently only TrueType fonts, TrueType font collections, and OpenType fonts are supported. - - \note Adding application fonts on Unix/X11 platforms without fontconfig is - currently not supported. +//! [add-application-font-doc] \sa addApplicationFontFromData(), applicationFontFamilies(), removeApplicationFont() */ @@ -2543,12 +2542,7 @@ int QFontDatabase::addApplicationFont(const QString &fileName) with removeApplicationFont() or to retrieve the list of family names contained in the font. - The function returns -1 if the font could not be loaded. - - Currently only TrueType fonts and TrueType font collections are supported. - - \b{Note:} Adding application fonts on Unix/X11 platforms without fontconfig is - currently not supported. + \include qfontdatabase.cpp add-application-font-doc \sa addApplicationFont(), applicationFontFamilies(), removeApplicationFont() */ diff --git a/src/gui/text/qtextdocument_p.cpp b/src/gui/text/qtextdocument_p.cpp index 524931ebde..c22dd95d48 100644 --- a/src/gui/text/qtextdocument_p.cpp +++ b/src/gui/text/qtextdocument_p.cpp @@ -381,8 +381,11 @@ int QTextDocumentPrivate::insert_block(int pos, uint strPos, int format, int blo Q_ASSERT(blocks.length() == fragments.length()); QTextBlockGroup *group = qobject_cast<QTextBlockGroup *>(objectForFormat(blockFormat)); - if (group) + if (group) { group->blockInserted(QTextBlock(this, b)); + docChangeOldLength--; + docChangeLength--; + } QTextFrame *frame = qobject_cast<QTextFrame *>(objectForFormat(formats.format(format))); if (frame) { diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp index ba72e26c3f..f3e6ea2100 100644 --- a/src/gui/text/qtextdocumentlayout.cpp +++ b/src/gui/text/qtextdocumentlayout.cpp @@ -2361,9 +2361,10 @@ QTextLayoutStruct QTextDocumentLayoutPrivate::layoutCell(QTextTable *t, const QT floatMinWidth = qMax(floatMinWidth, cd->minimumWidth); } - // constraint the maximumWidth by the minimum width of the fixed size floats, to - // keep them visible + // constraint the maximum/minimumWidth by the minimum width of the fixed size floats, + // to keep them visible layoutStruct.maximumWidth = qMax(layoutStruct.maximumWidth, floatMinWidth); + layoutStruct.minimumWidth = qMax(layoutStruct.minimumWidth, floatMinWidth); // as floats in cells get added to the table's float list but must not affect // floats in other cells we must clear the list here. @@ -2540,6 +2541,8 @@ recalc_minmax_widths: for (int n = 0; n < cspan; ++n) { const int col = i + n; QFixed w = widthToDistribute / (cspan - n); + if (td->maxWidths[col] != QFIXED_MAX) + w = qMax(td->maxWidths[col], w); td->maxWidths[col] = qMax(td->minWidths.at(col), w); widthToDistribute -= td->maxWidths.at(col); if (widthToDistribute <= 0) diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 805ab87dd6..ce4abac472 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -1373,9 +1373,15 @@ static void applyVisibilityRules(ushort ucs, QGlyphLayout *glyphs, uint glyphPos if (!fontEngine->symbol) { // U+00AD [SOFT HYPHEN] is a default ignorable codepoint, // so we replace its glyph and metrics with ones for - // U+002D [HYPHEN-MINUS] and make it visible if it appears at line-break + // U+002D [HYPHEN-MINUS] or U+2010 [HYPHEN] and make + // it visible if it appears at line-break const uint engineIndex = glyphs->glyphs[glyphPosition] & 0xff000000; - glyphs->glyphs[glyphPosition] = fontEngine->glyphIndex('-'); + glyph_t glyph = fontEngine->glyphIndex(0x002d); + if (glyph == 0) + glyph = fontEngine->glyphIndex(0x2010); + if (glyph == 0) + glyph = fontEngine->glyphIndex(0x00ad); + glyphs->glyphs[glyphPosition] = glyph; if (Q_LIKELY(glyphs->glyphs[glyphPosition] != 0)) { glyphs->glyphs[glyphPosition] |= engineIndex; QGlyphLayout tmp = glyphs->mid(glyphPosition, 1); |