summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontengine_ft.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [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>
| * QFontEngine_FT: Don't check for null after dereferencing.Sérgio Martins2014-12-021-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | Must have been a copy paste mistake, the check is used in other places to make sure we don't unlockFace() without a lockFace(), but here we're certain lockFace() was called first. Makes Coverity happy. Change-Id: I679129727b29a40d780f4fa903f44f7cbc9ec8cf Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
| * Fix build due to source incompatible change with FreeType 2.5.4Sérgio Martins2014-12-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=b3500af717010137046ec4076d1e1c0641e33727 ../gui/text/qfontengine_ft.cpp: In member function ‘QFontEngineFT::Glyph* QFontEngineFT::loadGlyph(QFontEngineFT::QGlyphSet*, uint, QFixed, QFontEngine::GlyphFormat, bool) const’: ../gui/text/qfontengine_ft.cpp:1126:39: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] for (int x = 0; x < slot->bitmap.width; x++) { Change-Id: Idb58f9e5895aac8c02163870d7c7d4a49237086b Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-11-271-101/+25
|\| | | | | | | Change-Id: Id20053d261b4fbbcc0ac8ba49dd3ef2253fa4b95
| * Get rid of some duplicate code in QFontEngineFTEskil Abrahamsen Blomfeldt2014-11-251-101/+25
| | | | | | | | | | | | | | | | | | | | | | This removes some code duplication in the QFontEngineFT and it also removes the condition that loadTransformedGlyphSet() will return 0 if the font is too large to be cached, since this is handled by setting outline_drawing on the glyph set which will fall back to painter paths. Change-Id: I2fe6a963e854cdd7c6015154547dc06325cbe3b0 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-11-241-10/+65
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qiodevice.cpp src/plugins/bearer/linux_common/qofonoservice_linux.cpp src/plugins/bearer/linux_common/qofonoservice_linux_p.h src/plugins/platforms/android/qandroidplatformtheme.cpp src/tools/bootstrap/bootstrap.pro src/widgets/styles/qmacstyle_mac.mm Change-Id: Ia02aab6c4598ce74e9c30bb4666d5e2ef000f99b
| * Enable transformations for Qt Quick in FT engineEskil Abrahamsen Blomfeldt2014-11-201-10/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Qt Quick (or in Qt Widgets when setting QT_NO_FT_CACHE to 1 or when using OpenGL engine), the alphaRGBMapForGlyph() will be used to get glyphs, because we need to keep our own cache. Transforms was not supported in this code path, instead it was turned off in supportsTransformations(). This patch enables transformations in the alphaRGBMapForGlyph() and alphaMapForGlyph() code paths as well, since this is needed for proper rendering with QT_DEVICE_PIXEL_RATIO. Change-Id: I7d6b79918f7c0bcc051a8343b16b315bfbba59cf Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-10-271-0/+1
|\| | | | | | | | | | | | | Conflicts: src/gui/text/qfontdatabase.cpp Change-Id: I6ac1f55faa22b8e7b591386fb67f0333d0ea443d
| * Fix uninitialized value warning in QFontEngineFT.Axel Rasmussen2014-10-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When running an application which called e.g. QPainter::drawText under Valgrind, it would produce "Conditional jump or move depends on uninitialized value(s)" warnings, since we were allocating a buffer for a FreeType bitmap without initializing its contents. FreeType, apparently, does not set the value of all bytes in a bitmap buffer when it is used as a FT_Bitmap, so we were left with some uninitialized memory which was still being used. This commit fixes these warnings, and prevents any potential undefined behavior. [ChangeLog][QtGui][General] fixed use of uninitialized memory in the FreeType font engine Change-Id: Ia7b3595c78310ce41f76cb4546fc36016c0000a8 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | Merge remote-tracking branch 'origin/5.4' into devOswald Buddenhagen2014-09-291-19/+11
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qbytearray.cpp src/gui/image/qimage.cpp src/gui/image/qppmhandler.cpp src/gui/kernel/qguiapplication.cpp src/gui/painting/qpaintengine_raster.cpp Change-Id: I7c1a8e7ebdfd7f7ae767fdb932823498a7660765
| * Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | | | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* | Add Grayscale8 and Alpha8 formats to QImage and drawingAllan Sandfeld Jensen2014-09-171-8/+3
|/ | | | | | | | | | | | Extend the QImage format with two 8-bit grayscale and alpha formats. These formats have the advantage over Indexed8 that they have simpler conversion and can be rendered to by the raster engine. [ChangeLog][QtGui][QImage] Added support grayscale and alpha 8-bit formats which can also be rendered to. Change-Id: I4343c80a92a3dda196aa38d0c3ea251b094fc274 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Fix advance of zero-width spaces in fonts that omits the glyphAllan Sandfeld Jensen2014-09-011-7/+18
| | | | | | | | | | | | | | | Some fonts appear to include zero-width space in the CMAP table, but not include an actual definitions of the glyph they point to. The missing glyph causes a warning, but isn't handled making the character end up being giving the same metrics as whatever character it came after. This patch adds explicit handling of missing glyphs, and also caches their missing state when caching is enabled. Task-number: QTBUG-40912 Change-Id: I06fba9c01df59548e750e36babfdd5a6bafd6bd0 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Outline drawing should not override the default freetype loadflagsAllan Sandfeld Jensen2014-08-211-1/+1
| | | | | | | | | | We set FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH as the default load flags for freetype fonts, but due to using = instead of =| the default flags gets overridden when outline drawing sets FT_LOAD_NO_BITMAP. Change-Id: I26b45aa2bbf613689d278eb07ae028ef9757023c Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Support autohint and lcdfilter fontconfig configurationAllan Sandfeld Jensen2014-08-161-0/+4
| | | | | | | | | This patch adds support for reading autohint and lcdfilter settings from fontconfig and pass them on to freetype. Task-number: QTBUG-32254 Change-Id: Iaa69b70f7005ee7f21126a8d984c07b3a46a3e7f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Move SubpixelAntialiasingType from QFontEngineFT to QFontEngineAllan Sandfeld Jensen2014-08-141-6/+6
| | | | | | | | | | | To be able to use the SubpixelAntialiasingType enum without depending on QFontEngineFT we need to move it to QFontEngine. The patch also cleans up the left-overs of other enums moved the same way. Change-Id: I025bc8a5b429d376cfab0a643121ed6f99204988 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Fix FT glyph outline to path conversionBernd Weimer2014-05-071-12/+24
| | | | | | | | | | | | | When the start point is not on the curve, the end point will be used as starting point for the QPainterPath, if it is on the curve - if it is not on the curve, the mid point between start and end point will be used. The origianl start point will still be used as a control point for the first bezier curve. Task-number: QTBUG-38601 Change-Id: I90e07f1141288873263f1f12fa51e6a248d0804f Reviewed-by: Fabian Bumberger <fbumberger@rim.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix rendering of grayscale antialiased FT fonts on QGLWidgetAllan Sandfeld Jensen2014-03-151-4/+5
| | | | | | | | | | | | | QFontEngineFT::alphaMapForGlyph and QFontEngineFT::alphaRGBMapForGlyph has been broken since change#65694. They always fall back to using the path rendering of QFontEngine because we zero the scoped pointer just before testing it. To fix it we need to release the scope pointer after we are done using it. Change-Id: I8811c1f5261f286f2f3dd3c0f93c988ba0909669 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Use QStringIterator instead of homebrewKonstantin Ritt2014-03-101-14/+7
| | | | | | | Task-number: QTBUG-15664 Change-Id: I1ed3eb04ddd822e57a4d993af656dfe283f3af1a Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Make QFontEngine::type() non-virtualKonstantin Ritt2014-03-051-0/+1
| | | | | Change-Id: I24ece90d6d8f96dad0c41a474a491b4ea96d97c3 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Optimize glyph lookups with QFontEngine::glyphIndex(uint)Konstantin Ritt2014-03-051-16/+4
| | | | | | Change-Id: I56c7e727f3d9b08195f38939106620c744c6eaf0 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Introduce a generic QFontEngine::canRender() implementationKonstantin Ritt2014-03-031-13/+0
| | | | | | | | ...which uses the recently introduced glyphIndex() method; get rid of re-implementations that did almost the same. Change-Id: I6d32d2cee6a31f57de6aee05ed8d120d4a1f4e9c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Introduce QFontEngine::glyphIndex(uint)Konstantin Ritt2014-03-031-0/+30
| | | | | | | | | ...an optimized drop-in replacement for the code like this: `stringToCMap(&uc, 1, &g, &numGlyphs, QFontEngine::GlyphIndicesOnly)` (aka "get the glyph index for exactly one Unicode character"). Change-Id: I22babf49f7cf28892d27533a5ac51ad449779f75 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Unify QFontEngine*::stringToCMap() behaviorKonstantin Ritt2014-03-031-0/+1
| | | | | | | | Ensure the params are valid and make QCoreTextFontEngine::stringToCMap() handle the unsufficient buffer case exactly like the other engines does. Change-Id: I078af37da917cf2bac709b12aa827ed4128e5f30 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Unify QFontEngine::getSfntTableData() behavior on all platformsKonstantin Ritt2014-03-021-0/+1
| | | | | | | | | | | | Being a most significant method in the font API, getSfntTableData() must behave in exactly the same way on all platforms. Briefly, it must return true if the table exists in the font, despite the other params, and always stores the table data length in 'length' param, thus reporting the amount of bytes actually needed to store the table data in a buffer. Change-Id: I7a15465020c1ea818ea46a05ea3b9b7e1cd60d14 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix QFontMetrics widthBernd Weimer2014-02-201-1/+1
| | | | | | | | | | | | | | | | | Commit f4dd534 introduced a regression, so that QFontMetrics reported a wrong size (to be more specific width) for FreeType fonts. The calculation of glyph advances has to to reflect (rounded) integral number of pixels. This was only done when the glyph was cached. So in some cases the first call to QFontMetrics::size gave a different result than the second. This patch reverts f4dd5344fbbce257a40e014acc4e87f4773f40. The tst_QFontMetrics::same auto test only happened to work on some platforms, on BlackBerry for instance it did not. Extended the test case to make sure it works for different font sizes. Change-Id: Ia5bb9abd3ff98193c9bba048b85207672ed8d9c3 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Unify glyph format between QFontEngine and QFontEngineGlyphCacheTor Arne Vestbø2014-02-191-5/+3
| | | | | | | | | | | | Instead of the glyph cache having its own cache type that always mapped one to one to a font engine glyph format, causing confusion and needless conversions, the glyph caches now use QFontEngine's glyph format enum. This also removes the iffy use of an int for the glyphFormat in the font engines. Change-Id: I529bad5c179e004f63e152f7dcc311d298c3db98 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Frederik Gladhorn2014-02-111-10/+19
|\ | | | | | | refs/staging/dev
| * Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-02-071-10/+19
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qguiapplication.cpp src/plugins/platforms/android/androidjnimain.cpp src/plugins/platforms/android/qandroidplatformintegration.cpp src/plugins/platforms/android/qandroidplatformintegration.h src/plugins/platforms/android/qandroidplatformopenglcontext.cpp src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/sql/doc/src/sql-driver.qdoc src/widgets/widgets/qtoolbararealayout.cpp Change-Id: Ifd7e58760c3cb6bd8a7d1dd32ef83b7ec190d41e
| | * Fix crash due to a stale pointer dereferencingKonstantin Ritt2014-01-161-10/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The HB face caching mechanism introduced in 227e9a40cfeb7e00658cd3 wasn't complete due that fact that HB-NG doesn't parse the entire font table at once but rather references a table on-demand. This incompleteness caused a crash in case the engine doesn't get cached or when it removed from the cache and then re-used. Task-number: QTBUG-36099 Change-Id: I7816836107655ce7cf6eb9683bb5dc7f892f9cd1 Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com> Reviewed-by: Michael Krasnyk <michael.krasnyk@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
* | | Optimize stringToCMap() usageKonstantin Ritt2014-02-071-5/+14
|/ / | | | | | | | | | | | | | | | | | | | | | | CMAP guarantees there is 1:1 mapping between the Unicode code points array and the glyph indexes array, which means the QString length always greater than or equal to a sufficient glyph indexes array length. Simply add some asserts and improve the memory consumption and the performance where possible. Change-Id: I0bc8cdba5f86c1c0ba9e79c8d5f96cbe56ec463e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Fix character mirroring issue with HarfBuzz-NGKonstantin Ritt2014-02-041-3/+0
| | | | | | | | | | | | | | | | | | | | HarfBuzz-NG does character mirroring where appropriate. A simple solution is to unset RightToLeft shaper flag when text gets shaped with HB-NG. Instead, move the mirroring code right to HB-old proxy function and decrease code duplication. Change-Id: Icdcd50b73b3e6a43da4b85addc7d8f51edf86512 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Get rid of QGlyphLayout::advances_yKonstantin Ritt2014-01-301-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...and thus consume 4 bytes less per glyph and increase the performance a bit. It seems, the only CTFontGetAdvancesForGlyphs() returns both x and y advances, though y advances are always equal to 0 for horizontal orientation and x advances are always equal to 0 for vertical orientation. Also, rename `advances_x` to `advances` for consistency and declare QGlyphLayout's data size in a single place. Change-Id: I56b20f893f8a6feb7aa870e3edbca99dd93ba2e2 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Fix rounding issueKonstantin Ritt2014-01-241-1/+1
| | | | | | | | | | | | | | | | The correct rounding that respects ForceIntegerMetrics flag is done just a few lines below. Change-Id: I8e79ebaded90753092ecd3e99eece8df4c824362 Reviewed-by: Lars Knoll <lars.knoll@digia.com>