summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontdatabase.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QtGui: port from QMutex::Recursive to QRecursiveMutexMarc Mutz2019-07-061-3/+3
| | | | | Change-Id: I1ce4fcfa1bfb9a89fe3ebe61d049b9b3100fd700 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Improve performance when loading application fontsEskil Abrahamsen Blomfeldt2019-06-281-13/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since it was added in Qt 4.2, addAppFont() has been written to first register the font, then immediately invalidate the font database and later reload the font again the next time the db is used. This caused all application fonts to be reloaded *at least* once, an operation which can be quite heavy for large fonts, such as CJK fonts. If an application loaded multiple fonts at different stages of execution, you could end up loading the same fonts a large number of times, since all application fonts would be reregistered every time a new one was added. When calling removeApplicationFont(), this is okay-ish, since we need to remove all traces of the font from the platform database and clearing the whole thing is a convenient way of making sure there is nothing left. There might be more efficient ways of doing this, but unloading fonts is not a common operation, so it is fine to keep this behavior there. This change removes the invalidation of the font database from addAppFont(), since this should not be necessary as long as we are adding fonts. It also removes the reregisterAppFonts flag, which was a bit of a convoluted way of saying that the database had been invalidated and needed repopulating. Instead, we use the same mechanism as for repopulating the system database: We just check if it is currently empty, which means it has been invalidated and the application fonts have to be reregistered. It does not touch the logic in qt_cleanupFontDatabase(), which is kind of broken (it will leave application fonts in memory and reregister them if the application continues to run). But this is only actually called during shutdown (from application destructor). [ChangeLog][QtGui][Text] Fixed an issue where application fonts would be parsed multiple times, causing some unnecessary overhead when during application startup. Task-number: QTBUG-76239 Change-Id: Idfb62f73133b55e0909bb398631c8e762442e95b Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Port from QAtomic::load() to loadRelaxed()Giuseppe D'Angelo2019-06-201-2/+2
| | | | | | | | | | | | | | | Semi-automated, just needed ~20 manual fixes: $ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)load\(\)/$1loadRelaxed\(\)/g' -i \{\} + $ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)store\(/$1storeRelaxed\(/g' -i \{\} + It can be easily improved (e.g. for store check that there are no commas after the opening parens). The most common offender is QLibrary::load, and some code using std::atomic directly. Change-Id: I07c38a3c8ed32c924ef4999e85c7e45cf48f0f6c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-06-141-1/+2
|\ | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/makefile.cpp qmake/generators/unix/unixmake2.cpp src/corelib/thread/qthread_unix.cpp tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp Change-Id: I1df0d4ba20685de7f9300bf07458c13376493408
| * Merge remote-tracking branch 'origin/5.13.0' into 5.13Liang Qi2019-06-111-1/+2
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/wasm/qwasmintegration.cpp src/plugins/platforms/wasm/qwasmintegration.h Change-Id: Idf4c7936513fb1f21daa8f6105b8545f13447bb8
| | * Don't duplicate font family names in the fallback listAndy Shaw2019-05-071-1/+2
| | | | | | | | | | | | | | | | | | Fixes: QTBUG-75333 Change-Id: Iaaf4b13d50c6b9b52e629b81d5e9cbc552a0202c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | Fix font matching of typographic families on WindowsEskil Abrahamsen Blomfeldt2019-05-231-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9204b8c31ea1b5f0c05870c5b5d74c33b1a4f622 broke font matching on Windows. This was then attempted fixed by bcd2fa484a4fe93e77743195d7f72cce9e580d43, but this caused an infinite recursion for some cases, so it was reverted again by 9d1905da9c59e9062a157199c81c076efc20eb28. The original issue was that if we populate a specific face of a family, such as "Arial Black", then the typographic/preferred name will be detected as "Arial" and this family will be set as populated=true, even though we have not yet registered any additional subfamilies. In this case, we need to call populateFamily() for the typographic family name to ensure we get Windows to enumerate all the subfamilies in that family before it sets it as populated=true. But this broke for some fonts where the font naming was unconventional. In particular, "Yu Gothic" would have its Japanese name as the typographic name, and there would be no font in the system where the old-style font family name matched the typographic name. In that case we would go into a loop where we would try populating "<Japanese font name>", Windows would translate this to "Yu Gothic", we would translate it back to "<Japanese font name>", ad infinitum. In order to avoid the infinite recursion, we add a recursion guard as well, ensuring that we never call populateFamily() for the main family we are currently populating. [ChangeLog][Windows][Fonts] Fixed a bug where it would be impossible to request different faces of a font family after a specific type face has been in use. Task-number: QTBUG-74748 Task-number: QTBUG-74983 Change-Id: Ibe6239f67c45d67ebf75947c8f231cfa177e347f Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-05-131-32/+20
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qstring.cpp Change-Id: I81dbf90fc936c9bf08197baefa071117bddb1c63
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-05-091-32/+20
| |\ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qlocale_data_p.h (Regenerated by running the scripts in util/local_database/) src/gui/opengl/qopengltextureuploader.cpp Done-With: Edward Welbourne <edward.welbourne@qt.io> Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io> Change-Id: I12df7f066ed0a25eb109f61c4b8d8dea63b683e2
| | * Use "monospace" as fallback system FixedFont in KDE theme; loggingShawn Rutledge2019-05-071-32/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also de-duplicate the "monospace" string in qgenericunixthemes.cpp, and add tst_QFontDatabase::systemFixedFont() to verify that QFontDatabase::systemFont(QFontDatabase::FixedFont) really returns a monospace font across platforms. Replace commented-out qDebug()s with qt.text.font.match and qt.text.font.db logging categories to troubleshoot when the test fails (among other uses). Add qt.qpa.fonts logging category to unix themes to show default system and fixed fonts (font engines on other platforms are already using this category). Fixes: QTBUG-54623 Change-Id: I2aa62b8c783d9ddb591a5e06e8df85c4af5bcb0c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | Revert "Fix font matching of typographic families on Windows"Eskil Abrahamsen Blomfeldt2019-04-091-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit bcd2fa484a4fe93e77743195d7f72cce9e580d43. There was a report that this caused infinite recursion on some systems, so we revert it for now and re-add it later when the issue has been resolved. Task-number: QTBUG-74983 Change-Id: I747e0437232d72d7a87eb602b10fa09c7130ce8f Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | Replace Q_DECL_NOEXCEPT with noexcept in QtGuiAllan Sandfeld Jensen2019-04-051-3/+3
| | | | | | | | | | | | | | | Change-Id: I43803b88fea8083782d73ce157c466b022208740 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Fix font matching of typographic families on WindowsEskil Abrahamsen Blomfeldt2019-04-041-0/+7
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9204b8c31ea1b5f0c05870c5b5d74c33b1a4f622 broke font matching on Windows. After this change, if you request a specific face of a family, such as "Arial Black", and Qt detects that its typographic/preferred name is "Arial", then it will be added as the single style of the Arial family, which will in turn be set as populated=true. So if you later request a regular font of "Arial" family, then it will see that the family has already been populated, skip this step, and then see that there is only one style available, i.e. "Arial Black". To work around this, we need to make sure the typographic family is properly populated the first time it is registered. [ChangeLog][Windows][Fonts] Fixed a bug where it would be impossible to request different faces of a font family after a specific type face has been in use. Task-number: QTBUG-74748 Change-Id: Ia0caace2b88a32e6114ff23ad10ee1ea8f5a3e03 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Check if the string inside the families list is empty and not the listAndy Shaw2018-11-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | This amends 97f73e957756753b09a778daf2ee8f0ddb97f746 and accounts for when the minimial QPA platform is used ensuring the fallback to the QFontEngineBox. Task-number: QTBUG-71743 Change-Id: I72d45e02754fe31e31a2234d53c45e1d20dfa3d2 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Handle fonts that have commas/quotes in the family nameAndy Shaw2018-11-081-26/+28
|/ | | | | | | | | | | | | | | | | | | | | | | | Since the comma character was originally used as a separator, we need to extend QFont to have setFamilies() so that we can avoid joining the family strings together. This enables us to see the family name as a single string and for multiple family names, we have families(). Subsequently, this has added functions to QTextCharFormat to account for multiple font families too. So it is now possible to set a single one directly with setFontFamily() and multiple ones with setFontFamilies(). This also bumps up the datastream version to 19 as QFont now streams the families list as well. [ChangeLog][QtGui][QFont] Add setFamilies()/families() to aid using of font families with commas and quotes in their name. [ChangeLog][Important Behavior Changes] QDataStream version bumped up to 19 to account for changes in the serialization of QFont. Fixes: QTBUG-46322 Change-Id: Iee9f715e47544a7a705c7f36401aba216a7d42b0 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Tracepoints: refactor the existing tracepoint namesGiuseppe D'Angelo2018-06-281-4/+4
| | | | | | | | Use CamelCase, like the API they're tracing. Change-Id: Ie718ab624d17c9186bcf05cc1276c8eccad7f454 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
* macOS: Fix stretch of condensed fonts with NoFontMergingEskil Abrahamsen Blomfeldt2018-05-041-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When showing a condensed font with AnyStretch, we should not apply any stretch to the font (and if a stretch is requested, we should calculate the actual stretch based on how much the font is already stretched or condensed). This usually works as expected, however, when using QFont::NoFontMerging as the style strategy, we would scale the glyph advances by the stretch of the font since the calculated stretch of the font engine would be overwritten by the actual stretch. In the case where we use font merging, this would be done for the multi engine, so we would not get the same issue, since the text engine gets the stretch from the actual font engine and this still has the original, calculated stretch set. Note on the test: We can't use testString() for this, since it contains a space, and the test font does not have a glyph for this, so we will end up merging a different font for the space, giving us a slightly different advance. [ChangeLog][QtGui][macOS] Fixed display of condensed fonts when NoFontMerging is in use. Task-number: QTBUG-63800 Change-Id: I5b05e0dbfc8ae4b5d10c621ecb0975f53fda9483 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix integer overflow (1 << 31)Mikhail Svetkin2018-04-091-1/+1
| | | | | | | | | | On platforms where integer by default is int32(max is 2147483647) and (1 << 31) will be 2147483648 Change-Id: I59ccb5344d5ad7d085f01bbc7cebdf6152ff7755 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Support for LTTNG and ETW tracingRafael Roquetto2018-01-281-0/+10
| | | | | | | | | | This commit introduces minimal support for instrumentation within Qt. Currently, only LTTNG/Linux and ETW/Windows are supported. Change-Id: I59b48cf83acf5532a998bb493e6379e9177e14c8 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge "Merge remote-tracking branch 'origin/5.10' into dev" into ↵Liang Qi2018-01-121-0/+35
|\ | | | | | | refs/staging/dev
| * Merge remote-tracking branch 'origin/5.10' into devLiang Qi2018-01-111-0/+35
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty/harfbuzz-ng/src/hb-private.hh src/sql/doc/snippets/code/doc_src_sql-driver.cpp src/sql/doc/src/sql-driver.qdoc Change-Id: I38f0e82fcd37926cbf3c1915e009a731040d4598
| | * CoreText: Order fallback fonts based on writing system supportEskil Abrahamsen Blomfeldt2018-01-091-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After we stopped sanitizing the fallback font list (with change 6ca48a847a1805c3826004c5b989b4ae14397a37), we now need to make sure it is ordered so that the fonts that support the writing system in question are always tested first, otherwise we can end up loading a lot of fonts that will never be used. Task-number: QTBUG-65605 Change-Id: Id2a65bbff3e64e6d6e6b4f72500778ee3e811e84 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | | doc: Remove unneeded \fn commandsMartin Smith2018-01-121-0/+7
|/ / | | | | | | | | | | | | | | | | | | Removed unneeded \fn commands from two qdoc comments and moved one of the comments to the file where its function definition is located. Change-Id: I4c4371f0541d2995398b0d32e1df409433061226 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | Fix synchronization error when matching font with empty familyEskil Abrahamsen Blomfeldt2017-09-251-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently match font family names in cross-platform code, before asking the system to load it. In the case of an empty family name, we will return the first font in the list which matches the other conditions. After that, though, we would pass the empty family name to the platform font database, and some old platform-specific matching was invoked. In the case of Windows, we would default to MS Sans Serif, which is the old Windows 1.0 raster font and which is probably used by Qt exclusively in the world at this point. The problem in the end was that the font info would be out of sync. If the font matched by Qt happened to be smoothly scalable, then we would treat MS Sans Serif as smoothly scalable, giving us random glyphs when displaying text in Qt Quick. We would also overwrite the family name with the one matched by Qt, so even when MS Sans Serif was used to render the text, we would report that it was something else. For empty font families, we therefore pass the family we have actually matched into the platform database. This will have the side effect of trusting the font matching in Qt, but only for the rare case where someone actually explicitly sets the font family to the empty string. Note that the random glyph bug that triggered the investigation is not happening anymore after 1eedfd0e66c7afd682f682a659cda2942485cd08 because we will detect the glyph outlines as unreliable in the MS Sans Serif font now instead of trusting the smoothly scalable flag. But there would still be a mismatch between the font used for rendering and the matched font. Task-number: QTBUG-63147 Change-Id: I4a09ffddf9f8a0fabe7738e2944b6d874e4728f0 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Replace Q_NULLPTR with nullptr where possibleKevin Funk2017-09-191-1/+1
|/ | | | | | | | | | | | | Remaining uses of Q_NULLPTR are in: src/corelib/global/qcompilerdetection.h (definition and documentation of Q_NULLPTR) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: If6b074d91486e9b784138f4514f5c6d072acda9a Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QFontDatabase: Output family in warning about missing Open Type supportFriedemann Kleint2017-07-271-2/+4
| | | | | | | | | | OpenType support missing for script 11 becomes: OpenType support missing for "SimSun", script 11 Change-Id: I562e20d630c9cdd888f75fd99b987de5152cd77e Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* macOS: Defer population of localized font family aliases until neededTor Arne Vestbø2017-04-211-0/+4
| | | | | | | | | | | | Getting the localized family name of a font involves quite a bit of work internally in CoreText, e.g. creating and sorting font descriptors. By deferring population of family aliases until a font match misses we shave off ~1 second of startup time for applications that use non- localized font families (most applications). Change-Id: I021952c311c0d70d7769ccf764dbf997ebf30a4b Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Merge "Merge remote-tracking branch 'origin/5.7' into 5.8" into refs/staging/5.8Liang Qi2016-11-241-1/+2
|\
| * Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-11-241-1/+2
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/network/socket/qnativesocketengine_winrt.cpp tools/configure/configureapp.cpp tools/configure/environment.cpp Change-Id: Ieae6f2ee004a87f041751852b687484f91ee4480
| | * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-11-231-1/+2
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also reverts commit 0d2f0164f45cb626c40a7c95026ba00fa56ac249. Conflicts: header.BSD-NEW qmake/Makefile.win32 src/openglextensions/qopenglextensions.cpp src/openglextensions/qopenglextensions.h src/winmain/qtmain_win.cpp src/winmain/qtmain_winrt.cpp tools/configure/configureapp.cpp util/glgen/qopenglextensions.cpp.header util/glgen/qopenglextensions.h.header Change-Id: If26c6f4111b342378dd88bbdc657e322d2ab6ad8
| | | * QFontEngine: Cache whether or not a font can be smoothly scaledRobin Burchell2016-11-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will be used by QtQuick to correct a performance regression introduced by 592614ea3ecd90ede2ae1b8e6579d1b898f474ec -- QFontDatabase::isSmoothlyScalable is quite computationally expensive; and now it is unconditionally expensive regardless of the platform. Change-Id: I82bfa65a963c6c3c276d574f2b379da4a9ba5b69 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | | | Optimize fontdatabase fallbacksForFamilyAllan Sandfeld Jensen2016-11-231-1/+6
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Short-cut the case-insensitive string comparison when lengths doesn't match. This reduces the time spend in ucstricmp from 8% during start-up of the textedit example, to under 1%. Change-Id: Ib3a92900b330453289ec9eff4830dfac6a9a5da2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-11-011-15/+10
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/win/msvc_version.cpp configure.pri mkspecs/macx-ios-clang/features/default_post.prf mkspecs/macx-ios-clang/features/resolve_config.prf mkspecs/features/uikit/default_post.prf mkspecs/features/uikit/resolve_config.prf src/corelib/io/qsettings_mac.cpp src/corelib/json/qjsondocument.cpp src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/cocoa/qnswindowdelegate.h src/plugins/platforms/cocoa/qnswindowdelegate.mm src/plugins/platforms/ios/ios.pro src/plugins/platforms/ios/kernel.pro src/plugins/platforms/ios/qiosintegration.h src/plugins/platforms/minimalegl/qminimaleglintegration.cpp tests/auto/gui/painting/qpainter/tst_qpainter.cpp tools/configure/environment.cpp Change-Id: I654845e54e40f5951fb78aab349ca667e9f27843
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-271-15/+10
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/ios/ios.pro src/plugins/platforms/ios/kernel.pro src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileengineassetslibrary.h src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileengineassetslibrary.mm src/plugins/platforms/ios/optional/nsphotolibrarysupport/qiosfileenginefactory.h src/plugins/platforms/ios/qiosintegration.h src/widgets/widgets/qcombobox.cpp tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp Change-Id: Ibaee7cbbba99e7c4b1d8926e55932ffa6030ce45
| | * Android: Fix synthesized oblique for non-latin scriptsEskil Abrahamsen Blomfeldt2016-10-261-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 5e3e34731b7880ac775e8f1fa156ce016e6820f1, a default implementation of QPlatformFontDatabase::fallbacksForFamily() was added, but this implementation included only the fonts with a matching style in the returned list. The result of this was that if a font face for a specific language did not have e.g. an italic font, then we would show missing glyph boxes instead. On Android, it would be impossible to show any italic text in Chinese, Japanese, Hebrew, or Arabic. [ChangeLog][QtGui][Text] Fixed synthesized oblique for non-latin text on platforms using the basic font database, such as Android. Task-number: QTBUG-51223 Change-Id: I494d8ad87292b65d4380a2e600c1c0dc7fc8f937 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
| | * Don't claim all fonts are smoothly scalable on WindowsEskil Abrahamsen Blomfeldt2016-10-241-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since 40ebda3efbcf00c3393cb70c9eee203c68a57311, bitmap fonts are detected as smoothly scalable on Windows. While the fontsAlwaysScalable() does say whether or not the font engine can rasterize the fonts at any size, it does not determine whether or not the result is "attractive" as the documentation for isSmoothlyScalable() says. Only outline fonts are smoothly scalable, and this fact is used in Qt Quick to determine whether we can use the distance field renderer for the font or if we have to fall back to the native renderer. The consequence was that the fonts were no longer usable in Qt Quick. We also need to revert the optimization for isBitmapScalable() since there a font that is smoothly scalable should not be identified as bitmap scalable (basically this means: Font is not smoothly scalable, but it can be scaled with bitmap scaling artifacts). [ChangeLog][QtGui][Text] Fixed a regression where raster fonts on Windows were detected as smoothly scalable and thus rendering with said fonts in Qt Quick would break. Task-number: QTBUG-56659 Change-Id: Ia7db6fee8249aca347233a488388be5c3a00c2df Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Use QString::fromLatin1() less to avoid string allocationsAnton Kudryavtsev2016-09-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QString::fromLatin1 always allocates memory, but there are cases where we can avoid/reduce allocations or/and reduce text size, e.g.: QStringBuilder expressions Fix: replace QString::fromLatin1 with QL1S QString::fromLatin1().arg(String) pattern Fix: replace with QStringBuilder Overloaded functions with QL1S arg Fix: replace QString::fromLatin1 with QL1S In rare cases if there is no overloaded function with QL1S and we have deal with string literal, replace QString::fromLatin1 with QStringLiteral. Change-Id: Iabe1a3cc0830f40ef78a0548afa4368583c31def Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Use QStringBuilder more to optimize memory allocationsAnton Kudryavtsev2016-09-151-5/+2
| | | | | | | | | | | | | | | Change-Id: I2939ffa10496fdc59e0402a9cb54458565ccd657 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-09-051-0/+4
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/qt_common.prf src/plugins/platforms/windows/qwindowsdialoghelpers.cpp Change-Id: I03b92b6b89ecc5a8db7c95f04ebb92ed198098a8
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-09-051-0/+4
| |\| | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/testlib/selftests/generate_expected_output.py Change-Id: If856162abf9a24ae2c9946d336a7d1da03520fa7
| | * Ensure the fontdatabase is initialized when requesting fallbacksAllan Sandfeld Jensen2016-09-031-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise we will return an empty list of fallbacks if no QFontDatabase has been created yet. Task-number: QTBUG-55222 Change-Id: I50508162fad3206e0acf3cc6eb39aefac5c3e197 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | | Merge dev into 5.8Oswald Buddenhagen2016-08-221-1/+2
|\ \ \ | | | | | | | | | | | | Change-Id: I41ee7b50534b01cf042bed8bb8824ba2e5026a29
| * | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-08-161-1/+2
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/doc/src/qmake-manual.qdoc src/corelib/global/qglobal.cpp src/corelib/tools/qstring.cpp src/network/socket/qabstractsocket.cpp src/network/socket/qnativesocketengine_unix.cpp src/plugins/platforms/eglfs/api/qeglfsglobal.h Change-Id: Id5dfdbd30fa996f9b4b66a0b030b7d3b8c0ef288
| | * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-131-1/+1
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.cpp src/corelib/io/qsettings.cpp src/corelib/itemmodels/qstringlistmodel.cpp tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp Change-Id: I1c6c306ef42c3c0234b19907914b19da706b4a03
| | | * Doc: Change instances of '(Mac) OS X' to 'macOS'Topi Reinio2016-08-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As of version 10.12 (Sierra), the name of Apple's desktop operating system will be macOS. Change the occurrences where the Mac platform is discussed to use a macro \macos, which expands to 'macOS'. This helps with adapting to future renaming. Update the instructions on mac-specific Q_OS_* macro usage. Add a \target for the old 'Qt for OS X' topic to keep links working for other documentation modules that try to link with the old name. Change-Id: Id33fb0cd985df702a4ae4efb4c5fd428e77d9b85 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
| | * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-101-0/+1
| | |\| | | | | | | | | | | | | Change-Id: I1a63523de158757964b6fb5ea026cf69a6c5ddcf
| | | * Added pointer check in QFontDatabase::loadJesus Fernandez2016-08-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CID 11131 (#1 of 1): Dereference after null check (FORWARD_NULL)46. var_deref_op: Dereferencing null pointer fe. Change-Id: Ifc0cd0b208db511516db93c3d0e0367299df6d80 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | | | Avoid synthesizing stretch on condensed font familiesAllan Sandfeld Jensen2016-08-151-7/+8
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If an entire font family is condensed or stretched and we match by family name, the default stretch factor of 100 will make the font engine try to synthesize it back to medium stretched font. The existing code is already made to deal with a stretch of 0 that is no longer used. This patch reintroduces 0 stretch to indicate no specific stretch has been requested. Specifically setting stretch to 100 on a QFont will introduce the old behavior. [ChangeLog][QtGui][QFont] The default value of QFont::stretch() is now 0 to indicate any default stretch is acceptable. Task-number: QTBUG-48043 Change-Id: I574747f980fd4f9893df828818aae99a07b41623 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* / / make QFontDatabase().writingSystemSample for Arabic usefulFahad Al-Saidi2016-07-201-2/+10
|/ / | | | | | | | | | | | | | | | | | | | | | | The current QFontDatabase().writingSystemSample for Arabic is an arbitrary text and meaningless. This suggested text is used in LibreOffice and it makes sense for Arabic people. Task-number: QTBUG-53390 Change-Id: I7456d2741fbc07b4cfffd6151b421cb4427dd3e9 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-06-101-1/+0
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure mkspecs/macx-ios-clang/features/default_pre.prf mkspecs/macx-ios-clang/features/sdk.prf mkspecs/unsupported/freebsd-g++46/qplatformdefs.h src/widgets/styles/qgtkstyle.cpp tests/auto/corelib/io/qdiriterator/qdiriterator.pro tests/auto/corelib/io/qfileinfo/qfileinfo.pro Change-Id: Ia943555d1e59234a66f7dc65bdfda838e40001b5