summaryrefslogtreecommitdiffstats
path: root/src/platformsupport
Commit message (Collapse)AuthorAgeFilesLines
* macOS/iOS: Fix garbled text under some conditionsEskil Abrahamsen Blomfeldt2017-12-012-9/+19
| | | | | | | | | | | | | | | | | | There seems to be an issue in CoreText which may cause an existing font descriptor to give unreliable results if it refers to one of the system theme fonts. Since we do not know all function calls or events that may trigger this bug, the safe route is to always create fresh font descriptors when creating fonts for these descriptors. The impact on performance should be small, as Qt has its own internal caches. [ChangeLog][macOS/iOS][Text] Fixed an issue where text using one of the system theme fonts would under certain circumstances display random glyphs. Task-number: QTBUG-63476 Change-Id: I9e9b253018c63976345eec1439a6b78de2cab869 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Generic Unix Theme: Don't crash if D-Bus is not runningGabriel de Dietrich2017-11-201-3/+5
| | | | | | Change-Id: I215ef25fe943730ba8b1976695a04a4aa86638f1 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
* Fix memory corruption on scaled emojisAllan Sandfeld Jensen2017-11-062-11/+21
| | | | | | | | | | | | | Bitmap glyphs are returned prescaled, which means we should include the transform in their bounding box. Additionally painting them should stick the smallest rect to avoid writing outside the allocated area, and assert in debug builds. Task-number: QTBUG-64239 Change-Id: I5f877d36566891323f528018f910798344ba4ce2 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Windows font database: Remove clamping of default font sizeFriedemann Kleint2017-10-091-6/+0
| | | | | | | | | Partially revert a72513cab7cdfac638ef572838277aa062f1d296. The value is too small for Chinese fonts. Task-number: QTBUG-63654 Change-Id: If020bfc3044258b7abfd9d463bc9b292a9cc0839 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Fix deprecated API usageJake Petroules2017-10-071-1/+1
| | | | | | | | | | | Amends c1cece8e54 For some reason, this was missed in the original change. This is now outright prohibited in the watchOS 4 SDK and will cause a compilation error on that platform. Change-Id: Iaa2edf6256a54ca11dec9f1efd8a4d18ba7dc046 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* qglxconvenience: Avoid null pointer dereferenceKai Uwe Broulik2017-09-271-1/+4
| | | | | | | | | | | | | | glXGetVisualFromFBConfig according to documentation can return NULL [1]. This may result in a crash when running Qt applications using ARGB windows with XLIB_SKIP_ARGB_VISUALS defined. Also guard QXlibScopedPointerDeleter against illegally calling XFree(nullptr). [1] https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glXGetVisualFromFBConfig.xml Task-number: QTBUG-58910 Change-Id: Ie076a1e906ed632543bdab03ef365f699533a61a Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Fix typo in debug statement: QPlatformScren -> QPlatformScreenSérgio Martins2017-09-241-1/+1
| | | | | Change-Id: Ibf5046ff88cbad1f03966f39f62183b0bd750221 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add missing math.h include (for sqrt function)Jake Petroules2017-09-221-0/+2
| | | | | Change-Id: Ia9cee8a941e31d71d3df6094b21d20a26f1b46f1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Windows QPA: Hardcode a limit for the default point sizeFriedemann Kleint2017-09-011-0/+20
| | | | | | | | | | | Windows uses deprecated API to obtain the default font which has been observed to return bogus sizes in multi monitor setups. Apply a limit in this case and add fixme comment for Qt 6. Task-number: QTBUG-49374 Task-number: QTBUG-58610 Change-Id: I6e805ec792a3f425961a48ef4c4329c3cdf302b6 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* QFbVtHandler: Remove unused sys/signalfd.h includeDongmei Wang2017-08-291-1/+0
| | | | | | Change-Id: Ia9fa3c4de0a1dbdd1b36730c82f5180c2128cbcf Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Remove QMAKE_LIBS_CORE variableJoerg Bornemann2017-08-281-1/+1
| | | | | | | | Define the lib dependencies for corelib in corelib.pro, where they belong. Change-Id: I973d3b0c571782d869b27dea243e899db4dddc43 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* macOS: Fix matching of font weights for application fontsEskil Abrahamsen Blomfeldt2017-08-161-19/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5ad2e1cea1b2c08950c91174840f542806954d99 exposed a latent bug when matching font weights that do not exactly match any of the canonical weights in the system . It seems that when we registered the font with FontManager, it would modify the font weight to match a system weight, while we now get raw values from the font instead. So for Roboto Medium, for instance, we would now get 0.2 instead of 0.23, and since our conversion logic would convert everything between Light (-0.4) to Medium (0.23) to QFont::Normal, we would regard this as normal weight instead of medium. But on a linear scale, it makes more sense to match to the closest canonical weight instead of requiring exact matches. Note that the definition says that the middle between two weights should tend upwards, therefore we do the comparisons in decreasing order. [ChangeLog][QtGui][Text] Fixed matching of non-regular font weights for application fonts on macOS. Task-number: QTBUG-61520 Change-Id: Ieda4927c2c69ec72125257340cf06c683b031d05 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix a race condition in QEvdevTabletHandler::readData()Romain Pokrzywka2017-08-141-1/+1
| | | | | | | | | | | | | | Statics and threads don't mix well. There can be multiple threads calling QEvdevTabletHandler::readData() simultaneously if you have several tablet devices registered with the plugin, creating a race on the static buffer array. Make the buffer a simple local variable instead, the array is small enough that we can afford the per-thread stack allocation. Change-Id: I4487add8df50743b8178ca6faeb9be45231ccb78 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Windows font database: Make DirectWrite warnings more verboseFriedemann Kleint2017-07-271-2/+22
| | | | | | | | | | | Output family and format error message using _comerror struct. QWindowsMultiFontEngine::loadEngine: CreateFontFromLOGFONT failed (The operation completed successfully.) becomes QWindowsMultiFontEngine::loadEngine: CreateFontFromLOGFONT failed for "8514oem": error 0x88985002 : Indicates the specified font does not exist. Change-Id: Iccd4622127d94870b4b7465a4b4fdbf34ad1c434 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Read more KDE configuration in the KDE platform themeAllan Sandfeld Jensen2017-07-181-9/+40
| | | | | | | | | | Adds the hints that are read and used by the plasma-integration platform theme, so naked Qt applications can integrate just as well on this front. Change-Id: I45a113e0081ea96c8cf543c22b28b69280ae7619 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: David Faure <david.faure@kdab.com>
* QIntegrityHIDManager: Fix syncqt warningsFriedemann Kleint2017-07-071-3/+3
| | | | | | | | | | | | | | QtInputSupport: WARNING: qtbase/src/platformsupport/input/integrityhid/qintegrityhidmanager.h includes QObject when it should include QtCore/QObject QtInputSupport: WARNING: qtbase/src/platformsupport/input/integrityhid/qintegrityhidmanager.h includes QList when it should include QtCore/QList QtInputSupport: WARNING: qtbase/src/platformsupport/input/integrityhid/qintegrityhidmanager.h includes QList when it should include QtGui/QList QtInputSupport: WARNING: qtbase/src/platformsupport/input/integrityhid/qintegrityhidmanager.h includes QThread when it should include QtCore/QThread Amends 88f30250eb15b520415658c6c32f48fda111b6bf. Change-Id: Ia56fdd87871fdeae8fe34752c61a66195100ceb7 Reviewed-by: Kimmo Ollila <kimmo.ollila@qt.io> Reviewed-by: Rolland Dudemaine <rolland@ghs.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Follow KDE settings for menu and toolbar fontsAllan Sandfeld Jensen2017-06-131-0/+8
| | | | | | | | Makes pure Qt applications integrate better when those fonts don't match the general fonts. Change-Id: Ic06e8595efc44f0c6649cf364e751c4c714cda93 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Use upstream at-spi 2Frederik Gladhorn2017-06-095-1/+134
| | | | | | | | | | Move at-spi dbus xml definitions into platformsupport, these files simply describe the DBus protocol and should not be in 3rdparty. The header files can just as well be picked up by pkg-config. Change-Id: I326d9b3cb69223bf2c8646099f211d9a9f3fa0af Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* winrt: Use styleHint as clue for fallbacks for font familiesOliver Wolff2017-06-012-3/+27
| | | | | | | | Similar on how it is done for Windows desktop we also use the given style hint when building the list of fallbacks a font family. Change-Id: I71378581d07f20ebe5bf0bc757bba919cc70e118 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Add USB HID device feature to INTEGRITYKimmo Ollila2017-05-305-1/+344
| | | | | | | | | | | | This change adds USB mouse handling support for INTEGRITY Change-Id: I8a2a51c8c3578898e90dd5bbb01f6aed6c64e2a4 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Timo Aarnipuro <timo.aarnipuro@qt.io> Reviewed-by: Nikola Velinov <nvelinov@ghs.com> Reviewed-by: Rolland Dudemaine <rolland@ghs.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Tero Alamaki <tero.alamaki@qt.io>
* Do not use FT_LOAD_TARGET_LCD when full hinting is requestedAllan Sandfeld Jensen2017-05-291-7/+2
| | | | | | | | | | | | | | In FreeType 2.8.0 FT_LOAD_TARGET_LCD is now a variant of FT_LOAD_TARGET_LIGHT instead of of FT_LOAD_TARGET_NORMAL. This means requesting it will get us light hinting. See https://sourceforge.net/projects/freetype/files/freetype2/2.8 We should just avoid using it all together since we request the LCD mode separately anyway with FT_RENDER_MODE later. Change-Id: I9ea2e39a6e9ba25ba11604a194e552fe4240a127 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Add INTEGRITY mkspec for ARMv8 Drive CXTero Alamäki2017-05-291-2/+4
| | | | | | Change-Id: I038de7a0cc9e6046aec3fc930876d43263702e90 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add undeclared CoreFoundation and Foundation deps to coretext.priJake Petroules2017-05-111-5/+9
| | | | | | | This fixes shared library builds of Qt on iOS and tvOS. Change-Id: I29d4c7e779e51b1adc19ca9dc18bc46a45a60093 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* Update detection of $DESKTOP_SESSIONThiago Macieira2017-04-272-7/+29
| | | | | | | | | | | | | I don't know how widespread this use is, but apparently sddm seems to set DESKTOP_SESSION to be the .desktop file that it used to launch the session (minus the .desktop extension). In that case, we should read the DesktopName entry from the file to get the actual desktop type. And since the desktop detection from QGenericUnixServices should suffice, we don't need to repeat the same code in QGenericUnixThemes. Change-Id: I0e1a09998253489388abfffd14b5eeefbd7fe740 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Fix unused private fields in dbusmenu and dbustrayThiago Macieira2017-04-263-7/+3
| | | | | | | | | qdbusplatformmenu_p.h:131:9: error: private field 'm_reserved' is not used [-Werror,-Wunused-private-field] qdbusplatformmenu_p.h:192:10: error: private field 'm_isSeparator' is not used [-Werror,-Wunused-private-field] etc. Change-Id: I84e363d735b443cb9beefffd14b8bc4253081145 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Fix warning for -no-feature-multiprocessTasuku Suzuki2017-04-251-0/+2
| | | | | | Change-Id: Ifa3382098c8f7c2cb1750b7ac5e583ddd71895e2 Reviewed-by: Stephan Binner <stephan.binner@basyskom.com> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Prevent busy loop in glib event dispatcherGatis Paeglis2017-04-241-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | .. when running event loop with QEventLoop::ExcludeUserInputEvents. In a properly functioning code, g_main_context_iteration is expected to block until any event source becomes ready to dispatch an event (or interrupt occurs). Qt provides several custom event sources to the Glib event loop. The bug (busy loop) was caused by faulty event source implementation when QEventLoop::ExcludeUserInputEvents is set. As long as the window system's event queue was not empty, we signaled to the event dispatcher that there is an event ready to be dispatched. This results in the dispatcher calling the relevant dispatch function (which does handle the ExcludeUserInputEvents flag correctly). As we do not dispatch user events, the window system's event queue never becomes empty and we enter a busy loop (CPU running at 100%) where we signal that we have events to dispatch, but we actually do not dispatch them and g_main_context_iteration never gets to block. This busy loop can cause blocking GTK functions such as gtk_dialog_run() never return. Task-number: QTBUG-59760 Task-number: QTBUG-57101 Change-Id: I545b7951108eeaba019614ae8f5a1168c8b26c27 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
* macOS: Fix crash when closing windows with raster backingstoreTor Arne Vestbø2017-04-211-1/+4
| | | | | | | | | | | | After 5b78fcd03b6 the raster backingstore tries to use the platform window to resolve the native DPR, but we might not always have a platform window. Instead we go though the window, like before, which has fallback paths for the case of no platform window, and then remove the Qt scaling factor manually. Change-Id: I19c8383b0a33f3d97aaf0d0e886ed03e14cb1592 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* macOS: Defer population of localized font family aliases until neededTor Arne Vestbø2017-04-212-12/+36
| | | | | | | | | | | | 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>
* Disable precompiled headers for small modulesThiago Macieira2017-04-209-9/+0
| | | | | | | | | | | | | Creating a precompiled header exclusively for a one- or two-file module is wasteful. The time that it takes to build the precompiled source is on the same order as a regular compilation, so enabling precompiled headers for those modules just makes the build slower. Also make it possible to override the precompiled header by just setting PRECOMPILED_HEADER to empty. Change-Id: I0e1a09998253489388abfffd14b5f221288c4826 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Add debug operators for font database structs for easier debuggingTor Arne Vestbø2017-04-181-0/+18
| | | | | Change-Id: Ice1b27ff93de2d369dc6b66c72a64eb05da5639c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-04-181-1/+7
|\ | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.cpp Change-Id: I375fa4afa662fa411a15f212ebd5f2f0dffdba7f
| * QFontconfigDatabase: properly parse desktop environment variableMarco Trevisan (Treviño)2017-04-121-1/+7
| | | | | | | | | | | | | | | | | | | | $XDG_CURRENT_DESKTOP is defined as a colon-separated list of desktop strings, thus we can't check for equality, but split it and check if it contains the desktop environments we care about. Change-Id: Ia9ab0f28654a3e1a68b918794a079f3974f85642 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
* | QWindowsFontEngineDirectWrite: Fix build with MinGWFriedemann Kleint2017-04-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | In member function 'void tn::QWindowsFontEngineDirectWrite::collectMetrics()': windows\qwindowsfontenginedirectwrite.cpp:361:22: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] if (table.size() >= advanceWidthMaxLocation + sizeof(quint16)) { ^ Amends 17fc188aec5806167d3c6165b0ad299a8d2a6bcf. Task-number: QTBUG-58954 Change-Id: Ice2ff135d411b55d32290069b3c85ca0b5ea09af Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | macOS: Prevent leaking font data when creating QRawFont from QByteArraysTor Arne Vestbø2017-04-113-27/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | CTFontCreateWithGraphicsFont has a bug causing it to never release the graphics font, which cascades down to the data provider never being released and releaseFontData never being called. Instead of relying on a callback to release the byte array font data, we attach the font data to the engine's lifetime. Note that we are still leaking the CoreFoundation types. Change-Id: I6eda4212638ccc9439b90e004222272d204c707a Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | macOS: Don't marshal app font data via URL when using FreeType font engineTor Arne Vestbø2017-04-112-71/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Font descriptors can have attached attributes of any kind, not just pre- defined constants like kCTFontURLAttribute. We take advantage of this and attach the font data that was passed into addApplicationFont() to the font descriptor, so we can read it out directly when later creating an engine for it. This removes the need to build up a URL to represent the font data, which also didn't work for the memory-font use-case. The FreeType font engine now passes the same tst_QFontDatabase tests on macOS as the native CoreText font engine. This also fixes the leak caused by CTFontCreateWithGraphicsFont never releasing the graphics font, resulting in releaseFontData never being called: http://stackoverflow.com/questions/40805382/ We're now cleaning up the font data in releaseHandle, based on the attribute set on the font descriptor. Change-Id: Iba15222ec919f989e29fd98b263d9fb182c4d710 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Populate application fonts via font descriptors on Apple platformsTor Arne Vestbø2017-04-112-56/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | Instead of registering the font via CTFontManagerRegister we just create a font descriptor for the data/URL and populate that like normal system fonts. This makes the code more similar to how we deal with other fonts, shaves off a ms during font registration due to not registering the font, and fixes an issue on iOS where CTFontManagerRegister would invalidate earlier populated system font descriptors. Task-number: QTBUG-56765 Change-Id: I002a65075b15837c9a2d22573020d4c834111837 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Implement maxCharWidth() for DirectWrite engineEskil Abrahamsen Blomfeldt2017-04-112-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is used to create the bounding box in QFontEngine::properties(), which in turn is used for the FontBBox when generating PDFs. The result was that the bounding width in the output was 0 and Adobe Reader complained that the PDF was malformed. We could implement the proper bounding rect in properties() at some point, instead of assuming an origin at x = 0 for instance. The metrics for that are in the head table. But for silencing the warning in Reader, just implementing the maxCharWidth() function is sufficient. [ChangeLog][Windows][PDF] Fixed a bug in PDF output when using high-dpi scaling which was causing the display of warnings when opening the file in Adobe Reader. Task-number: QTBUG-58954 Change-Id: I2540571863d4dd0f85af533b591f75dad3f0d75b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-04-063-5/+14
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp src/platformsupport/fontdatabases/freetype/qfreetypefontdatabase.cpp src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp src/widgets/widgets/qtabbar.cpp Change-Id: Iaa9daee5f7a6490d56257a3824730a35751ceb05
| * Copy stretch to multifont fontDefAllan Sandfeld Jensen2017-04-051-0/+2
| | | | | | | | | | | | | | | | If we do not the fontDef of the multifont will be the default 0. Task-number: QTBUG-59443 Change-Id: Ib223517975b2a57b2371e309d12cd8f918d30825 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| * Fix stretch of QRawFontsAllan Sandfeld Jensen2017-04-051-0/+1
| | | | | | | | | | | | | | | | | | Set stretch to always have no transform on raw fonts. Task-number: QTBUG-59799 Change-Id: Ibfacc5c247e0b4a8410572e207f09f6e67b74f9d Reviewed-by: Konstantin Tokarev <annulen@yandex.ru> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| * QRasterBackingStore: Correct high-dpi image sizeMorten Johan Sørvig2017-04-041-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | Fix QT_SCALE_FACTOR usage on macOS. Follow-up to 2d2d9078 QRasterBackingStore should account for native scaling only. Any Qt scaling will have already been factored into the size argument. Change-Id: I26a67addfcbec3d45f4ed87f03b8dd79fd99cb62 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | macOS: Remove un-needed fontDef assignment in QCoreTextFontDatabaseTor Arne Vestbø2017-04-041-1/+0
| | | | | | | | | | | | | | The QCoreTextFontEngine constructor already sets the member (like it should). Change-Id: I6e59ff36c439857418a636de4056c20d2f65e8d4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | macOS: Use NSURL to resolve FreeType font names instead of CoreFoundationTor Arne Vestbø2017-04-041-28/+9
| | | | | | | | | | Change-Id: I4b397361c483fa07e4e95288f66d7f7ea2df8d9f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | macOS: Use shared code path for creating FreeType font engine for QRawFontTor Arne Vestbø2017-04-041-21/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The round trip via a CGFontRef to a CTFontRef so that we could pull out the kCTFontURLAttribute of the font makes no sense, as the input is just raw font data. None of the tst_QRawFont tests are able to pull out a URL, and none of the other platforms where FreeType is available resolve a filename from raw fonts. Without this change the tst_QRawFont test has 13 failed test cases and spits out 1250 QWARNs. With the patch all tests pass without warnings. Change-Id: I17965e7405d7161958ff0870825ce8190598288f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Move FreeType font engine creation for QRawFont into factory functionTor Arne Vestbø2017-04-043-48/+52
| | | | | | | | | | | | | | So that the logic can be used without subclassing the FreeType font database. Change-Id: Ib1ac0e1948ce18003b8eda0c1e8fbb3c7e6c8360 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | macOS: Split out font engine creation from QCoreTextFontDatabaseTor Arne Vestbø2017-04-042-69/+84
| | | | | | | | | | | | | | | | | | | | The Core Text font database can produce both Core Text and FreeType font engines. Refactor the code a bit so that the actual factory methods that differ between the two stand out, and do not require a granular runtime check in each method. Change-Id: Ib70f76f4a9001a8108d87c1101a50699a6ea8f55 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Share FreeType font engine creation code between platformsTor Arne Vestbø2017-04-046-57/+51
| | | | | | | | | | | | | | | | | | | | 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>
* | Rename QBasicFontDatabase to QFreeTypeFontDatabase which is what it isTor Arne Vestbø2017-04-0414-39/+39
| | | | | | | | | | Change-Id: I8def2f7ae1e4c8d8a3e1f8e60549da5d691e4fb3 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Rewrite FreeType-ifdef'ed function call in QCoreTextFontDatabaseTor Arne Vestbø2017-03-312-7/+4
| | | | | | | | | | | | | | | | Makes the code slightly less awkward to deal with. Change-Id: Ie98a04d812beecfbf0d19e77b8e784db783a19d6 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>