summaryrefslogtreecommitdiffstats
path: root/src/gui/text
Commit message (Collapse)AuthorAgeFilesLines
* QTextHtmlParserNode: Fix warnings flood about setting negative pixel sizeFriedemann Kleint2020-09-021-1/+2
| | | | | | | | | | | Exclude the default value (-1) from the check. Amends 0bd770fb875d5391dd78df95542c25bd15051938. Pick-to: 5.12 5.15 5.15.1 Change-Id: Ib98ae166fd5fdab546c5d4212ce78345b5c9b583 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Qpagedpaintdevice: Use marginsF instead of internal struct marginsPeng Wenhao2020-09-011-3/+6
| | | | | | | resolve remaining Qt6 TODOs Change-Id: Iad659a09ddfe136bdc545bc0635b4c695540c58b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix text issues when using typographic namesEskil Abrahamsen Blomfeldt2020-08-302-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | By default, only the legacy family names are populated on Windows, since we are using GDI to do the population. The actual typographic names are added later as aliases when the font is loaded. This can cause us to fail matching a font against its typographic name before it has been loaded and e.g .in Qt Quick we will cache the glyph indexes for a fallback font instead. If the font is later loaded and aliases are populated, we will use the cached glyph indexes and get seemingly random glyphs displayed. We reuse the mechanism invented for CoreText to do lazy population of aliases. The population will now happen when the first non-match occurs, and a second attempt will be made after we populate aliases. [ChangeLog][Windows] Fixes an issue where fonts would sometimes not fail to work when selected using typographic names. Fixes: QTBUG-84786 Pick-to: 5.15 Change-Id: Ic7b65cde26ddcbf1a257f1673b9af37154660c2f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove QUnicodeTools::DefaultOptionsCompatEdward Welbourne2020-08-281-6/+9
| | | | | | | | | | Used in only one place, declared in a private header with a comment saying to remove it. All callers of the one function that had it as default parameter value are passing a value for the parameter. Task-number: QTBUG-85700 Change-Id: Ic72e4df730740a4023b0a43be6bf7acf33a3166b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Avoid overflows in variantHash()Robert Loehning2020-08-281-2/+2
| | | | | | | Fixes: oss-fuzz-24702 Pick-to: 5.12 5.15 Change-Id: I876bac9e2c276693e59802dfeeea2229a873ee34 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTextHtmlParserNode: Avoid extreme values for font's pixelsizeRobert Loehning2020-08-281-0/+1
| | | | | | | | | | They currently cause an integer-overflow in variantHash(). Fixes: oss-fuzz-24702 Pick-to: 5.12 5.15 Change-Id: Ibee4413ca766c8ade9aeff2f2052b82cb9f7d213 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Compile textdocument-end snippetsPaul Wicking2020-08-281-1/+1
| | | | | | | | | | | | * Extend GUI snippet compilation with textdocument-end snippet. * Rename the snippet file and replace main() with wrapper(). * Dedent the snippet itself. * Update documentation that includes the snippet. Done-with: Nico Vertriest <nico.vertriest@qt.io> Task-number: QTBUG-81486 Change-Id: Id5e5b284587da1e7fdfd00baa9c899626832a113 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: Compile qfontdatabase snippetsPaul Wicking2020-08-281-2/+1
| | | | | | | | | | | | * Extend GUI snippets by adding the qfontdatabase project. * Rename the snippet file and replace main() with wrapper(). * Minor adjustments of the snippet itself. * Update documentation that includes the snippet. Done-with: Nico Vertriest <nico.vertriest@qt.io> Task-number: QTBUG-81486 Change-Id: Id23aff01a4c919c5264f7059971cb63398c2298c Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: Fix documentation warnings for Qt GUITopi Reinio2020-08-289-27/+16
| | | | | | | | | | | | * Drop deprecation warnings for now-dropped items * Use the 'qt6' define and a new \nothing doc macro to conditionally document items on Qt 6 * Add a custom module header for docs that pulls in also Vulkan headers * Add \internal command for internal classes/functions * Move QtGUI-related code snippets from widgets to gui docs Change-Id: Ieb386b96631a49568d09059906d307c45c01d93a Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Remove "internal" parameter in QTextLine::draw()Jonas Karlsson2020-08-282-6/+13
| | | | | | | | | | The method is split up into a private and public version, where the parameter is moved into the private method. Fixes: QTBUG-84210 Change-Id: I79e9e02c9b4cc25d31db066e5a9567fdb9bc9fd0 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Use OpenType font weightsJonas Karlsson2020-08-2817-103/+141
| | | | | | | Task-number: QTBUG-42248 Change-Id: Icdb301b27d6699c2b842c4563fbef9df73c23cbc Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Allow arbitrary baseline shift in QTextCharacterFormatJordi Pujol Foyo2020-08-266-5/+194
| | | | | | | | | | | | | | | Added 6 new methods in QTextFormat and QTextDocument to allow setting/getting specific % positioning for baseline and super/ subscript. Modified QTextLayout to honor those new settings. [ChangeLog][QtGui][QTextLayout,QTextFormat,QTextDocument] Allow text layout modification based on baseline offset and super/subscript % height positioning Fixes: QTBUG-18260 Change-Id: I0796f18224aac8df6baf8359c35022fd98fe64ef Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Rename confusingly named QFont/QPalette::resolve overloadsVolker Hilsheimer2020-08-253-7/+7
| | | | | | | | | | | | | | | Having three methods with the same name doing different things is unnecessarily confusing, so follow the standard naming convention in Qt and call the getter of the resolve mask resolveMask, and the setter setResolveMask. These methods were all documented as internal. The publicly documented resolve() method that merges two fonts and palettes based on the respective masks remains as it is, even though 'merge' would perhaps be a better name. Change-Id: If90b1ad800834baccd1dbc38fc6b861540d6df6e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QTextLayout: Remove deprecated methodsMarcel Krems2020-08-252-37/+0
| | | | | Change-Id: I7991428fb3526e48c0ceda0dcc46ea8a0918cb95 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Remove the QPF2 font engineEskil Abrahamsen Blomfeldt2020-08-246-942/+7
| | | | | | | | | | | | | | | The QPF2 font engine has been kept around for compatibility reasons in Qt 5.x, and it is time for it to retire for now. If we want something like this in the future, we can revive it with hardware acceleration / Qt Quick as one of the primary use cases, but for now, it seems that Freetype and our existing caching is sufficient also for low-end use cases. [ChangeLog][QtGui][Text] Removed support for the legacy QPF2 font format as well as the makeqpf tool used to generate those files. Change-Id: Id43039c92fe5bd95b628cd769e045c029f39a350 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Use QMetaType in QMetaCallEventLars Knoll2020-08-241-2/+2
| | | | | | | And don't use int based type mapping anymore. Change-Id: I456e76d1933ef646a7bd39ce565886b89e938a44 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Clean up int based convert() APILars Knoll2020-08-241-2/+2
| | | | | | | Pass QMetaType instances instead. Change-Id: I07366cea566fdebf5bb793aa8087f8109216ec0c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFont: Extend the string description to include the missing elementsAndy Shaw2020-08-221-4/+17
| | | | | | | | | | This extends to/fromString to include style strategy, capitalization, letter and word spacing and stretch. QFont::fromString() keeps compatibility with strings from earlier versions as well. Fixes: QTBUG-67687 Change-Id: I5e95a58f1cd850214af2a7d8906a214facd4e661 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix a number of qdoc warningsFriedemann Kleint2020-08-201-0/+1
| | | | | | | | | | | - Remove obsolete functions and enumeration values - Remove QObject * parameter from QMetaProperty accessors - Fix renamed enumerations in QSsl - Fix list items to be \li - Fix function signatures and variable names Change-Id: I37c7e6bf2c8ff92bc7b82620bae0a27796f866ab Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Remove 'less than' comparison methodJonas Karlsson2020-08-171-7/+0
| | | | | | Change-Id: Ief52da4f9176216ba45d4dc9df5bb341987cb585 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Remove QVariant(int type, void *data, ...) constructorLars Knoll2020-08-152-3/+3
| | | | | | | | It was marked internal anyway. Use the constructor taking a QMetaType instead. Change-Id: I15b9cd0911aac063a0f0fe0352fa2c84b7f7c691 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Replace Qt CONSTEXPR defines with constexprAllan Sandfeld Jensen2020-08-141-2/+2
| | | | | | | | Both normal and relaxed constexpr are required by our new minimum of C++17. Change-Id: Ic028b88a2e7a6cb7d5925f3133b9d54859a81744 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* QtFontStyle: Add missing const to non-mutable operatorsKonstantin Ritt2020-08-121-3/+3
| | | | | | | | and once I touch these lines anyways, either add noexcept ;) Fixes-up 8bdbb7f2267 Change-Id: Ibfaedcff82c041293220408ab7ae739b3cbd2a4f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Long Live QMap as a refcounted std::map!Giuseppe D'Angelo2020-08-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... and QMultiMap as std::multimap. Just use the implementation from the STL; we can't really claim that our code is much better than STL's, or does things any differently (de facto they're both red-black trees). Decouple QMultiMap from QMap, by making it NOT inherit from QMap any longer. This completes the deprecation started in 5.15: QMap now does not store duplicated keys any more. Something to establish is where to put the QExplictlySharedDataPointer replcement that is in there as an ad-hoc solution. There's a number of patches in-flight by Marc that try to introduce the same (or very similar) functionality. Miscellanea changes to the Q(Multi)Map code itself: * consistently use size_type instead of int; * pass iterators by value; * drop QT_STRICT_ITERATORS; * iterators implictly convert to const_iterators, and APIs take const_iterators; * iterators are just bidirectional and not random access; * added noexcept where it makes sense; * "inline" dropped (churn); * qMapLessThanKey dropped (undocumented, 0 hits in Qt, 1 hit in KDE); * operator== on Q(Multi)Map requires operator== on the key type (we're checking for equality, not equivalence!). Very few breakages occur in qtbase. [ChangeLog][Potentially Source-Incompatible Changes] QMap does not support multiple equivalent keys any more. Any related functionality has been removed from QMap, following the deprecation that happened in Qt 5.15. Use QMultiMap for this use case. [ChangeLog][Potentially Source-Incompatible Changes] QMap and QMultiMap iterators random-access API have been removed. Note that the iterators have always been just bidirectional; moving an iterator by N positions can still be achieved using std::next or std::advance, at the same cost as before (O(N)). [ChangeLog][Potentially Source-Incompatible Changes] QMultiMap does not inherit from QMap any more. Amongst other things, this means that iterators on a QMultiMap now belong to the QMultiMap class (and not to the QMap class); new Java iterators have been added. Change-Id: I5a0fe9b020f92c21b37065a1defff783b5d2b7a9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Make QFontDatabase member functions staticEskil Abrahamsen Blomfeldt2020-08-062-41/+65
| | | | | | | | | | | | | | | | | | | | | | | | | QFontDatabase is a singleton and all instances would share a single, mutex-protected global data pointer. But some functions were implemented as non-static functions. This caused a lot of code on the form QFontDatabase().families(...) since there was no static access. Other functions were implemented as static. To consolidate, we make all functions static. This should be source-compatible, but not binary compatible. [ChangeLog][QtGui][Fonts] Some functions in QFontDatabase were in principle static, but previously not implemented as such. All member functions have now been made static, so that constructing objects of QFontDatabase is no longer necessary to access certain functionality. Fixes: QTBUG-83284 Change-Id: Ifd8c15016281c71f631b53387402c942cd9c43f6 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Another round of 0->nullptr cleanupAllan Sandfeld Jensen2020-07-317-9/+9
| | | | | Change-Id: Ic8db7dc252f8fea46eb5a4f334726d6c7f4645a6 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Sanitize lengthValue in CSS parserRobert Loehning2020-07-271-5/+4
| | | | | | | | | | Limit the LengthData to the integer range before rounding it, taking into account that qRound() substracts 1 from negative values. Fixes: oss-fuzz-23220 Pick-to: 5.15 5.12 Change-Id: I1b4383f3c33aac22746831002b2c74fc134faf77 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QWindowsFontDatabaseBase: Fix unused parameter errorKai Koehne2020-07-231-0/+2
| | | | | Change-Id: Ifa2cc45c1bf4326a1273a713e3db950846d2ca14 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix some MSVC int conversion warningsFriedemann Kleint2020-07-172-9/+9
| | | | | | | | | | | | | | | | | | | | | | | kernel\qmetaobjectbuilder.cpp(1279): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data kernel\qmetaobjectbuilder.cpp(1432): warning C4267: '+=': conversion from 'size_t' to 'int', possible loss of data sax\qxml.cpp(1275): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data text\qfontsubset.cpp(920): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data text\qfontsubset.cpp(920): warning C4267: 'initializing': conversion from 'size_t' to 'const int', possible loss of data text\qtextengine.cpp(2664): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data text\qtextengine.cpp(2665): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data text\qtextengine.cpp(2706): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data text\qtextengine.cpp(2707): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data itemviews\qbsptree.cpp(60): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) kernel\qprintengine_win.cpp(1558): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data qsql_odbc.cpp(804): warning C4267: 'argument': conversion from 'size_t' to 'SQLINTEGER', possible loss of data qsql_odbc.cpp(822): warning C4267: 'argument': conversion from 'size_t' to 'SQLINTEGER', possible loss of data qsql_odbc.cpp(1585): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data qsql_odbc.cpp(1602): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data qwindowsmime.cpp(770): warning C4267: '+=': conversion from 'size_t' to 'int', possible loss of data windows\qwindowsmime.cpp(770): warning C4267: '+=': conversion from 'size_t' to 'int', possible loss of data Change-Id: I04fbe17b9782f4c2704933fc005449b1e992475e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Avoid warnings regarding bit-field signednessDimitrios Apostolou2020-07-162-2/+2
| | | | | | | | | | | Up to (including) C++11, integral bitfields of unspecified signedness have implementation dependent signedness. Detected by LGTM.com static analyzer. Pick-to: 5.15 Change-Id: Ibaa0fdc6e443495a3cd40330c4573c9cc6ccdf5b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Don't flatten link color in QTextHtmlParser::declarationsForNodeTor Arne Vestbø2020-07-141-2/+2
| | | | | | | | | | | It's still flattened in the next step, when the parser calls QTextHtmlParserNode::applyCssDeclarations, but this at least makes it clear where the problem is. Task-number: QTBUG-85567 Change-Id: I1ecc7d808c58297f40f6cf8de86dfa7035e167c9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* QVariant::setValue(): enable move semanticsGiuseppe D'Angelo2020-07-131-1/+1
| | | | | | | | | | | | Given we optimize for the case where the new value is of the same type of the one already stored in the variant, enable move assignment for that case. As a drive-by, avoid a path to detach() for data() if we know we're detached. Change-Id: I9abbdc10637ce77ebb747b49d83e1ef914d997bb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use QList instead of QVector in gui implementationJarek Kobus2020-07-0724-179/+178
| | | | | | | Task-number: QTBUG-84469 Change-Id: I366e845249203d80d640355a7780ac2f91a762f1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix rendering error in some glyphsPengfei Zhang2020-07-071-1/+1
| | | | | | | | | | | Caused by a spelling mistake in the calculation. Pick-to: 5.15 Pick-to: 5.12 Change-Id: I69445fcd8a45b60c34d51aa09d778d4fee447065 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Add ; to Q_UNUSEDLars Schmertmann2020-07-076-19/+19
| | | | | | | | This is required to remove the ; from the macro with Qt 6. Task-number: QTBUG-82978 Change-Id: I3f0b6717956ca8fa486bed9817b89dfa19f5e0e1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Use qsizetype in QListLars Knoll2020-07-063-7/+7
| | | | | | | | | | | | | | | | | | | | The change creates a slight source incompatibility. The main things to take care of are * code using printf statements on list.size(). Using qsizetype in printf statements will always require a cast to work on both 32 and 64 bit. * A few places where overloads now get ambiguous. One example is QRandomGenerator::bounded() that has overloads for int, uint and double, but not int64. * Streaming list.size() to a QDataStream will change the format depending on the architecture. [ChangeLog][QtCore][QList] QList now uses qsizetype to index into elements. Change-Id: Iaff562a4d072b97f458417b670f95971bd47cbc6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Export the letter and word spacing settings set on the default formatAndy Shaw2020-07-063-1/+58
| | | | | | | | | | | | When the default format has letter and word spacing set then these should be exported in the HTML's body tag. This also adds support for the reading of letter-spacing and word-spacing set too, so that the same html outputted can be read back in. Fixes: QTBUG-83718 Change-Id: Ic4afca21eb05efb779dbf99c6b3c13373e851f15 Pick-to: 5.15 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Support glyphs larger than 255x255 with Freetype engineEskil Abrahamsen Blomfeldt2020-07-021-3/+3
| | | | | | | | | | | | | | | | | | | | We used chars for the width and height of glyphs when caching them in the Freetype engine. This was okay for Qt Widgets because we would fall back to QPainterPath when the fonts were too big anyway (though this has since become configurable). But in Qt Quick, when NativeRendering is in use, we will always cache glyphs, because they need to be uploaded to the GPU. Also 255 is no longer a large font size with current screen sizes, so we need to upgrade our maximum. The new maximum size is 65535x65535. [ChangeLog][QtGui][Text] Fixed a bug where glyphs would be clipped at very large sizes. Fixes: QTBUG-85259 Pick-to: 5.15 Change-Id: I9a01a707b274e5f12e49c1b0bd58f743abae9f5e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QTextOption: remove deprecated function QTextOption::tabStop()Christian Ehrlicher2020-07-012-33/+1
| | | | | Change-Id: I7d647088aacb83d16c3e3cc4d831162a95771083 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use QList instead of QVector in guiJarek Kobus2020-06-2922-135/+146
| | | | | | | | Applied to headers only. Source file to be changed separately. Task-number: QTBUG-84469 Change-Id: Ic08a899321eaffc46b8461aaee3dbaa4d2c727a9 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Avoid Freetype synthesizing for large font sizesEirik Aavitsland2020-06-221-1/+1
| | | | | | | | | | Freetype's fake emboldening does not give good results for large font sizes. Pick-to: 5.15 Fixes: QTBUG-84570 Change-Id: I1a7722c1482e3450e5a549c31c9766d930fcd13a Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Remove confusing comment in CoreText font engineEskil Abrahamsen Blomfeldt2020-06-221-1/+0
| | | | | | | | | | The comment says we don't need synthetic italic for oblique, but synthetic italic actually *is* oblique, since there is no way to synthesize italic. So just remove the comment as it is unclear what its purpose is. Change-Id: I72f727b958e817e376d73f6c001d410a5f55a152 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Move implementation of QVector/List back to qlist.hLars Knoll2020-06-202-4/+4
| | | | | | | | | | | | | And name the main class QList. That's also the one we document. This gives less porting pain for our users, and a lot less churn in our API, as we use QList in Qt 5 in 95% of our API. In addition, it gives more consistent naming with QStringList and QByteArrayList and disambiguates QList vs QVector(2|3|4)D. Fixes: QTBUG-84468 Change-Id: I3cba9d1d3179969d8bf9320b31be2230d021d1a9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Port Q_STATIC_ASSERT(_X) to static_assertGiuseppe D'Angelo2020-06-196-23/+23
| | | | | | | | | | | | | | | | | There is no reason for keep using our macro now that we have C++17. The macro itself is left in for the moment being, as well as its detection logic, because it's needed for C code (not everything supports C11 yet). A few more cleanups will arrive in the next few patches. Note that this is a mere search/replace; some places were using double braces to work around the presence of commas in a macro, no attempt has been done to fix those. tst_qglobal had just some minor changes to keep testing the macro. Change-Id: I1c1c397d9f3e63db3338842bf350c9069ea57639 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix the vertical alignment of images in a text documentDominik Holland2020-06-181-3/+16
| | | | | | | | | | | Try to align with the HTML standard as much as possible. AlignBottom is now really the bottom of the line (not the text). AlignMiddle is between AlignTop and AlignBottom. Change-Id: Ia067b96209c2ab0becbff99cf15bb8ab193ee2c6 Fixes: QTBUG-84981 Pick-to: 5.15 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add a way to disable syntethesized bold and italic supportKyu Man Lim2020-06-182-4/+4
| | | | | | | | | | | | Using the environment variables QT_NO_SYNTHESIZED_BOLD and QT_NO_SYNTHESIZED_ITALIC it is now possible to disable the support for synthesized bold and italic, which is used when the font doesn't support those variants. Change-Id: Ic1a6984858e1260f252662689705553073859df4 Task-number: QTBUG-83124 Pick-to: 5.15 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* QtGui: Fix duplication of logging category lcQpaFontsFriedemann Kleint2020-06-186-8/+4
| | | | | | | | | Move it to qplatformfontdatabase.h. Amends 6be9830d865be32f224e15d13ddefd9c7e176553. Task-number: QTBUG-83255 Change-Id: I0a3807dc49128c8ddd1dfe7d725528c1a852950b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Windows font databases: Enable DirectWrite for cmakeFriedemann Kleint2020-06-152-7/+2
| | | | | | | | | | | | | | | | - Remove the DirectWrite1,2 features. Windows 10 should have them, only MinGW is missing directwrite3. The feature directwrite now implies DirectWrite2. - Remove the custom defines. - Port over the configure tests from configure.json and add missing ones for DirectWrite(2), DirectWrite3 and Direct2D and Direct2D 1.1, fix the conditions and report them in the summary. Task-number: QTBUG-83255 Fixes: QTBUG-83931 Change-Id: I1fc68997adc715bd5c6d7ec457f58c46e1f81c6a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QFontDatabase: Guard against Null-dereference READRobert Loehning2020-06-151-1/+1
| | | | | | | Fixes: oss-fuzz-23112 Pick-to: 5.15 Change-Id: I06818d8642067cd510a513838e7851eb8b322aef Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Move Unix font databases into QtGuiFriedemann Kleint2020-06-157-1/+1372
| | | | | | Task-number: QTBUG-83255 Change-Id: Id85a1e0f3de371951783fe97485158c4a02e1f15 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>