summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowsfontengine.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.4' into 5.5Oswald Buddenhagen2015-07-171-8/+8
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: doc/global/manifest-meta.qdocconf src/corelib/global/qnamespace.qdoc src/corelib/io/qstorageinfo_unix.cpp src/corelib/tools/qtools_p.h src/sql/drivers/psql/qsql_psql.cpp Change-Id: I23a15ac84e03ad61d865e3df872b013eb0752949
| * Better handling of invalid font tables5.4Eskil Abrahamsen Blomfeldt2015-07-101-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | Specifically when reading files with broken cmap tables, we could get some undeterministic results. We handle this more gracefully by verifying that the offsets are sane and bailing out early if not. This replaces the current pattern throughout the font engine for consistency. Change-Id: I507bba49c0be634afca77d1eb3d199a427451bee Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Treat color (ARGB) glyphs, e.g. Emoji, as having unreliable glyph outlinesTor Arne Vestbø2015-06-261-1/+1
| | | | | | | | | | | | | | | | | | | | This is used by the scene graph to automatically switch over from distance field text to native text rendering for the given glyph node, which allows mixing regular text with Emoji in e.g. a Text item without having to set renderType to Text.NativeRendering. Change-Id: I5d96d1dab329a975e3442284bf4c5a82174177c9 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | Simplify QWindowsFontDatabase::createEngine()Konstantin Ritt2015-03-201-6/+9
| | | | | | | | | | | | | | Reduce code duplication and improve readability. Change-Id: Idf53c80077daa9bac03a72acfd2b6c7e3a24ad97 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | Fix design metrics for text on WindowsEskil Abrahamsen Blomfeldt2015-03-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The trick to get design metrics on Windows is to request the font with the design size, however we were passing the em square size in as the cell height instead of the em square size (aka character height in Windows docs). This would give us hinted metrics and thus the design metrics would differ from other platforms. [ChangeLog][Windows][Text] Fixed design metrics for text Task-number: QTBUG-44501 Change-Id: I4cffc3b86359cfdaf2ece07e1259f6fa862132bc Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | [QWindowsFont*] Unify HFONT fallbacksKonstantin Ritt2015-02-121-2/+2
| | | | | | | | | | | | | | | | | | | | 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>
* | Make it more obvious that Q_WS_ is dead code, and should perhaps be portedTor Arne Vestbø2015-02-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | We still have a bunch of Q_WS_ ifdefs in our code, which are easy to mistake for Q_OS_ ifdefs when quickly scanning the code. By renaming the ifdefs we make it clear that the code in question is dead. In incremental follow-ups, we can then selectively either remove, or port, the pieces that are dead code. Change-Id: Ib5ef3e9e0662d321f179f3e25122cacafff0f41f Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Don't remember if passed HFONT was a stock objectKonstantin Ritt2015-02-021-12/+5
| | | | | | | | | | | | | | | | | | | | 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-3/+2
| | | | | | | | | | | | 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-1/+1
| | | | | | | | | | | | 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-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.4' into devSimon Hausmann2014-12-181-1/+1
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.h src/platformsupport/platformcompositor/qopenglcompositor.cpp src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp tests/auto/gui/kernel/qwindow/tst_qwindow.cpp Change-Id: I5422868500be695584a496dbbbc719d146bc572d
| * Fix PDF when embedding fonts with large internal leadingEskil Abrahamsen Blomfeldt2014-12-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Setting lfHeight to a positive value in LOGFONT requests the font with the given cell height, which is em square size + internal leading. When setting this to the em square size, it means we will get glyphs that are actually sized for an em square with sides that are (emSquareSize - internalLeading). For most fonts, this was not noticeable, but for some fonts with large internal leading, the resulting glyphs would be very small. When setting lfHeight to something < 0 instead, we are selecting the font with the given character height instead, which is not including the internal leading. [ChangeLog][PDF] Fix embedding glyphs from fonts with large internal leading. Task-number: QTBUG-43082 Change-Id: Id74cf2279df2062804e9431fe305d803cb0b19d2 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-11-271-2/+3
|\| | | | | | | Change-Id: Id20053d261b4fbbcc0ac8ba49dd3ef2253fa4b95
| * Fix potential access to uninitialized memberKonstantin Ritt2014-11-251-2/+3
| | | | | | | | | | | | | | | | If GetTextMetrics() failed, there is no guarantee that TEXTMETRIC is initialized with any safe values. Change-Id: Idb5e3bc1bc2451368950978365487c908ce529e7 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | Merge QFontEngineMultiBasicImpl and QFontEngineMultiKonstantin Ritt2014-11-261-21/+7
| | | | | | | | | | | | | | Minor refactoring also improves the behavior and the code readability. Change-Id: Id89dd224f4132a4c0dfbc16f414ef42cc8d8a4da Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-11-241-3/+1
|\| | | | | | | | | | | | | | | | | | | | | | | 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
| * windowsfontengine.cpp: Fix coding style violation and warning.Friedemann Kleint2014-11-111-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | In function 'bool addGlyphToPath(glyph_t, const QFixedPont&, HDC, QPainterPath*, bool, glyph_metrics_t*, qreal)': windowsfontengine.cpp:808:17: warning: comparison between signed and unsigned iteger expressions [-Wsign-compare] if (res == GDI_ERROR) { Introduced by 4aba2d07d2fe67beaf544a4b38c5b9aa8b8ec39b . Change-Id: Ie4d903e65ff45461af5ede18efe8e3c6c12af7e6 Task-number: QTBUG-12799 Reviewed-by: Nicolas Froment <lasconic@gmail.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into devOswald Buddenhagen2014-09-291-22/+37
|\| | | | | | | | | | | | | | | | | | | | | 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>
| * Use metrics returned by GetGlyphOutline in GGO_METRICS modelasconic2014-09-181-3/+26
| | | | | | | | | | | | | | | | | | | | | | GetGlyphOutline Windows API returns wrong values when used with an OpenType PS font and in GGO_NATIVE mode. It causes problem when exporting to PDF. The fix changes the GetGlyphOutline call to use GGO_METRICS instead. Task-number: QTBUG-12799 Change-Id: I47d6d16b6e7819b51bc444420ada4a47d5f24f4e Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* | Add Grayscale8 and Alpha8 formats to QImage and drawingAllan Sandfeld Jensen2014-09-171-9/+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>
* Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-08-121-0/+2
|\ | | | | | | | | | | | | | | | | | | | | | | Manually included changes from 3a347a4e70e5a10ee92dd2578316c926a399e894 in src/opengl/qgl.cpp. Conflicts: src/opengl/qgl_qpa.cpp src/plugins/platforms/android/androidjnimain.cpp Change-Id: Ic26b58ee587d4884c9d0fba45c5a94b5a45ee929
| * Windows: Fix stored family name of fallback fontsEskil Abrahamsen Blomfeldt2014-08-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we create fallback fonts, we copy the fontdef of the main font, but we need to update the family name to match reality, otherwise a QRawFont created with the font engine will have the wrong family name. This is already done in the default implementation of loadEngine(), but was missing from the Windows implementation. One large consequence of this was that when the distance field renderer cloned the font engine (to change its size), it would clone it with the wrong family name. When it later painted its glyph indexes, they would of course refer to the wrong font (the fallback) so random characters would appear. [ChangeLog][Windows] Fixed using QRawFont with fallback fonts, e.g. in the case of text rendering in Qt Quick. Task-number: QTBUG-39172 Change-Id: Ic8fcd9dfc20ec7aadf0b47d4a80417f401f355fd Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | Drop some qtextengine_win.cpp leftoversKonstantin Ritt2014-05-201-5/+0
| | | | | | | | | | Change-Id: Id0d39acfcb340b40e51b8d06a4308df809a8fc1b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | qpa: Clean up and refactor qfontengine_qpaTor Arne Vestbø2014-05-151-1/+1
|/ | | | | | | | | | | QFontEngineQPA was really QFontEngineQPF2, and has been renamed. The multi font engine in qfontengine_qpa.cpp was really a base implementation of a multi font engine, used by other multi font engines, and has been renamed and moved accordingly into qfontengine_p.h/cpp. Change-Id: Iac7409c4dbf0fdc3ee993ce4f7dc96cb00a422e6 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Add virtual function to QFontEngine report if outlines are reliableJørgen Lind2014-05-061-0/+21
| | | | | | | | | GetGlyphOutline fails for ttf fonts with embedded bitmaps. This results in distancefield rendering not rendering glyphs (for the failed paths). We need to fall back to texture rendering if this is the case. Change-Id: Ibdf7dc5c1d34f513c436f88fabbdcc4089bb6fef Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Fix copy-paste error.Richard J. Moore2014-04-181-1/+1
| | | | | | | | | Fix copy-paste error identified by static analysis at http://www.viva64.com/en/b/0251/ Change-Id: I214d6bf8494a946a6c772b6dca1395e4140a471f Reviewed-by: Daniel Molkentin <daniel@molkentin.de> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Make QWindowsMultiFontEngine support deferred fallback families queryKonstantin Ritt2014-03-311-25/+4
| | | | | | | | | | This finishes 800232e1d3ebfbac28d07014a3c646ea00fcf6ad, which encovered a tricky issue in QFontEngineMultiQPA::createMultiFontEngine(). Task-number: QTBUG-37836 Change-Id: I6d432e09e755f5d9ded09752c4c092f4857ad224 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Guarantee QPFDB::fontEngine() always return non-multi font engineKonstantin Ritt2014-03-111-12/+18
| | | | | | | | | | After QPA refactoring, QWindowsFontDatabase::fontEngine() was returning a multi font engine w/o any particular reason. This makes the code more obvious and opens the road to further improvements. Change-Id: I4858026ddf774d3159c89357b1c905f5112b1c51 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Use QStringIterator instead of homebrewKonstantin Ritt2014-03-101-21/+13
| | | | | | | Task-number: QTBUG-15664 Change-Id: I1ed3eb04ddd822e57a4d993af656dfe283f3af1a Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Make QFontEngine::type() non-virtualKonstantin Ritt2014-03-051-6/+2
| | | | | Change-Id: I24ece90d6d8f96dad0c41a474a491b4ea96d97c3 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Get rid of QFontEngine::name()Konstantin Ritt2014-03-051-6/+0
| | | | | | | | It was only used in QFontCache debug output, and some engines weren't even report a name. Change-Id: I6cec4b75f105f5a4e1405f50188bebb3a3f04e33 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Introduce a generic QFontEngine::canRender() implementationKonstantin Ritt2014-03-031-29/+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/+24
| | | | | | | | | ...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>
* Unify glyph format between QFontEngine and QFontEngineGlyphCacheTor Arne Vestbø2014-02-191-2/+2
| | | | | | | | | | | | 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>
* Fix character mirroring issue with HarfBuzz-NGKonstantin Ritt2014-02-041-36/+3
| | | | | | | | | | 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-7/+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>
* Port Windows QPA plugin to new logger API.Friedemann Kleint2014-01-221-15/+6
| | | | | | | | | | | | | | | | Introduce logging categories and change most debug statements to qCDebug(). Retrieve the filter rules from the environment variable QT_QPA_VERBOSE (should be removed once the logging framework offers a more convenient way of configuring). Replace the old per-category variables controlling verboseness of the output by a single variable which can be set on the command line. Change-Id: Iae55ecdb0e150efd165b7d3e90b371f72853f194 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Fix OpenType fonts with cmap tables on WindowsJosh Faust2013-11-221-3/+10
| | | | | | | | Task-number: QTBUG-31656 Change-Id: I5405d80f3ac1de488c44c9f1ac9ed9942ceab6b8 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Make QFontEngine not derive from QObjectKonstantin Ritt2013-09-101-3/+8
| | | | | | | | | | | | | Whilst having the objectName set for each engine is somewhat handy when debugging, deriving from QObject just for that is a wasting of memory in all other cases. This also broke the font engine abstraction by allowing qobject_cast() to access some private data; the only sane way to distinguish engines is querying their Type value. Change-Id: Ib1d195692859eb39089f6d8d9016cb8f9dcc0400 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix warning about unused variable.Friedemann Kleint2013-09-051-1/+1
| | | | | Change-Id: I557785911073a35100902aa631fcef81133615cc Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Remove undesired pixel padding of glyphs on windows.Gunnar Sletta2013-09-051-4/+4
| | | | | | | | | | | The excessive padding has serious performance implications throughout Qt and need to go. The original reason for having them was to fix issues with GL text rendering and issues with unspecified OpenType fonts. There have been several other changes to the glyph cache since then and neither of the issues can be reproduced today. Change-Id: I6de67598a079c296daf48be07cc5c2d67768c384 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Rely solely on alphaMapBoundingBox in QTextureGlyphCacheGunnar Sletta2013-09-051-0/+13
| | | | | | | | | | | | | | | We're currently adding a lot of transparent pixels to the cache, wasting both memory and cpu cycles while drawing. AlphaMapBoundingBox was introduced to return the exact same bounds as the alphaMapForGlyph function so we should only rely on this instead of adding arbitrary padding and margins all over the place. Windows still has an arbitrary +4 in the its drawGDIGlyph() which means batching will not work on windows, but at least now other platforms do not need to suffer. Change-Id: I714903fa195004400c09c3bf6570e46179775f09 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Better errorhandling for the fontengine on WINCE.Bjoern Breitmeyer2013-07-181-5/+4
| | | | | | | | | | | | | | | The CE fontengine only supports translations, scaled Text would only work if its an isometric scale and would require to create a new font from the old one. Rotations and more aren't supported at all. The freetype fontengine for CE supports this, so we give a warning that the font might be rendered incorrect, but could render correct with the freetype engine. Task-number: QTBUG-32189 Change-Id: I3581c3fef8e4ee118c0038a6ccc237e66b583731 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* QWindowsFontEngine: Fix warnings about GetGlyphOutline() failures.Friedemann Kleint2013-05-131-7/+11
| | | | | | | | | | | | | tst_qglthreads::painterOnPixmapInThread reports QWinFontEngine: unable to query transformed glyph metrics... (Desktop OpenGL only). Task-number: QTBUG-28264 Change-Id: Ib456905a13a95037ec13dfc4cb828f830076ee89 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Fix transformed raster fonts on WindowsEskil Abrahamsen Blomfeldt2013-05-131-0/+6
| | | | | | | | | | | | | | | | | | We removed all Q_WS_WIN code when going to Qt 5. One of the things removed was the condition that we do painter path text rendering for transformed, non-ttf fonts, since the GDI engine does not support transforming those. This has now been reintroduced and adapted to the QPA way of doing things, by checking for it in the font engine subclass. Then there was the problem that QStaticText only supports cases where the font engine can transform the glyphs. Thus we need to fall back to regular text drawing in drawStaticText() for unsupported cases, and we need to skip the optimized path in the raster engine (which goes to drawStaticTextItem) Task-number: QTBUG-30932 Change-Id: I17ba7355ee127811b0e77bb3a9b9db092e99893b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>