summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Windows QPA: Remove qtwindows_additional.h.Friedemann Kleint2016-05-171-1/+1
| | | | | | | | | | Clean up helper definitions required for old SDKs and MinGW and move the remaining ones to the files that require them. Ensure compilations with MinGW 4.9. Task-number: QTBUG-51673 Change-Id: I607989dd1d9197f237c6d021209a2c94aeb84021 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-031-25/+58
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/3rdparty/double-conversion/include/double-conversion/utils.h src/corelib/global/qnamespace.qdoc src/corelib/tools/qsimd_p.h tests/auto/corelib/io/qfile/tst_qfile.cpp Change-Id: I3ca1007bab5355d251c13002a18e93d81c254d34
| * Add color font support on WindowsEskil Abrahamsen Blomfeldt2016-04-131-25/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Detect if DirectWrite 2 is available, and support color fonts if possible. One limitation worth mentioning is that if the color font contains regular, monochrome glyphs as well, then these will be drawn in black, and not in the pen color. Fixing this would require some elaborate rewrites in the font rendering system, since we would have to have two font caches per color font (one for mono and one for colors), or do some sort of trick where we make argb(r, g, b, 0) mean subpixel alpha instead, and detect glyphs that are not correctly premultiplied when blitting to the screen. Another limitation is that the approach does not work with distance field rendering. In principle we could support this on Windows, since the format is vector based, but it would also require substantial work and it is not possible to support for Apple/Google fonts anyway, so it would just lead to code which is not cross-platform. [ChangeLog][Windows] Added support for color fonts (color emojis) when DirectWrite 2 is available. Change-Id: I6a608dd5d2aa3a7e762a06830902bddac7c550a5 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Windows QPA: Remove Windows CE.Friedemann Kleint2016-03-291-23/+1
|/ | | | | | Task-number: QTBUG-51673 Change-Id: I5b58a7d1651fce7f868a4d3fdd8fa46f35e67695 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-111-11/+18
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change partially reverts 1bfc7f68 about QT_HAS_BUILTIN define and undef in src/corelib/tools/qsimd_p.h. This change is also squashed with "Fall back to c++11 standard compiler flag for host builds" which is done by Peter Seiderer. Conflicts: mkspecs/features/default_post.prf src/3rdparty/sqlite/0001-Fixing-the-SQLite3-build-for-WEC2013-again.patch src/3rdparty/sqlite/sqlite3.c src/corelib/tools/qsimd_p.h src/gui/kernel/qevent.cpp src/gui/kernel/qwindowsysteminterface.cpp src/gui/kernel/qwindowsysteminterface_p.h src/plugins/bearer/blackberry/blackberry.pro src/plugins/platforms/cocoa/qcocoasystemsettings.mm src/plugins/platformthemes/gtk2/gtk2.pro src/plugins/styles/bb10style/bb10style.pro src/sql/drivers/sqlite2/qsql_sqlite2.cpp tools/configure/configureapp.cpp Task-number: QTBUG-51644 Done-with: Peter Seiderer <ps.report@gmx.net> Change-Id: I6100d6ace31b2e8d41a95f0b5d5ebf8f1fd88b44
| * Fix application fonts with DirectWrite font engineEskil Abrahamsen Blomfeldt2016-03-041-10/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no way to add fonts to the system font collection with DirectWrite. Instead you have to write custom collections. But that would mean keeping two instances of the same font data in memory since we are already registering them for the GDI engine, and we have no way of knowing which engine will be used. When we at some point replace the GDI engine completely, we could implement this in the proper way, but for now, instead of looking up the equivalent to the LOGFONT in DirectWrite's system font collection, we look it up using GDI and then convert the HFONT to DirectWrite. [ChangeLog][Windows][Text] Fixed disabling hinting for application fonts, e.g. when automatic scaling by device pixel ratio is in effect. Task-number: QTBUG-18711 Change-Id: I5c1365ab956dfa23d4d687877d7440473ee03bb0 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
| * DirectWrite: Output correct error code on failureEskil Abrahamsen Blomfeldt2016-03-041-2/+2
| | | | | | | | | | | | | | | | | | GetLastError() does not return the correct error code for the DirectWrite functions, they are returned by the function itself. Task-number: QTBUG-18711 Change-Id: I3931f58bb29a5f2dc4a5aa911ff16a873267d185 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-02-241-16/+35
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java src/plugins/platforms/windows/qwindowsfontengine.cpp src/plugins/platforms/windows/qwindowsnativeimage.cpp tests/auto/gui/kernel/qwindow/BLACKLIST tests/auto/gui/kernel/qwindow/tst_qwindow.cpp Change-Id: I649b32b260ce0ed2d6a5089021daa0d6a8db85f7
| * Windows DirectWrite: Improve error messages for font engine creation.Friedemann Kleint2016-02-191-7/+24
| | | | | | | | | | | | | | | | | | Fix up debug operator for QFontDef, add one for LOGFONT and output both should creation fail. Task-number: QTBUG-51260 Change-Id: I5cbcd392edd811c6b9470ddbb095d41a9185d208 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
| * Windows QPA/font code: Fix warnings as shown by Qt Creator's Clang based ↵Friedemann Kleint2016-02-181-9/+11
| | | | | | | | | | | | | | | | | | | | | | code model. Introduce C++ casts and add some conversions. Where possible, increase const-correctness. Task-number: QTBUG-50804 Change-Id: Idd73730ae83b837c065c8c80f500d5336570f228 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-02-181-19/+23
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also reverts commit 018e670a26ff5a61b949100ae080f5e654e7bee8. The change was introduced in 5.6. After the refactoring, 14960f52, in 5.7 branch and a merge, it is not needed any more. Conflicts: .qmake.conf src/corelib/io/qstandardpaths_mac.mm src/corelib/tools/qsharedpointer_impl.h tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp Change-Id: If4fdff0ebf2b9b5df9f9db93ea0022d5ee3da2a4
| * Windows QPA: Fix the signature of the font enumeration callbacks.Friedemann Kleint2016-02-151-19/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | Instead of casting the function in the calls to EnumFontFamiliesEx(), use the correct signature and cast inside the callbacks. Also avoid unconditionally casting the TEXTMETRIC parameter to NEWTEXTMETRICEX since according to documentation NEWTEXTMETRICEX is passed for TrueType fonts only. Task-number: QTBUG-50804 Change-Id: I0393474ac06000fc3f12d2dbc2a5aa37a6b44849 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-02-021-1/+1
|\| | | | | | | | | | | | | | | | | Conflicts: config.tests/unix/compile.test src/plugins/platforms/cocoa/qcocoahelpers.mm src/tools/qlalr/cppgenerator.cpp Change-Id: I0103ca076a9aca7118b2fd99f0fdaf81055998c3
| * Don't use QStringLiteral in comparisonsAnton Kudryavtsev2016-01-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For QLatin1String, operator== is overloaded, so comparing to a latin-1 (C) string literal is efficient, since strlen() is comparatively fast. OTOH, QStringLiteral, when not using RVO, litters the code with QString dtor calls, which are not inline. Worse, absent lambdas, it even allocates memory. So, just compare using QLatin1String instead. Change-Id: I761b2b26ab5b416bc695f524a9ee607dacf0a7b2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.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>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-12-021-16/+40
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qcoreapplication.cpp src/corelib/kernel/qeventdispatcher_blackberry.cpp src/network/bearer/qnetworkconfiguration.cpp src/plugins/bearer/blackberry/qbbengine.cpp src/plugins/platforms/android/androidjnimain.cpp src/plugins/platforms/android/qandroidplatformtheme.cpp src/plugins/platforms/qnx/qqnxbpseventfilter.cpp src/plugins/platforms/qnx/qqnxfiledialoghelper_bb10.cpp src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp src/plugins/platforms/qnx/qqnxintegration.cpp src/plugins/platforms/qnx/qqnxnavigatorbps.cpp src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp src/plugins/platforms/qnx/qqnxwindow.cpp src/widgets/kernel/qwidgetwindow.cpp src/widgets/styles/qwindowsvistastyle.cpp src/widgets/styles/qwindowsxpstyle.cpp src/widgets/widgets/qtoolbararealayout.cpp tests/auto/corelib/global/qflags/qflags.pro tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp tests/auto/corelib/tools/qversionnumber/qversionnumber.pro tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp Change-Id: I37be88c6c185bb85404823353e027a0a6acdbce4
| * Differ between vertical and no hinting on WindowsEskil Abrahamsen Blomfeldt2015-12-021-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Symmetric text rendering seems to be the equivalent to no hinting at all since it does subpixel antialiasing in both horizontal and vertical directions. Let people select non-symmetric, natural rendering as well, by setting vertical hinting on the font. This is the mode used for many UI elements in newer versions of Windows (like the title bar of windows etc.) [ChangeLog][Windows] Added differentiation between vertical hinting and no hinting in DirectWrite font engine. Task-number: QTBUG-48546 Change-Id: I2f75ae2d16fdf26706587d92da43daf29afbbcf2 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
| * Windows: Load DirectWrite dynamically.Friedemann Kleint2015-12-021-15/+37
| | | | | | | | | | | | | | | | DirectWrite is not supported on Windows XP. Task-number: QTBUG-49711 Change-Id: Ie1df6250814226d53fe4fb3a1c6bd024f6018796 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | QWindowsFontDataBase: use QSharedPointer::create()Marc Mutz2015-12-011-2/+2
| | | | | | | | | | | | | | | | | | More efficient, because control block and tracked object are co-located in a single memory allocation. Change-Id: Ibd1a37836b96837afd6209a743a05a727dbc9907 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Use Q_UNLIKELY for every qFatal()/qCritical()Marc Mutz2015-11-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If, after checking a condition, we issue a qFatal() or a qCritical(), by definition that check is unlikely to be true. Tell the compiler so it can move the error handling code out of the normal code path to increase the effective icache size. Moved conditional code around where possible so that we could always use Q_UNLIKELY, instead of having to revert to Q_LIKELY here and there. In some cases, simplified the expressions newly wrapped in Q_UNLIKELY as a drive-by. Change-Id: I67537d62b04bc6977d69254690c5ebbdf98bfd6d Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-11-041-3/+10
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/unix/ptrsize.test configure src/corelib/global/qnamespace.h src/network/socket/qabstractsocket.cpp tests/auto/other/networkselftest/networkselftest.pro Change-Id: Ic78abb4a34f9068567cea876861d4220f5a07672
| * Windows: Default to vertical hinting when high-dpi scaling is enabledEskil Abrahamsen Blomfeldt2015-11-031-3/+8
| | | | | | | | | | | | | | | | | | | | | | Since hinted text layouts are not scalable, we should disable hinting by default when the high-dpi scaling is active. This is the Windows version of 0f7bc885aa7ae8cc3c448cc751aba4eba8c1c8b8, which solved the same issue for the fontconfig database. Change-Id: I48b5da5b045dec195fd257743175017f39cf9620 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
| * Windows QPA: Fix debug operators.Friedemann Kleint2015-10-271-0/+2
| | | | | | | | | | | | | | | | | | | | Enclose all debug operators within QT_NO_DEBUG_STREAM, declare all public ones and make the others static. Add operators for POINT and WINDOWPLACEMENT. Task-number: QTBUG-48449 Change-Id: I33f2dba2bf486a8f5cb11f11f4e2b37cce086def Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | qevent.h: Add fixme comments to remove include directives for Qt 6.Friedemann Kleint2015-10-021-0/+1
|/ | | | | | | | Mark include directives in qevent.h for removal and preemptively add missing headers in code base. Change-Id: I81011d7bfad4a09d80deeda6d1bed67b5c0e63c2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Default implementation for QPlatformFontDatabase::fallbacksForFamily()Konstantin Ritt2015-07-311-8/+3
| | | | | | | | | ...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>
* Windows: register alias for application fontJian Liang2015-07-201-5/+10
| | | | | | | | | | | | | | | | | | | Previously Qt didn't register an English name alias for application font files under Windows. Suppose we add an application font file using QFontDatabase::addApplicationFont(), the font family name returned by QFontDatabase::applicationFontFamilies() then was the English name of the font file, but the corresponding font family name returned by QFontDatabase::families() was the localized version. This prevented us from using the English font family to access the font since it was not registered as alias. Add an overload of populateFamily() which will register the English name of the application font file as alias. Task-number: QTBUG-47096 Change-Id: Idb89b7d8a419646c209426e826e7fd1ebee49662 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* DirectWrite: Fix crash when loading QRawFont from dataEskil Abrahamsen Blomfeldt2015-07-061-16/+13
| | | | | | | | | | | | | | | | | In Qt 4, we would create and destroy the DirectWrite factory for each time we load the font data from a QRawFont. This factory would then be passed to the font engine ctor. However, in Qt 5, some things have been refactored, and the font engine will now try to use the factory stored in the sharedFontData(). This would cause dereferencing a null pointer because we didn't initialize the data before constructing the font engine. [ChangeLog][Windows][Text] Fixed crash in DirectWrite engine when constructing a QRawFont from raw font data. Task-number: QTBUG-46963 Change-Id: I4813c7f818c9df5707c27f5b6ce507649d902270 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Windows QPA plugin: Fix debug formatting.Friedemann Kleint2015-04-301-5/+7
| | | | | | | | | | | | | | | | - Introduce QDebugStateSaver for all debug operators. - Remove the "Flags=" from enumerations since their type is now output by default. - Added some spaces since the previous formatting relied on space=true as a result of some debug operators erroneously returning debug.space(), which is now fixed in qtbase. - Fixed formatting, added noquote() where necessary, added some newlines, used stream modifiers instead of QString::number(n, 16) to output hex numbers. - Fix indentation. Change-Id: I64123a4262916e21448cda2aa61ae1100f07291a Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Windows: Add "Segoe UI Emoji" and "Segoe UI Symbol" as fallback fonts.Friedemann Kleint2015-04-271-0/+2
| | | | | | | | This enables rendering of Emoji symbols. Task-number: QTBUG-45811 Change-Id: I7cb128dab717870929e02ea9ec253f36fef29804 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Fix build with -directwriteKonstantin Ritt2015-04-071-5/+3
| | | | | | | | | | | | | There were several issues caught by GCC: * deleting object of polymorphic class type which has non-virtual destructor might cause undefined behaviour * comparison between signed and unsigned integer expressions * 'GetUserDefaultLocaleName' was not declared in this scope (depends on WINVER >= 0x0600) Change-Id: I39f2cc0d5e158f4d85377edd55e9f74a512c7303 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Use QT_WARNING_.. instead of #pragma GCC diagnostic ..Konstantin Ritt2015-04-071-7/+3
| | | | | Change-Id: I0bb55a7f1074f3b8d6fb681b1d4dab5105ae7569 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* [QWindowsFontDatabase] Move code around to improve readabilityKonstantin Ritt2015-03-201-44/+30
| | | | | | | | Keep DirectWrite initialization code in a single place and fallback to GDI implementation if DirectWrite initialization has failed. Change-Id: I2da185dbc073c58a7ba47bae09957ecac877d712 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Simplify QWindowsFontDatabase::createEngine()Konstantin Ritt2015-03-201-7/+1
| | | | | | | Reduce code duplication and improve readability. Change-Id: Idf53c80077daa9bac03a72acfd2b6c7e3a24ad97 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* An attempt to fix font stretching with DirectFrite font engineKonstantin Ritt2015-03-201-17/+15
| | | | | | | | | Do the `lf.lfWidth = tm.tmAveCharWidth * request.stretch / 100` trick for the DirectWrite path, too. Task-number: QTBUG-22652 Change-Id: I5238bce1033555a4386cb48fed8c898a9632e0cd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Only get font metrics if we're going to use themKonstantin Ritt2015-03-201-26/+20
| | | | | Change-Id: If6b635e54f705c1e28b4e092a318d825a408ccfb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Do not re-create font if it is not of TMPF_TRUETYPEKonstantin Ritt2015-03-201-3/+1
| | | | | | | | | | | | | | | | For !ttf and stretch==100 case, it was: hfont = CreateFontIndirect(&lf); TEXTMETRIC tm = ..; if (!ttf) { DeleteObject(hfont); lf.lfWidth = tm.tmAveCharWidth; hfont = CreateFontIndirect(&lf); } Unless there is some special behavior for non-TrueType fonts I don't know about, it looks to me like a 100% waste. Change-Id: I864340e50591ba1d8006d1a80f36f6f06f2734b6 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Windows: Fix build of qwindowsfontdatabase.cpp with MinGW 4.9.2/-Werror.Friedemann Kleint2015-03-061-0/+7
| | | | | | | | | Disable warning: qwindowsfontdatabase.cpp: In member function 'virtual QFontEngine* QWindowsFontDatabase::fontEngine(const QByteArray&, qreal, QFont::HintingPreference)': qwindowsfontdatabase.cpp:1111:74: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] Change-Id: Ifce69db7d1f3b78d52e5b4e01db8e7bbfb62b439 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Merge remote-tracking branch 'origin/5.4' into 5.5Oswald Buddenhagen2015-03-021-5/+19
|\ | | | | | | Change-Id: I95b3a87c5068c6b8068b30a35655b4c2419e7f9e
| * Register font's english name as alias when populating font databaseLiang Jian2015-02-271-5/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Register font's english name as alias in the callback of EnumFontFamiliesEx() at the time QWindowsFontDatabase::populateFontDatabase() is being called. This will help us to resolve english font family name to its corresponding localized alias once windows font database has been populated. It will also fix an assertion in Chinese Windows. Task-number: QTBUG-44647 Change-Id: I265d93c16a1677a7f31ff56d60c24f6e90666419 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | Guarantee there is always a valid HFONT to get metrics forKonstantin Ritt2015-02-201-6/+7
| | | | | | | | | | Change-Id: I69d72803f994a5455b607c4f94f87c1c782eb0a4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | Fix indentation and move some variables aroundKonstantin Ritt2015-02-151-63/+52
| | | | | | | | | | Change-Id: Ice1987242d288b0b18e77c647153e6d133135896 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | [QWindowsFont*] Unify HFONT fallbacksKonstantin Ritt2015-02-121-8/+3
| | | | | | | | | | | | | | | | | | | | In case CreateFontIndirect() call fails, always fallback to a better stock font provided by Windows (apparently, it is DEFAULT_GUI_FONT). Change-Id: Ib78fe0d21ba4fccbba1152b81ed87c010e1220e0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@digia.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>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-02-101-55/+44
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro src/gui/image/qimage_conversions.cpp src/gui/opengl/qopenglextensions_p.h src/gui/text/qtextengine.cpp src/network/ssl/qsslsocket_openssl.cpp src/plugins/platforms/eglfs/qeglfshooks_stub.cpp src/plugins/platforms/eglfs/qeglfsscreen.cpp src/plugins/platforms/eglfs/qeglfswindow.cpp src/plugins/platforms/windows/qwindowsfontdatabase.cpp src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp src/plugins/platforms/windows/qwindowsnativeinterface.cpp src/plugins/platforms/windows/qwindowsscreen.cpp src/plugins/platforms/windows/qwindowswindow.cpp src/plugins/platforms/windows/qwindowswindow.h src/plugins/platforms/xcb/qxcbdrag.h src/widgets/itemviews/qabstractitemview.cpp src/widgets/kernel/qwidget.cpp src/widgets/util/qsystemtrayicon_p.h tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp Thanks to Friedemann Kleint for resolving the qwindowsfontdatabase.cpp conflicts. Change-Id: I937232c30523d5121c195d947d92aec6f129b03e
| * Windows: Rewrite font database to use delayed population.Friedemann Kleint2015-02-031-33/+50
| | | | | | | | | | | | | | | | Task-number: QTBUG-43774 Change-Id: I3b0b0ead0953b3b88a6d0092c694a2a00f70acf7 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| * Revert "Fix font enumeration, with the same family name, on Windows."Friedemann Kleint2015-01-231-34/+2
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 8456adf0eeb9df8dd5f0547d4ad5a81888295f03. The change introduces a massive slowdown of the application startup caused by the inner enumeration. Task-number: QTBUG-43774 Task-number: QTBUG-40828 Change-Id: I694938eab93ea409d97537b55e8a025bb7a0e393 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | Don't remember if passed HFONT was a stock objectKonstantin Ritt2015-02-021-9/+3
| | | | | | | | | | | | | | | | | | | | According to GetStockObject() function docs at MSDN: > It is not necessary (but it is not harmful) to delete > stock objects by calling DeleteObject. Change-Id: I755dc84c8b86ba2806e97ae41b3025aa3e633ae7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | [QWindowsFontDatabase] Drop some dead codeKonstantin Ritt2015-02-021-11/+7
| | | | | | | | | | | | Change-Id: I95b6c95bf0be875b3fcb66150a13bd3b5df9830a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | [QWindowsFontDatabase] Drop some dead codeKonstantin Ritt2015-02-021-29/+4
| | | | | | | | | | | | Change-Id: I56b867508a9d597462c2e71c71c3aea0b8ea9aca Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Fix potential memory access violation issuesKonstantin Ritt2014-12-241-15/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LOGFONT docs clearly states `lfFaceName` member is a null-terminated string of length not longer than LF_FACESIZE, including trailing null. This patch covers two cases at once: 1. If family name is longer than LF_FACESIZE - 1, it would be truncated and terminated with null, to prevent memory access beyond the LOGFONT instance. 2. If family name is a fromRawData QString, we don't assume it is null-terminated either and guarantee trailing null ourselves. Change-Id: I8f607efc7d0901537a4179e36cc51df94203f08d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>