Go to file
Eskil Abrahamsen Blomfeldt f385b8827a Windows: Add synthesized fonts also when there is a style name
Since Windows can synthesize certain font traits for us, we
used to register these in the font database so that we could
match against them. But after change
469b139169, this in principle
no longer happens, because we opt out whenever there is a
style name (which there usually is, this could be e.g.
"Regular" for a normal font). The result of this was that
if we looked for a bold variant of a font, we would not find
it.

In cases where a multi-engine was used, the request for bold
would still survive in the multi engine's fontDef, so we would
still pick it up later and apply the synthesis. But when
NoFontMerging was set, then we would override the weight in
the fontDef with the one from the font database.

Since the comment documents that the additional registrations
are there to make sure all the variants that Windows can
synthesize are available for matching, it does not make sense
to skip them just because the font has a style name. So this
is a partial revert of 469b139169.

Note: This exposed an error in QFontDatabase::isSmoothlyScalable().
The style parameter here is not the "styleName" (as in sub-family),
but actually predates that API. Instead it is the "style" as
returned by QFontDatabase::styles(), which may be the style
name, but it can also be the generated description of the style
and weight. In the latter case, we would return false for fonts
that are actually smoothly scalable, which is incorrect. This
caused a failure in tst_QFontMetrics::metrics(). To remedy this,
we add an additional condition, and also match the style if it
matches the generated descripion of the style key.

[ChangeLog][Windows] Fixed an issue where bold/italic would not
be synthesized for fonts if QFont::NoFontMerging was set.

Pick-to: 5.15 6.1
Fixes: QTBUG-91398
Change-Id: Id2166a47ae2d386536cf6e5e27ff09165ae8a23a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-05-11 13:22:44 +02:00
.github/workflows Github Actions: many minor updates 2021-01-22 18:48:54 +01:00
bin CMake: Allow usage of QtStandaloneTestTemplateProject as package component 2021-04-23 13:31:04 +02:00
cmake CMake: use additional search paths also for tool package 2021-05-10 17:52:23 +03:00
coin Add instructions for Windows 10 on Arm config 2021-05-05 16:28:27 +03:00
config.tests Check whether CMake was built with zstd support 2021-04-16 16:49:28 +02:00
dist Add Qt 6.0.0 changes file 2020-11-16 10:02:08 +02:00
doc Rewrite the fetchmore example 2021-04-23 12:43:28 +00:00
examples Style sheet example: Fix doc url for Qt 6 2021-05-08 01:35:44 +02:00
lib
libexec CMake: Make qt-internal-configure-tests relocatable 2021-04-26 23:11:28 +02:00
mkspecs WASM: Don’t set “-g4” by default for qmake builds 2021-04-27 12:12:35 +00:00
qmake qmake: Clear caches before exiting 2021-05-06 23:49:20 +02:00
src Windows: Add synthesized fonts also when there is a style name 2021-05-11 13:22:44 +02:00
tests Fix QSaveFile and QTemporaryFile issues with windows network shares 2021-05-11 13:22:44 +02:00
util pro2cmake: Add support for standalone CMake test configuration 2021-04-27 17:23:07 +02:00
.cmake.conf Bump version 2021-02-18 07:20:21 +02:00
.gitattributes Give batch files CRLF line endings 2020-11-04 15:02:29 +00:00
.gitignore .gitignore: Qt Creator files cleanup 2020-09-25 07:50:15 +02:00
.lgtm.yml Skip LGTM analysis for the bootstrap library and tools 2020-07-16 01:04:34 +02:00
.prev_configure.cmake CMake: Regenerate configure.cmake files 2021-04-27 21:33:48 +02:00
.prev_qt_cmdline.cmake CMake: Regenerate configure.cmake files 2020-09-28 15:48:17 +02:00
.qmake.conf Bump version 2021-02-18 07:20:21 +02:00
.tag
CMakeLists.txt CMake: Generate better Xcode iOS projects 2021-04-19 20:30:45 +02:00
config_help.txt Allow to load -developer-build without configurations into an IDE 2021-05-07 21:06:58 +02:00
configure Remove the -qmake and -cmake configure arguments 2021-03-11 16:39:50 +01:00
configure.bat Remove superfluous variable assignments from configure.bat 2021-03-11 16:39:54 +01:00
configure.cmake Fix wrong note "Using pthreads" and only show it for WASM 2021-04-29 23:09:06 +08:00
configure.json Fix wrong note "Using pthreads" and only show it for WASM 2021-04-29 23:09:06 +08:00
dependencies.yaml Re-add dependencies.yaml now that qt5.git wip/qt6 builds fine 2019-09-18 13:19:31 +02:00
INSTALL INSTALL: Remove outdated reference to Windows CE 2019-02-13 13:01:57 +00:00
LICENSE.FDL
LICENSE.GPL2
LICENSE.GPL3
LICENSE.GPL3-EXCEPT
LICENSE.LGPL3
LICENSE.LGPLv3 Remove LICENSE.GPLv3, LICENSE.LGPLv21, LGPL_EXCEPTION.txt 2018-04-16 11:02:14 +00:00
LICENSE.QT-LICENSE-AGREEMENT Update enterprise license agreement v4.2.1 2019-12-18 13:07:19 +02:00
qt_cmdline.cmake CMake: Build minimal subset of tests in desktop static builds 2021-04-06 09:15:37 +01:00
sync.profile Generate QUtf8StringView header file from qutf8stringview.h 2020-11-07 08:35:11 +00:00