summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontengine_ft.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-011-1/+4
|\ | | | | | | | | | | | | | | Conflicts: src/widgets/itemviews/qabstractitemview.cpp src/widgets/itemviews/qabstractitemview_p.h Change-Id: I54589b1365103cb1749186af92aab03a49c94b64
| * Fontengine: Avoid invalid alpha maps when antialiasing is offEirik Aavitsland2016-07-271-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When font antialising is disabled, the created alpha maps will be Mono format. Make sure that the created QImage is valid by ensuring that it has a color table of the right size. Issue was earlier handled by a4e2f2e687ca7aec88ecf82f72d42ac61e17a5b9, but that will be partially reverted because of compatibility break. Task-number: QTBUG-50745 Change-Id: I7c521288469ae94805a3326644771270d97ab979 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Preserve the scale of fonts when caching the font engineMichael Sheldon2016-07-191-18/+18
| | | | | | | | | | | | | | | | | | | | Associates the scalableBitmapFactor with the freetype QFontEngine so that it is preserved when caching the engine Task-number: QTBUG-53652 Change-Id: I010f9d235ccf30679b112e0c05e01bc247a3693f Reviewed-by: jian liang <jianliang79@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Support color font rendering for freetype engineJian Liang2016-05-031-48/+186
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch mainly do two things: 1) Support color bitmap font for freetype fontengine. This partially based on Corentin Jabot's patch 2) Support ARGB opengl glyph cache when workaround_brokenFBOReadBack is true (It is always true under Android). Some code refactor has been done in QOpenGLTextureGlyphCache. This patch also bump the minimal required freetype version to 2.2 [ChangeLog][General][Freetype] Support color font rendering Task-number: QTBUG-35156 Change-Id: I35aae5f98ba9a27b70a48db3f2647fc070c39c33 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Change some members of QFontEngineFT::Glyph to shortJian Liang2016-04-291-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some color bitmap fonts will have a size greater than 127 pixels, areMetricsTooLarge() will return true(its advance exceed 127) for these fonts and we are unable to render these fonts since QFontEngineFT::loadGlyph() will simply do nothing if areMetricsTooLarge() return true. To support bitmap font whose size is between 128 and 255, we change x,y,advance of QFontEngineFT::Glyph to short variable to make areMetricsTooLarge() return false, in this way we will be able to render such color bitmap fonts. Change-Id: I9ab244b14884cdde91040a462f2fbca650b91289 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-041-1/+12
|\| | | | | | | Change-Id: I35ca979395620e104e50b06366d0869433a4ffc2
| * QFontEngineFT: Apply hinting for non-scaled rotated glyphsAlexander Volkov2016-03-301-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Scaled hinted glyphs looks ugly, see QTBUG-24846. It was fixed in 6da6845f078e419ccb555fe1dd152e0ba82a7e88 by disabling hinting for them. But at the same time that commit also disabled hinting for glyphs with the most common transformation - rotating without scaling. Detect this type of transformation and don't disable hinting for it. Change-Id: I0e69a2b60e7e4bc24e9efc4fdedb984df07ad15c Task-number: QTBUG-50574 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
| * QFontEngine: Add handle() functionGabriel de Dietrich2016-03-291-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both QFont::handle() and QFont::freetypeFace() used to be available in Qt 4 but were removed in Qt 5. There's currently no API to get access to the native font handle, which the font engine holds in a way or another. Similar to the way it was in Qt 4, the actual handle type depends on the font engine currently in use. The types map as follows: Font Engine Native Handle ------------------------------------ DirectWrite IDWriteFontFace * Freetype FT_Face Mac CTFontRef Win HFONT All other font engines return a null handle. Change-Id: I3bea8259ac1378fd24079723aa6603bf9e74834c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-111-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 UB in QFontEngineFT::loadGlyph()Marc Mutz2016-03-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reported by UBSan: src/gui/text/qfontengine_ft.cpp:1079:54: runtime error: null pointer passed as argument 1, which is declared to never be null The default-constructed QScopedArrayPointer is not reset() in every code path. In fact, in the code path leading to this memset, the only reset() call is in the if block right above it, so move the memset into the if block. Change-Id: I1f793c313ca56f3315c6bdd55456cb025cafc089 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | QFontEngine: use RAII for font_, face_ membersMarc Mutz2016-03-041-11/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Wrap the pairs of (void *ptr, void (*dtor)(void*)) in essentially a std::unique_ptr. This simplifies code and provides the correct implicit destruction, so we can drop the explicit glyph-cache clear()ing in ~QFontEngine(), leaving that job to ~QLinkedList. A subsequent change will turn the QLinkedList into a C array, the clearing of which would otherwise cause excessive code bloat. Since we can't use std::unique_ptr, yet, provide a hand-rolled replacement for now, marking it for replacement with unique_ptr once we can use it. Make that a local type instead of providing a Qt-wide unique_ptr so we don't accidentally lock ourselves into a half-baked std clone we can't get rid of anymore. To prepare unique_ptr use with the same type-erased deleter (function pointer) as now, replace a nullptr destroy_function with a no-op function, so ~unique_ptr doesn't crash when we port to it later. Because QFreetypeFace contains the same construct and shares payloads with QFontEngine, use the Holder there, too. Even saves 150b in text size on optimized GCC 5.3 AMD64 builds. Change-Id: I5ca11a3e6e1ff9e06199124403d96e1b280f3eb2 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-02-241-2/+2
|\| | | | | | | | | | | | | | | | | | | | | 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
| * QFontEngineFT: Fix Clang warning about using uninitialized variables.Friedemann Kleint2016-02-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | gui/text/qfontengine_ft.cpp(1743,5) : warning: variable 'bytesPerLine' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized] gui/text/qfontengine_ft.cpp(1743,5) : warning: variable 'format' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized] The default branch is marked Q_UNREACHABLE, but apparently Clang does not recognize it. Task-number: QTBUG-50804 Change-Id: Idfce8cb2b9a481dd67a18d9952b920ad4f71e0f4 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-02-181-3/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Fix artihmetic exception when using non-scalable fontsEskil Abrahamsen Blomfeldt2016-01-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For non-scalable fonts, the units_per_EM in FreeType is documented to be undefined and will default to 0, which means that any division by it will cause an exception. The emSquareSize() function already checks if the font is scalable and returns y_ppem if not, so lets use it instead in all locations where we're not already sure the font is scalable. [ChangeLog][Text][Freetype] Fixed a divide-by-zero exception when accessing bitmap fonts. Change-Id: I8839d4c83047fb3f6bb4d69af0258e94a258a4d9 Task-number: QTBUG-45963 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-01-211-1/+1
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qiodevice_p.h src/corelib/kernel/qvariant_p.h src/corelib/tools/qsimd.cpp src/gui/kernel/qguiapplication.cpp tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp Change-Id: I742a093cbb231b282b43e463ec67173e0d29f57a
| * Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2016-01-191-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/common/atomic64/atomic64.cpp configure src/3rdparty/forkfd/forkfd.c src/corelib/io/forkfd_qt.cpp src/widgets/kernel/qwidgetwindow.cpp tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp tools/configure/configureapp.cpp Change-Id: Ic6168d82e51a0ef1862c3a63bee6722e8f138414
| | * The cache_cost is measured in bytes and not kilobytes.Andy Shaw2015-12-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | When increaseCost() is called then it will convert from bytes to kilobytes so we need to specify the cache_cost to be in bytes. Task-number: QTBUG-47812 Change-Id: I842514c9ab4d86b60b2beb6c80979156ea0de59c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@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>
* | Freetype font engine: Restrict bold depending on OS2 weight class.Friedemann Kleint2015-12-031-2/+6
| | | | | | | | | | | | | | | | | | Limit setting bold to weights <=750. Task-number: QTBUG-48922 Change-Id: Id38b636698e58b0686dda9711ee1b3426a3b45b9 Reviewed-by: Gunnar Roth <gunnar.roth@gmx.net> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | QFontEngineFT: Optimize format convertion code with template magicKonstantin Ritt2015-11-161-16/+38
| | | | | | | | | | | | | | | | Avoids in-loop check for every pixel by costs of slightly bigger code. Change-Id: I8321d0945ac6b677786431670b2316c60e4db492 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | QFontEngineFT: Revise the legacy LCD filter implementationKonstantin Ritt2015-11-161-22/+15
| | | | | | | | | | | | | | | | | | | | | | Use an optimized version of the intra-pixel filter found in FreeType's _ft_lcd_filter_legacy(). Gives us somewhat better accuracy and better performance. Change-Id: Id4200b67e6ff55f605037c3e5464fef8bb03fbde Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | QFontEngineFT: Minor optimization to convertGRAYToARGB()Konstantin Ritt2015-11-131-6/+9
| | | | | | | | | | | | | | | | | | Precalculate everything we can and use faster loop. Make inlined as it is used just in a single place. Change-Id: If3c33d60739eb4ce896020321442ae81edd1c13d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Move min left/right bearing calculations to QFontEngine baseclassTor Arne Vestbø2015-09-021-49/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The logic used in the FreeType font engine can be generalized and move to the QFontEngine baseclass. This allows the CoreText font engine to correctly report the minimum left/right bearings, which decreases the chance that an optimization in QTextLayout's line breaking algorithm will produce wrong results. The calculation of left and right bearing has been moved to the glyph_metrics_t type to reduce code duplication. This allows us to use the with and height of the bounding box to determine if the glyph has any contours. Change-Id: I864697d3f31ed56f22f04666199b6c5023c5e585 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | Move setter for QFont::HintingPreference to QFontEngineFT.Andreas Hartmetz2015-08-141-5/+26
|/ | | | | | | Preparation for also using it from QCoreTextFontDatabase. Change-Id: I9cbef59c21f343a88a5cb3fdbee1ed4791d7a36e Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* Don't assign iterator to const_iteratorSérgio Martins2015-06-021-1/+1
| | | | | | | | It should also be possible to use QT_STRICT_ITERATORS in Qt's own code base Change-Id: I0914db480d4d2b06e71e3a2588163efdd3ff6d27 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* [QFontEngineFT::loadGlyph] Fix reversed condition.Friedemann Kleint2015-04-081-6/+6
| | | | | | | | | | Introduced by 237cb0d082b5518cecf42f1a2186134799de745e (Consolidate paths for fetchMetricsOnly cases). Task-number: QTBUG-45444 Change-Id: Icd642c09490f1cfc5804313d60d467290ae599ba Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* [QFontEngineFT::loadGlyph] Consolidate paths for fetchMetricsOnly casesKonstantin Ritt2015-04-071-25/+26
| | | | | | | | | Use GlyphInfo as a temporary buffer for storing the glyph metrics and go through the same code for fetchMetricsOnly and !fetchMetricsOnly. Change-Id: If8bb85056e5f09588cc3956b43dc51a54d5aecfe Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [QFontEngineFT] Move code around to improve readability (no-op)Konstantin Ritt2015-04-071-21/+14
| | | | | | | | Move some variables initialization closer to the usage context. Change-Id: I0f1de0ddc9f0fbe3ec4a56455ccc14f9e8d94e5a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [QFontEngineFT] Avoid double-negation of info.xKonstantin Ritt2015-04-071-4/+4
| | | | | | | | Make it consistent with fetchMetricsOnly path. Change-Id: I6a2d2568d5579255582217515a4e598722547c60 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [QFontEngineFT] Guarantee correct metrics for alphamap and its bounding boxKonstantin Ritt2015-04-071-38/+8
| | | | | | | | ...for both cached and non-cached modes, by disabling hinting for transformed glyphs in loadGlyphFor(). Change-Id: I13766a653ebd72cbed0f5c38ca3536d042aed762 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [QFontEngineFT] Consolidate .*lpha.*MapForGlyph() behaviorKonstantin Ritt2015-04-071-71/+52
| | | | | | | ...and decrease code duplication. Change-Id: I5eb3c0694dde9030405a3bd3d410ff9784ed7717 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [QFontEngineFT] Get rid of redundant lockFace()/unlockFace() callsKonstantin Ritt2015-03-201-8/+0
| | | | | | | loadGlyphFor() locks the face when needed. Change-Id: Ia02dce08243499f9f11b345dcdfa5d9e0a3bc889 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [QFontEngineFT] Fix memory leaks and possible double deletionsKonstantin Ritt2015-03-201-13/+18
| | | | | | | | | | | The glyph returned by loadGlyph() must be freed manually when caching is not enabled, except when it is a placeholder for a missing glyph. This is a fix-up for d18ccbb5be23eaea5eb5f1af2ae0fba334ab21d7. Task-number: QTBUG-32792 Task-number: QTBUG-44812 Change-Id: I410fa1b7703e306739d9dae35fff06af6c79dce0 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [QFontEngineFT] Fix alphamap creation for a cached glyph with no dataKonstantin Ritt2015-03-121-1/+1
| | | | | | | | | In case the loadGlyph() was called for a glyph to fetch metrics only, loadGlyphFor() never fetches the data for that glyph but returns a non-null result. Change-Id: I2b258c4b7880059d41dc02f1e5a43903706d3888 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [QFontEngineFT] Avoid caching a transformed glyph in defaultGlyphSetKonstantin Ritt2015-03-121-16/+4
| | | | | | | | and only cache non-scalable glyphs in defaultGlyphSet if a requested transform is translation. Change-Id: I49d936736871bd455e573335c014ddefe8bb915e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [QFontEngineFT] Move some code around to improve readabilityKonstantin Ritt2015-03-121-6/+3
| | | | | | | And avoid conversion when the cached FT transform could be used. Change-Id: I9f6bf0a6c6fa166092de698f3ddbbf203e2b3820 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [QFontEngineFT] Use QScopedArrayPointer to auto-free the bitmap bufferKonstantin Ritt2015-03-111-21/+24
| | | | | | | | | Also track the allocated buffer length and re-use the existing buffer instead of allocating a smaller one, where possible. Change-Id: I494519d653522622b1fe4ec80ac9035e2c3d9714 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [QFontEngineFT] Use FT_Library associated with a given faceKonstantin Ritt2015-03-091-5/+3
| | | | | | Change-Id: I4f9927e2c5cb014523bebbe9c719aca89bb86019 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-02-241-3/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/xml/htmlinfo/simpleexample.html examples/xml/rsslisting/rsslisting.cpp qmake/generators/win32/msbuild_objectmodel.cpp src/3rdparty/harfbuzz-ng/src/hb-private.hh src/corelib/global/qlogging.cpp src/corelib/io/qstorageinfo_unix.cpp src/corelib/thread/qwaitcondition_unix.cpp src/gui/kernel/qguiapplication.cpp src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp src/testlib/doc/src/qt-webpages.qdoc tests/auto/other/qaccessibility/tst_qaccessibility.cpp Change-Id: Ib272ff0bc30a1a5d51275eb3cd2f201dc82c11ff
| * REG: Fix misplaced outline drawn text with native renderingEskil Abrahamsen Blomfeldt2015-02-051-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change c238d34137ffe80d30933733a12aa2893b9631c2 was a refactoring which slightly changed behavior. In the case of fetching the alpha map's bounding box, before we would call loadGlyph() even for the case of outline drawing, as the correct bounding rect is still needed for this case. In loadGlyphFor() however, 0 was always returned for this case, as it was only used for populating the cache. The simple fix for this is to add a bool to loadGlyphFor() which adapts the original behavior when set, similar to the fetchMetricsOnly bool in the loadGlyph() functions. Change-Id: I76296c8aaeddbdae9e4c27ed2b30b7d59ff0843b Task-number: QTBUG-44273 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | [QFreetypeFace::addBitmapToPath] Get rid of unused paramKonstantin Ritt2015-02-201-2/+2
| | | | | | | | | | Change-Id: I09bd94c1c82ce198406dd71e96311e56cbfe0ab5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@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 "Merge remote-tracking branch 'origin/5.4' into dev" into refs/staging/devSimon Hausmann2014-12-301-30/+0
|\ \
| * | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-12-291-30/+0
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qbytearray.cpp src/gui/kernel/qplatformsystemtrayicon.cpp src/gui/kernel/qplatformsystemtrayicon.h src/plugins/platforms/xcb/xcb-plugin.pro Change-Id: I00355d3908b678af8a61c38f9e814a63df808c79
| | * Remove unused code from QFontEngineFT.Rafael Roquetto2014-12-181-30/+0
| | | | | | | | | | | | | | | | | | | | | | | | This method is not being called anywhere. Change-Id: Ia32e8b48d324e4848db666de4d274a260d22b06d Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | | Set the minimum required FreeType version to 2.1.10Konstantin Ritt2014-12-291-50/+19
|/ / | | | | | | | | | | | | | | ...and get rid of workarounds for older versions, which also makes the code more readable. Change-Id: I087110c5f60cd664dad241776e1a0df901989c75 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Merge remote-tracking branch 'origin/5.4' into devSimon Hausmann2014-12-101-7/+15
|\| | | | | | | | | | | | | | | Conflicts: doc/global/template/style/online.css mkspecs/android-g++/qmake.conf Change-Id: Ib39ea7bd42f5ae12e82a3bc59a66787a16bdfc61
| * Fix loading of web fonts with broken hinting bytecodeAllan Sandfeld Jensen2014-12-041-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Fira Sans font by the Mozilla Foundation has bytecode that goes into an infinite loop. Fortunately FreeType catches the case, but we fail to render any glyphs and spends too long trying the bytecode on every glyph. This patch instead switches the font to auto-hinting when this error is encountered. Task-number: QTBUG-41034 Change-Id: Icd044b41396a06fb435bc189cdbd71d703107de6 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
| * FreeType: Fix font rendering with fonts with embedded bitmapsSérgio Martins2014-12-041-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only reproduced with Windows font Calibri. This font has both outline (vector) and bitmap glyphs. QFontEngine_FT has an hack to get metrics from EBLC table, but this might fail, resulting in a 0 ascender and descender, meaning QFontMetrics::height() will be 0, meaning totally broken text. This patch checks for that failure, and fallbacks to the outline metrics instead of the bitmap ones. Task-number: QTBUG-42898 Change-Id: If33fc3404d0c7f84557f8c4a5ae71b30f78d60a7 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>