summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qplatformfontdatabase.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Support variable applications fonts with DirectWriteEskil Abrahamsen Blomfeldt2023-10-021-0/+12
| | | | | | | | | | | | | | | | For GDI, there doesn't seem to be any way to do this, so it depends on selecting the DirectWrite font database explicitly. This moves the supportsVariableApplicationFonts() check into the QPlatformFontDatabase instead of the font engine, since that's where it belongs. [ChangeLog][Fonts] Added support for selecting named instances in variable application fonts when using the DirectWrite backend. Task-number: QTBUG-108624 Change-Id: I51e0fedd7a9616088a06453a1d17f48bd18fa5a7 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Rename QPlatformFontDatabase::handleAvailableFontsChanged()Tor Arne Vestbø2022-08-161-2/+8
| | | | | | | | | | | The function name was easy to mistake for a function you should call after adding fonts via e.g. registerFont or registerFontFamily, but in reality it's meant to be used when the platform font database knows that fonts have changed in a way that needs a full populate. Pick-to: 6.4 Change-Id: I4a897944aaa5df891562f729440b5d98b54f61e0 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Clarify the role of the two QPlatformFontDatabase::fontEngine overloadsTor Arne Vestbø2022-07-071-0/+18
| | | | | Change-Id: I81c59dad3479a783db8883f31e7ca9962ce959ff Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Implement missing QSupportedWritingSystems comparison operatorsTor Arne Vestbø2022-05-061-0/+20
| | | | | | | The operators were exported, but not implemented. Change-Id: I6c89c1f4b76040d2388b3a10afc6eeeb52638e1b Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* QtGui: use _L1 for for creating Latin-1 string literalsSona Kurazyan2022-04-281-2/+4
| | | | | | Task-number: QTBUG-98434 Change-Id: Idcb71c1d27125333a53b6bdd3e1af0d4c66617fa Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* macOS: Handle changes in the available fonts by invalidating font databaseTor Arne Vestbø2022-03-301-0/+12
| | | | | | | | | | | | | | | | | The user may use the Font Book application to add or remove fonts, which affects the fonts that are available to Qt applications. As the cross platform QFontDatabase implementation currently doesn't support granular management (removal) of fonts, we need to invalidate the entire font database. Since the theme fonts on macOS (and iOS) are managed by the font database we also need to invalidate the theme fonts, and report this back to the application. Change-Id: I1f6a7900f76e0b6a1f059bd43638a04bc0808e20 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QPlatformFontDatabase: Don't copy metaobjectsUlf Hermann2021-10-071-2/+2
| | | | | | | | This is expensive and unnecessary here. Change-Id: I542c0309db5839c696f51b066cd5423a63468438 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Rename QLibraryInfo::location() to path()Lars Knoll2020-09-121-1/+1
| | | | | | | | As per ### Qt6 comment. Also rename the LibraryLocation enum to LibraryPath. Change-Id: I556025a19c5bcdf2ff52598eaba32269522d4128 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use OpenType font weightsJonas Karlsson2020-08-281-29/+0
| | | | | | | 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>
* Remove the QPF2 font engineEskil Abrahamsen Blomfeldt2020-08-241-71/+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 QList instead of QVector in gui implementationJarek Kobus2020-07-071-8/+8
| | | | | | | 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>
* QtGui: Fix duplication of logging category lcQpaFontsFriedemann Kleint2020-06-181-0/+2
| | | | | | | | | Move it to qplatformfontdatabase.h. Amends 6be9830d865be32f224e15d13ddefd9c7e176553. Task-number: QTBUG-83255 Change-Id: I0a3807dc49128c8ddd1dfe7d725528c1a852950b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Enabler: Store more properties of application fontsEskil Abrahamsen Blomfeldt2020-03-061-1/+13
| | | | | | | | | | | | | | The family name of a font is ambiguous and without additional information there is no way to separate one font from another inside that family. In order to make it possible to expose more info about application fonts from FontLoader in Qt Quick, we need to store them in the font database. Task-number: QTBUG-68829 Change-Id: I931e1c2c004437ac0a21d4d88e55d176de676f34 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* DirectWrite font db: Fix writing system detectionEskil Abrahamsen Blomfeldt2020-02-201-0/+26
| | | | | | | | | | The implementation here was accidentally missing from the first commit. We use the OS/2 table for determining the writing system support as intended by the font designer, and fall back to actually checking the Unicode ranges if the table should be missing. Change-Id: Ibfdf76c27f3a94eda2142b3e269a1ca30d4bc045 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Replace most use of QVariant::type and occurrences of QVariant::TypeOlivier Goffart2020-01-231-1/+1
| | | | | | | | | | | | | | | | | | | | | I made a clazy automated check that replaced the use of QVariant::Type by the equivalent in QMetaType. This has been deprecated since Qt 5.0, but many uses were not yet removed. In addition, there was some manual changes to fix the compilation errors. Adapted the Private API of QDateTimeParser and QMimeDataPrivate and adjust QDateTimeEdit and QSpinBox. QVariant(QVariant::Invalid) in qstylesheet made no sense. But note that in QVariant::save, we actually wanted to use the non-user type. In the SQL module, many changes were actually reverted because the API still expects QVarient::Type. Change-Id: I98c368490e4ee465ed3a3b63bda8b8eaa50ea67e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Tidy nullptr usageAllan Sandfeld Jensen2019-12-061-1/+1
| | | | | | | | | | | Move away from using 0 as pointer literal. Done using clang-tidy. This is not complete as run-clang-tidy can't handle all of qtbase in one go. Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Port from QAtomic::load() to loadRelaxed()Giuseppe D'Angelo2019-06-201-1/+1
| | | | | | | | | | | | | | | 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>
* Fix font matching of typographic families on WindowsEskil Abrahamsen Blomfeldt2019-05-231-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Revert "Fix font matching of typographic families on Windows"Eskil Abrahamsen Blomfeldt2019-04-091-11/+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>
* Fix font matching of typographic families on WindowsEskil Abrahamsen Blomfeldt2019-04-041-0/+11
| | | | | | | | | | | | | | | | | | | | | | | 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>
* Doc: Add missing full stops in briefsPaul Wicking2018-06-211-1/+1
| | | | | | Task-number: QTBUG-68933 Change-Id: I3f2a9f8c562f9a44bb32bddd31d75abbfe6de04d Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* doc: Remove unneeded \fn commandsMartin Smith2018-01-121-13/+0
| | | | | | | | | | 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>
* Add debug operators for font database structs for easier debuggingTor Arne Vestbø2017-04-181-0/+21
| | | | | Change-Id: Ice1b27ff93de2d369dc6b66c72a64eb05da5639c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Share FreeType font engine creation code between platformsTor Arne Vestbø2017-04-041-10/+0
| | | | | | | | | | The FreeType font engine setup is spread out between factory functions, constructors, and init() functions, so let's at least try to share as much as possible of it to make it easier to reason about and possibly refactor in the future. Change-Id: Ic39353d2b3111024e0589a70211bac80feb8498e Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* doc: Moved two qdoc commentsMartin Smith2017-01-051-5/+6
| | | | | | | | They were simply not postioned correctly relative to the functions they were meant to document. Change-Id: I6eef94b291ae4ffe343d2728cc32477f55b2a871 Reviewed-by: Martin Smith <martin.smith@qt.io>
* Use QStringBuilder more to optimize memory allocationsAnton Kudryavtsev2016-09-151-4/+2
| | | | | Change-Id: I2939ffa10496fdc59e0402a9cb54458565ccd657 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtGui: use printf-style qWarning/qDebug where possible (I)Marc Mutz2016-03-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The printf-style version of QDebug expands to a lot less code than the std::ostream-style version. Of course, you pay in type safety (but compilers warn about it these days), you cannot stream complex Qt types and streaming QStrings is awkward, but in many cases you actually improve on readability. But the main reason is that something that's not supposed to be executed under normal operation has no business bloating executable code size. This is not an attempt at converting all qWarnings() to printf-style, only the low-hanging fruit. In this first part, replace qWarning() << "..."; with qWarning("..."); In QTransform shared warning strings. Saves 3KiB in text size on optimized GCC 5.3 AMD64 builds. Change-Id: I142a8020eaab043d78465178192f2c8c6d1cc4f9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Give names to enum used in templates.Rolland Dudemaine2015-12-041-1/+1
| | | | | | | | The GHS toolchain needs names for enumerations that are used for template instantiation. Change-Id: I4e184cd77074fd7ece89f21317536e6006ab257d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.5' into devFrederik Gladhorn2015-08-061-8/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: doc/global/qt-cpp-defines.qdocconf src/3rdparty/forkfd/forkfd.c src/corelib/codecs/qtextcodec.cpp src/corelib/kernel/qmetatype.cpp src/corelib/tools/qset.qdoc src/gui/accessible/qaccessible.cpp src/gui/image/qpixmapcache.cpp src/opengl/qgl.cpp src/tools/qdoc/generator.cpp src/widgets/kernel/qwidget.cpp tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp Change-Id: I4fbe1fa756a54c6843aa75f4ef70a1069ba7b085
| * Default implementation for QPlatformFontDatabase::fallbacksForFamily()Konstantin Ritt2015-07-311-8/+6
| | | | | | | | | | | | | | | | | | ...mainly for platforms that do not provide a native/unified way to obtain system-defined font fallbacks list (ie !CoreText && !FontConfig). Change-Id: I23c5589d79ddecb6311ccc52ec8b29977f06d408 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | QPlatformFontDatabase: compress an array of ushortsMarc Mutz2015-07-161-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | First, all values in the array fit into 8-bit, so change the type from ushort to quint8. Then, instead of appending a zero as end marker, statically determine the size of the array and use that number. Also fixes (benign) off-by-one error in the existing reserve() call. Change-Id: Id05b6a56b55d2e0769b00496a55808bb7351b084 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | QPlatformFontDatabase: compress requiredUnicodeBits tableMarc Mutz2015-07-131-1/+1
|/ | | | | | | | | All values in the table fit into 8 bits, so don't use a 16-bit type. Change-Id: I685727e16a264a49ea501d36eb6815c6d5aaa9b2 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Fix undefined behavior in left-shifting into negativeThiago Macieira2015-05-041-1/+1
| | | | | | | | | | | | It's undefined behavior to left or right-shift a signed integer such that the sign changes. Since SymbolCsbBit is 31, make sure we use unsigned numbers. Found by ICC qplatformfontdatabase.cpp(614): error #68: integer conversion resulted in a change of sign Change-Id: Idf715b895bac4d56b4afffff13da78d294b1248e Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Better detection of Symbol fontsKonstantin Ritt2015-03-261-1/+7
| | | | | | | | | | | | | | > Symbol character sets have a special meaning. > If the symbol bit (31) is set, and the font file contains a 'cmap' > subtable for platform of 3 and encoding ID of 1, > then all of the characters in the Unicode range 0xF000 - 0xF0FF > (inclusive) will be used to enumerate the symbol character set. If we detected the font has a symbol character set, report no other writing systems support. Change-Id: I1030f3339c166ffd03c7caee1b1b26010dfdc314 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Detect Thai writing system support from the font's Code Page BitfieldsKonstantin Ritt2015-03-261-0/+6
| | | | | | | https://msdn.microsoft.com/en-us/library/windows/desktop/dd317754(v=vs.85).aspx Change-Id: I893746210dc71b9de6f6c064fd9fcaf6340e3c71 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* FreeType: Support RGB rendering when not using FontConfigSérgio Martins2015-02-141-0/+12
| | | | | | | | | | | | | | | | | Windows+FreeType, Linux with -no-fontconfig and the forthcoming OSX FreeType engine can now use sub pixel rendering. The function to get the subpixel type is in QPlatformScreen because we're moving to per screen font settings in the future. This patch is safe, as no functionality is changed for existing users, if one wants sub pixel rendering they'll still have to pass -DFT_CONFIG_OPTION_SUBPIXEL_RENDERING to configure. Task-number: QTBUG-44269 Change-Id: Ib6c22d48a1b7c7b85ee316d5d9e3b6eae0c1ecc0 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Add QFont::Weight enum valuesPierre Rossi2014-12-121-0/+28
| | | | | | | | | | And try to make good use of them in order to match the QFont request more closely. Task-number: QTBUG-38482 Change-Id: I768dfa8828e370d77a1c17ecf4796d750b3edd9b Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Merge QFontEngineMultiBasicImpl and QFontEngineMultiKonstantin Ritt2014-11-261-1/+1
| | | | | | | Minor refactoring also improves the behavior and the code readability. Change-Id: Id89dd224f4132a4c0dfbc16f414ef42cc8d8a4da Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-09-231-53/+51
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The isAlwaysAskOption was removed in 38621713150b663355ebeb799a5a50d8e39a3c38 so manually removed code in src/plugins/bearer/connman/qconnmanengine.cpp Conflicts: src/corelib/global/qglobal.h src/corelib/tools/qcollator_macx.cpp src/corelib/tools/qstring.cpp src/gui/kernel/qwindow.cpp src/gui/kernel/qwindow_p.h src/gui/text/qtextengine.cpp src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h src/plugins/platforms/android/qandroidinputcontext.cpp src/plugins/platforms/xcb/qglxintegration.cpp src/plugins/platforms/xcb/qglxintegration.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/testlib/qtestcase.cpp src/testlib/qtestlog.cpp src/widgets/dialogs/qfiledialog.cpp src/widgets/kernel/qwindowcontainer.cpp tests/auto/corelib/tools/qcollator/tst_qcollator.cpp tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp Change-Id: Ic5d4187f682257a17509f6cd28d2836c6cfe2fc8
| * Revert "Make unicode ranges in font take precedence over codepage"Eskil Abrahamsen Blomfeldt2014-08-281-53/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 3a84d92f5736da3dc3f6a385bf3723984a5640ed because it caused a regression with certain fonts on Windows that have divided information about writing system support in unicode ranges and codepage ranges. The original commit fixed a problem on Android where one of the fonts had an entry for Arabic in its codepage range but no glyphs for this script. This issue has been fixed in a different way now, by 0b87f4f6c912a508f170cd25ff5317bb77665fa9 which makes fallback fonts work properly, so the commit is no longer needed to fix said bug. [ChangeLog][Fonts] Fixed regression in font families returned by QFontDatabase::families() for certain writing systems. Task-number: QTBUG-39846 Change-Id: I3077b1e618b21680549abc1734cb6df6e264387e Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-08-121-0/+10
|\| | | | | | | | | | | | | | | | | | | | | | | Manually included changes from 3a347a4e70e5a10ee92dd2578316c926a399e894 in src/opengl/qgl.cpp. Conflicts: src/opengl/qgl_qpa.cpp src/plugins/platforms/android/androidjnimain.cpp Change-Id: Ic26b58ee587d4884c9d0fba45c5a94b5a45ee929
| * Font Database: Add support for private, system UI font familiesGabriel de Dietrich2014-08-111-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We introduce QPlatformFontDatabase::isPrivateFontFamily() to allow testing for private, system UI font families. Both QFontComboBox and QFontDialog need to filter out those private font families which, by definition, should be hidden from the end user. (The textedit example had to be updated to fix the issue where the default font would be private. In 5.4, we will be adding an equivalent, public API in QFontDatabase, and a better solution for the textedit example and QTexEdit in general). In particular, on OS X and iOS, private fonts are used for the system UI font. Those have their font family name prefixed by a dot. QCoreTextFontDatabase knows about this, and makes sure those are tested positive as private font families. In order to have a cleaner layer separation, we moved the QPA theme font resolution from the platform theme classes into QCoreTextFontDatabase for both Cocoa and iOS QPA plugins. In both cases, we use CoreText's CTFontCreateUIFontForLanguage(), that nicely maps to the HITheme API we were using so far on Mac. That means one HITheme dependency less. We also cache the font descriptors we get for these font for each time QCTFD::populateFamilies() gets called. (While not common, this currently happens in auto-tests, like tst_QFontDatabase, and could happen in actual applications -- specially when adding and removing application fonts.) Change-Id: Ic6f0b60f9f597afee1a43596a669742dc546b97f Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* | qpa: Clean up and refactor qfontengine_qpaTor Arne Vestbø2014-05-151-9/+9
|/ | | | | | | | | | | QFontEngineQPA was really QFontEngineQPF2, and has been renamed. The multi font engine in qfontengine_qpa.cpp was really a base implementation of a multi font engine, used by other multi font engines, and has been renamed and moved accordingly into qfontengine_p.h/cpp. Change-Id: Iac7409c4dbf0fdc3ee993ce4f7dc96cb00a422e6 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Teach font database to populate families lazilyTor Arne Vestbø2014-03-201-1/+31
| | | | | | | | | | | | | | | | | | | | | | Instead of requiring that QPlatformFontDatabase::populateFontDatabase() populates every single font in the system by calling registerFont(), we now allow the platform database to call registerFontFamily() instead, and then keep track of which families we've yet to fully populate in the font database. Once a property of a family is requested (such as its writing system, style, etc), the family is lazily populated by calling back to the platform database through QPlatformFontDatabase::populateFamily(), which in turn does the final call to registerFont() as before. This cuts application startup on OS X and iOS (of which the font population used to be a major limiting factor) from roughly one second to about 350ms. Task-number: QTBUG-37165 Change-Id: Ic2fc3447beb818ffe23635a5b7816ed7e70c93a7 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Prevent repeated and unnecessary font population QCoreTextFontDatabaseTor Arne Vestbø2014-03-051-0/+10
| | | | | | | | | | | | | | | | | | | | | | The platform font database is populated from QFontDatabase, through the static initializeDb() function, whenever the font database determines that the platform database has not been initialized (by checking if the font database is empty). There are other clients of QPlatformFontDatabase though, such as QFont, which uses the platform font database to check for the default family. The CoreText implementation of determining the default family relies on data that is computed during font population, and hence does an internal (self-triggered) populate. To prevent repeated populates as a result of calling QFont::defaultFamily() we guard the populate by a similar isEmpty() check as QFontDatabase does, but to ensure that this check works in the case of an invalidated font database, we need to propagate the font database invalidation down to the platform font database. Change-Id: I8d06c6f6fc5da6353c087335859eaca008c2f6a6 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2014-02-241-51/+53
|\ | | | | | | Change-Id: I3199d47f7d450853032ea5aa38cd4c7c30b9a3d0