summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/text/qfontdatabase
Commit message (Collapse)AuthorAgeFilesLines
* Add API to provide user-defined fallback fontsEskil Abrahamsen Blomfeldt2024-04-181-0/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | When depending on Qt's font merging for providing glyphs for certain languages, there are currently some drawbacks. For one, you will typically get a system font which might not fit together with the main font of the application. In addition, you might get some glyphs from one font and other from another (typically for Chinese where the character sets are so large that fonts will often only implement parts). And finally, you may get the wrong glyphs for writing systems with regional differences, if your application is e.g. written in Japanese and then run on a Chinese system, you might get Chinese versions of characters which are shared between the languages. Without language-based font matching in Qt, there's no silver bullet for fixing this. This patch introduces API which makes it possible for users to provide the solution themselves, either by selecting application-provided fonts as fallbacks for certain scripts or by hardcoding system fonts for a specific language. [ChangeLog][Fonts] Added API to override default fallback font families for specific scripts. Task-number: QTBUG-121131 Change-Id: I23ee17b7dfe1c1e481c87cc67a05a0522841b598 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Tests: check the output of QFile::openGiuseppe D'Angelo2024-03-271-1/+1
| | | | | | | | | | Wrap the call in QVERIFY. tst_QTextStream::read0d0d0a was also faulty as it *never* opened the file because of a broken path. Fix it with QFINDTESTDATA. Change-Id: I61a8f83beddf098d37fda13cb3bfb4aaa4913fc5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Change license for tests filesLucie Gérard2024-02-041-1/+1
| | | | | | | | | | | | According to QUIP-18 [1], all tests file should be LicenseRef-Qt-Commercial OR GPL-3.0-only [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: I9657df5d660820e56c96d511ea49d321c54682e8 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* Implement missing features in DirectWrite font backendEskil Abrahamsen Blomfeldt2024-02-021-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The DirectWrite font backend is an optional backend which is planned to take over as the default on Windows. In order to do this, though, a few gaps need to be filled in order for it to pass all autotests. The following things are covered by this: 1. Bitmap fonts are unsupported in DirectWrite. We enumerate these using GDI and fall back to the GDI font engine when loading them. As part of this, we introduce a new handle type for fonts on Windows which can represent both the DirectWrite and GDI engines. 2. "Legacy font names" where sub-family is embedded in the family name is now enumerated together with the typographic font name. 3. The DirectWrite font engine was not loading kerning pairs from the font, like the other engines (omission which was detected by the test) 4. Turning off antialiasing does not work with DirectWrite, so we fall back to GDI for this. 5. Loading supported writing systems from application fonts was not supported. Task-number: QTBUG-119420 Change-Id: Icf6c351afb0d7487b2f4634199088d701a324aae Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* coretext: Support variable application fontsEskil Abrahamsen Blomfeldt2023-10-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | Named instances of variable application fonts are exposed automatically through CTFontManagerCreateFontDescriptorsFromData() (and also for the URL equivalent). The main change here is just to call this instead of the overload which only returns the first font. Note that this also updates the test: This is because the conversion from CoreText normalized weight values to TTF values is not 100%. In the CoreText code, we map Heavy (0.56) to ExtraBold, but ExtraBold gets converted to 0.6, which is closer to the CoreText value for Black (0.62). To avoid hitting this inconsistency, the QtExtraBold has been changed to Black weight instead, which resolves to the same on all platforms. Task-number: QTBUG-108624 Change-Id: Ied6d42e9e3e1ba8b7102936c5be3d285b3d9e07f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Support variable applications fonts with DirectWriteEskil Abrahamsen Blomfeldt2023-10-021-5/+6
| | | | | | | | | | | | | | | | 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>
* Support loading variable fonts as application fonts in FreetypeEskil Abrahamsen Blomfeldt2023-09-202-0/+51
| | | | | | | | | | | | | | | | When loading the fonts, we go through all the named instances and register these as subfamilies. In addition to exposing these variants by style name, we also register them with the according weights, italic style and stretch. This adds a field to FontFile to allow piping the instance index through to when we instantiate the face. [ChangeLog][Fonts] Added support for selecting named instances in variable application fonts when using the Freetype backend. Task-number: QTBUG-108624 Change-Id: I57ef6b4802756dd408c3aae1f8a6c792a89bee6a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* tests: port assorted trivial uses of Q_FOREACH to ranged for loopsMarc Mutz2023-08-141-2/+2
| | | | | | | | | | | | | | | | | | | | All of these fall into the trivial category: loops over (readily made) const local containers. As such, they cannot possibly depend on the safety copy that Q_FOREACH performs, so are safe to port as-is to ranged for loops. There may be more where these came from, but these were the ones that stood out as immediately obvious when scanning the 100s of uses in qtbase, so I preferred to directly fix them over white-listing their files with QT_NO_FOREACH (which still may be necessary for some files, as this patch may not port all uses in that file). Pick-to: 6.6 6.5 Task-nubmber: QTBUG-115839 Change-Id: I7b7893bec8254f902660dac24167113aca855029 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* CMake: Make gui tests standalone projectsAlexandru Croitor2023-07-051-0/+6
| | | | | | | | | | | | | | | | | Add the boilerplate standalone test prelude to each test, so that they can be opened with an IDE without the qt-cmake-standalone-test script, but directly with qt-cmake or cmake. Boilerplate was added using the following scripts: https://git.qt.io/alcroito/cmake_refactor Manual adjustments were made where the code was inserted in the wrong location. Task-number: QTBUG-93020 Change-Id: I2ef59684cf297a0222a136ce7b5630037294d000 Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* tests: Remove remains of qmake conversion from CMakeLists.txt filesFriedemann Kleint2023-02-171-2/+0
| | | | | | | Pick-to: 6.5 Change-Id: I8d106554bb86ac1ec9bb7a4083de4c376bcbab1d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Port from container::count() and length() to size() - V5Marc Mutz2022-11-031-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8, but extended to handle typedefs and accesses through pointers, too: const std::string o = "object"; auto hasTypeIgnoringPointer = [](auto type) { return anyOf(hasType(type), hasType(pointsTo(type))); }; auto derivedFromAnyOfClasses = [&](ArrayRef<StringRef> classes) { auto exprOfDeclaredType = [&](auto decl) { return expr(hasTypeIgnoringPointer(hasUnqualifiedDesugaredType(recordType(hasDeclaration(decl))))).bind(o); }; return exprOfDeclaredType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes)))); }; auto renameMethod = [&] (ArrayRef<StringRef> classes, StringRef from, StringRef to) { return makeRule(cxxMemberCallExpr(on(derivedFromAnyOfClasses(classes)), callee(cxxMethodDecl(hasName(from), parameterCountIs(0)))), changeTo(cat(access(o, cat(to)), "()")), cat("use '", to, "' instead of '", from, "'")); }; renameMethod(<classes>, "count", "size"); renameMethod(<classes>, "length", "size"); except that the on() matcher has been replaced by one that doesn't ignoreParens(). a.k.a qt-port-to-std-compatible-api V5 with config Scope: 'Container'. Added two NOLINTNEXTLINEs in tst_qbitarray and tst_qcontiguouscache, to avoid porting calls that explicitly test count(). Change-Id: Icfb8808c2ff4a30187e9935a51cad26987451c22 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-231-1/+1
| | | | | | | Task-number: QTBUG-105718 Change-Id: I5d3ef70a31235868b9be6cb479b7621bf2a8ba39 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Add license headers to cmake filesLucie Gérard2022-08-031-0/+3
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: I3b98cdc55ead806ec81ce09af9271f9b95af97fa Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* CMake: Don't use PUBLIC_LIBRARIES for tests and test helpersAlexandru Croitor2022-07-281-1/+1
| | | | | Change-Id: I9b7404e1d3a78fe0726ec0f5ce1461f6c209e90d Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-27/+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>
* Replace uses of _qs with _s in testsSona Kurazyan2022-04-071-5/+7
| | | | | | Task-number: QTBUG-101408 Change-Id: If092a68828a1e8056259cf90d035d9a87989244b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* CI: Blacklist systemFixedFont for QNXPasi Petäjäjärvi2022-03-021-1/+3
| | | | | | | | | | QNX tests are run under QEMU so have the same problem as b2qt Pick-to: 6.2 6.3 Task-number: QTBUG-100948 Change-Id: I2abc8a4bca9e8ba414197721301d493296e7ce0b Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Make Droid Sans Mono available as fixed font for all Android stylesAndreas Buhr2022-02-141-3/+0
| | | | | | | Fixes: QTBUG-87405 Change-Id: I54ebc06c82c32acd0383ea5fedf78acce4e11977 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Remove QEXPECT_FAIL for test passing on AndroidVolker Hilsheimer2022-01-291-3/+0
| | | | | | | | | | | | The test has been XPASS'ing recently on Android. Reverts 67e209f59fed638e93402bf2eb63fba56195e244. Fixes: QTBUG-69216 Change-Id: Ic629cc28936e0ef27277c243717e97226bf01b1c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Dimitrios Apostolou <jimis@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Remove unused .qrc filesJoerg Bornemann2022-01-171-9/+0
| | | | | | | | Task-number: QTBUG-94446 Change-Id: I136d8b4ab070a832866aa50b5701fc6bd863df8a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QFontDatabase (Windows): Sanitize font requests earlyMårten Nordheim2021-12-061-0/+31
| | | | | | | | | | | | | | | | | | | After the windows font engine was no longer marking everything as scalable we started limiting the font size of requests to the maximum of Courier when it was requested. This was a regression from 5.8 and not in agreement with our documentation. The problem is that we would only make the switch from Courier to Courier New after having already gone through the foundry-lookup and found a closest-available font size for Courier. With this sanitization step in the backend we can make these changes early enough that we haven't yet adjusted e.g. the font size. Pick-to: 6.2 5.15 Fixes: QTBUG-58995 Change-Id: I319e93e6b78c7c3c5539964ac5ab4e05f8902ab6 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Properly fix QFontDatabase test on FreetypeEskil Abrahamsen Blomfeldt2021-11-191-1/+3
| | | | | | | | | | | | Amends 4dd5020fbdfdd34f1e4ec54521217e472942a4b4. I messed up the fix for the XFAIL condition, since the font engine type we get from a normal QFont will be QFontEngine::Multi regardless of whether the actual font engines are Freetype or not. Use NoFontMerging to avoid this. Pick-to: 6.2 Task-number: QTBUG-97995 Change-Id: I2298c997e6826e667dbb8e3d004821f296625ef7 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix tst_qfontdatabase on Windows with FreetypeEskil Abrahamsen Blomfeldt2021-11-101-1/+5
| | | | | | | | | | | Since e05e3c776256d35798f451f31cd71e809786ed78, the advance test in tst_QFontDatabase::condensedFontMatching() passes with the bundled freetype engine, so the XFAIL causes a failure when running with this configuration. Pick-to: 6.2 Change-Id: Ie6fbccfa0d9c79654563e9e3f19694f252e32fc6 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Respect font stretch if set together with font styleAlbert Astals Cid2021-10-041-0/+24
| | | | | | Fixes: QTBUG-77854 Change-Id: I2bf9cea9d5ecd151a9d96bbe93e9477a9159ca1f Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix querying font aliases that share name with other fontsEskil Abrahamsen Blomfeldt2021-09-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a332f3fabc29f796526202648eddf35a24f1cb67 disabled resolving all fonts on the system for every font lookup, which was a significant startup time improvement. But it also caused a regression: When a font has an alias which shares the name of a proper font, then this would not be resolved correctly. This is fairly typical on Windows/GDI due to backwards-compatibility. Instead of being collected under a shared typographical family, fonts are disambiguated by adding the style name to the family name. The proper typographical name is still available, but this is not enumerated by the system. So "Segoe UI" for instance, will be available as "Segoe UI", "Segoe UI Light", "Segoe UI Bold" etc. When we populate family aliases, we register that "Segoe UI Light" is actually "Segoe UI" with Light weight, and prior to a332f3fabc29f796526202648eddf35a24f1cb67 this would be done implicitly. But after the optimization, we would only populate family aliases once we stumbled over a font request for a non-existent font. For "Segoe UI", we would simply return the regular weight font as the best imperfect match. The fix is to populate font family aliases not only when the family is non-existent, but when the match is imperfect, e.g. if we are asking for a Light weight font and only finding a regular one. User code can still avoid this somewhat expensive operation by using the full family names on Windows. This also requires a fix to a test. When removeApplicationFont() is called, we invalidate the font database, so it will be reset to a state that does not contain the family aliases. Therefore we cannot guarantee that it is identical to what it was before the test started, since this depends on what has happened previously in the application. [ChangeLog][QtGui][Text] Fixed an issue where some font styles and weights would not be selectable. This was especially noticeable on Windows. Pick-to: 5.15 6.1 6.2 Fixes: QTBUG-94835 Change-Id: I892855edd1c8e3d3734aace396f6000d897d2ec4 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Remove the qmake project filesJoerg Bornemann2021-01-071-8/+0
| | | | | | | | | | | | | | | | Remove the qmake project files for most of Qt. Leave the qmake project files for examples, because we still test those in the CI to ensure qmake does not regress. Also leave the qmake project files for utils and other minor parts that lack CMake project files. Task-number: QTBUG-88742 Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Replace QtTest headers with QTestDavid Skoland2020-12-221-1/+2
| | | | | | | | | | | Complete search and replace of QtTest and QtTest/QtTest with QTest, as QtTest includes the whole module. Replace all such instances with correct header includes. See Jira task for more discussion. Fixes: QTBUG-88831 Change-Id: I981cfae18a1cabcabcabee376016b086d9d01f44 Pick-to: 6.0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix tst_QFontDatabase::aliases failure with ambiguous fontEskil Abrahamsen Blomfeldt2020-12-021-1/+12
| | | | | | | | | | | | | | | | | | | | | | | If the first font in the families list happens to have been disambiguated because of duplicates, two things went wrong: 1. hasFamily() would return false for the font family, because it does not disambiguate when checking for the family name and only checks if the families list contains the exact string. 2. Adding aliases to the full disambiguated string is not supported, only the family name. The first issue has been reported separately as QTBUG-89068. The test failure is fixed by just avoiding the fonts that are ambiguous in the test, as it really doesn't matter which font we pick. Fixes: QTBUG-89008 Pick-to: 5.15 6.0 Change-Id: I829778c2e7bb6090475c34dcf9cdce58862729d6 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Android: blacklist a list of failing tests for androidAssam Boudjelthia2020-11-041-0/+3
| | | | | | | | | | | | | | | | We want to re-enable Android tests in QTQAINFRA-3867. However, many tests are failing already preventing that from happening. QTBUG-87025 is currently keeping track (links) to all of those failing tests. The current proposal is to hide those failing tests, and enable Android test running in COIN for other tests. After, that try to fix them one by one, and at the same time we can make sure no more failing tests go unnoticed. Task-number: QTBUG-87025 Change-Id: Ic1fe9fdd167cbcfd99efce9a09c69c344a36bbe4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Get rid of all instance usage of QFontDatabaseVolker Hilsheimer2020-11-031-29/+18
| | | | | | | | All QFontDatabase APIs are static, use them accordingly. Task-number: QTBUG-88114 Change-Id: I0e4a7508646037e6e2812611262eed8b6d7ad3de Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-09-231-2/+2
| | | | | | | | | | | Modify special case locations to use the new API as well. Clean up some stale .prev files that are not needed anymore. Clean up some project files that are not used anymore. Task-number: QTBUG-86815 Change-Id: I9947da921f98686023c6bb053dfcc101851276b5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Make QFontDatabase member functions staticEskil Abrahamsen Blomfeldt2020-08-061-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* CMake: Regenerate tests with new qt_ prefixed APIsAlexandru Croitor2020-07-091-2/+2
| | | | | | | | Use pro2cmake with '--api-version 2' to force regenerate projects to use the new prefixed qt_foo APIs. Change-Id: I055c4837860319e93aaa6b09d646dda4fc2a4069 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Regenerate projects one last time before mergewip/cmakeAlexandru Croitor2020-02-121-3/+2
| | | | | | Change-Id: Ia24cf56b79ca6dacd370a7e397024e9b663e0167 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Post Merge FixesLeander Beernaert2020-01-241-0/+4
| | | | | Change-Id: I1e06c01b76b119c3f23b6e6ecbaae8df719b70ce Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Merge remote-tracking branch 'origin/dev' into merge-devLeander Beernaert2020-01-242-0/+30
|\ | | | | | | Change-Id: I31b761cfd5ea01373c60d02a5da8c33398d34739
| * QWindowsFontDatabase: Check preferred family names for all fontsMårten Nordheim2019-11-292-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code was initially introduced in 9204b8c31ea1b5f0c05870c5b5d74c33b1a4f622 but getting the names were conditioned on whether or not Windows identified it as a truetype font. This excluded cases which had preferred names embedded but was not truetype fonts. To fix that we run the code unconditionally. [ChangeLog][Windows] Fixed a bug where some fonts would not be accessible by referencing their typographic name. Fixes: QTBUG-78556 Change-Id: I8823684b09cce3b1b8722b1e609a5bb49b13da13 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | cmake: add tests/auto/gui/textFrederik Gladhorn2019-11-011-0/+44
|/ | | | | | | Fixes: QTBUG-78228 Change-Id: I3d4666a553e94de47e01d64551b8fe672994b137 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.13' into devFriedemann Kleint2019-05-271-1/+0
|\ | | | | | | Change-Id: Ia279fc4a8226626041c772902a07b2f90f37b53b
| * winrt: Return monospace font for ↵Oliver Wolff2019-05-151-1/+0
| | | | | | | | | | | | | | | | | | QFontDatabase::systemFont(QFontDatabase::FixedFont) Fixes: QTBUG-75648 Change-Id: I0e5e5e012d3cd5985d1e9a63e776e73ce2d7bf98 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-05-132-0/+16
|\| | | | | | | | | | | | | Conflicts: src/corelib/tools/qstring.cpp Change-Id: I81dbf90fc936c9bf08197baefa071117bddb1c63
| * Use "monospace" as fallback system FixedFont in KDE theme; loggingShawn Rutledge2019-05-072-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Don't rely on functions that are deprecatedLars Knoll2019-05-061-2/+2
|/ | | | | Change-Id: I4150368e44b43e45f3604bf0fc7dab38a15e5ec9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Read font selection flags and use them when querying for metricsMårten Nordheim2018-11-302-0/+30
| | | | | | | | | | | | Certain fonts with multiple styles have the same family name. When loading these as application fonts we were not specific enough when querying for the text metrics. This meant that e.g. the bold version in a font family would get the metrics of the regular one. Fixes: QTBUG-67273 Change-Id: Ic988d62cddde0a1f77ddcaf2891cadc21c9b31e6 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-07-171-0/+3
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/xcb/qxcbintegration.cpp Conflicts git missed: src/plugins/platforms/qnx/qqnxglcontext.cpp Change-Id: I0582cdc9e66e43efe79038b9c43d4f9572ac88fc
| * Android: QEXPECT_FAIL tst_QFontDatabase::condensedFontMatchingMårten Nordheim2018-06-301-0/+3
| | | | | | | | | | | | Task-number: QTBUG-69216 Change-Id: I7da5396a62b87109609749f9ef7e9a1a7b6c6db8 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
* | macOS: Fix stretch of condensed fonts with NoFontMergingEskil Abrahamsen Blomfeldt2018-05-041-0/+24
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Update usage of QFontMetrics::width() to new APIEskil Abrahamsen Blomfeldt2017-12-081-5/+5
| | | | | | | | | | | | | | QFontMetrics(F)::width() has been deprecated and is replaced by horizontalAdvance(). This updates all usage of it in tests and documentation. It is worth noting that many or most of the usages of QFontMetrics::width() probably intended to use boundingRect().width(), but since it currently works, I have not looked into that, just replaced the function name mechanically. Change-Id: Iec382e5bad0b50f37a6cfff841bfb46ed4d4555f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Ensure that tst_QFontDatabase::addAppFont() tests the whole path to an engineTor Arne Vestbø2017-03-311-2/+7
| | | | | | Change-Id: Ie22cd9d7d362de86e02b841d40d75eac46395952 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Register fonts with preferred names on WindowsAllan Sandfeld Jensen2016-11-231-0/+4
| | | | | | | | | | | | | Looks up the canonical names of enumerated fonts and register them under their preferred names if present. Also changes the logic handling registration of english aliases, so it is always done, even if it might in rare cases cause a double registration since that is safe. Task-number: QTBUG-53458 Change-Id: Ia010774b26072192b55697b717cc37442c852881 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>