summaryrefslogtreecommitdiffstats
path: root/src/gui/text
Commit message (Collapse)AuthorAgeFilesLines
* QTextLayout: Fix cursor position calculation for BiDi textAndrey Volykhin2014-05-121-1/+0
| | | | | | | | | | | Due excess 'break' in loop, function xToCursor() with "CursorOnCharacter" option for BiDI text returns wrong cursor position (start glyph position) all time. Task-number: QTBUG-38846 Change-Id: Iba6671905e0785da6f343db19d6c3bb3e2cf5e8a Reviewed-by: Andrey Volykhin <andrey.volykhin@lge.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Respect fixed pitch request when font family is not availableEskil Abrahamsen Blomfeldt2014-05-121-1/+5
| | | | | | | | | | | | | | | | | | | | | In particular, if you have a <pre> tag in your HTML, this will become a QFont with family "Courier New" and fixedPitch==true. On Android, there's no "Courier New" font, and since the style hint is AnyStyle, we will just return Roboto, which is a proportional font. Note that this exactly matches the condition when fetching the fallback families for the font in the loadEngine() function, which was introduced by 06568ff89c48dee8aab278b8b0538c331aa84595 in Qt 4. [ChangeLog][Text] Respect QFont::fixedPitch() for fallbacks when font family cannot be matched. Task-number: QTBUG-36083 Change-Id: I64787c547dc492b9dd3c49f1edf0d9626d198260 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com> 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>
* Add virtual function to QFontEngine report if outlines are reliableJørgen Lind2014-05-062-0/+11
| | | | | | | | | 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 assert on justification of QTextLine with only spacesEskil Abrahamsen Blomfeldt2014-04-301-1/+1
| | | | | | | | | | | | | | | | | | In the justification code, we unconditionally subtracted one from the line_length, but then compared the result to 0 afterwards, so we did not support when the line_length is 0 initially, which can happen if it only consists of spaces (in which case trailingSpaces will be non-zero and line_length will be zero.) The fix is to bail out for both strings of length 1 and length 0. [ChangeLog][Text] Fixed an assert when justifying a QTextLine which only contains spaces. Task-number: QTBUG-38520 Change-Id: Ib04993f47eb2f9f7fc49c4a5400f18f9682a72f2 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix incorrect repaints with plain text editSimon Hausmann2014-04-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The plain text edit's smart repaint logic in QPlainTextDocumentLayout::documentChanged assumes that during a change inside just one block, the block is in the state before the edit and a call to layoutBlock() is going to bring it up-to-date. Then only a comparison of the bounding rect - before and after - is going to allow for smart repaints. The assumption of the layout being in the same state as before the edit got broken by commit cc57a2e90f18a39ce3c74b6ad0db9a64aa135ddf, which introduced code to use a QTextCursor within a slot connected to QTextDocument's contentsChange signal. The usage of the QTextCursor there ends up updating the layout of the block ahead of time, breaking the assumption and therefore the optimization, in the sense that during changes in the preedit that cause a change of height / line count, the old bounding rect in QPlainTextDocumentLayout::documentChanged and the new bounding rect will be the same. This causes a repaint of only the edited block, missing repaints of the following blocks, even though the line count effectively changed. So what's causing QTextCursor to mess with the layout is the attempt of updating the vertical movement x property. This patch inhibits the update, marking it as dirty for initialization later. This means that slots connected to this low-level signal cannot rely on the cursor's visual x position, but that doesn't seem useful anyway and isn't required for commit cc57a2e90f18a39ce3c74b6ad0db9a64aa135ddf. Task-number: QTBUG-38536 Change-Id: I5fae12d646a4b2d2cc22b9f2d021e5dc8cfdda94 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Improve the Unicode script itemization implementationKonstantin Ritt2014-04-141-16/+1
| | | | | | | | | | | | | | | | | | Make it closer to the Unicode specs (UAX#24): * Common now inherits the preceding character's script, if any; * In a combining character sequence, if the base character is of Common script, the entire sequence is treated like if it were of the first non-Inherited, non-Common script in the sequence. See http://www.unicode.org/reports/tr24/tr24-21.html for more details. [ChangeLog][QtGui] Fixed regression in arabic text rendering. Task-number: QTBUG-28813 Task-number: QTBUG-29930 (related) Task-number: QTBUG-35836 Change-Id: Id85761965b08ca94c674d5f3613fe58b82b2ce9c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> Reviewed-by: Ahmed Saidi <justroftest@gmail.com>
* Make HarfBuzz-NG the default shaper on MacKonstantin Ritt2014-04-141-0/+2
| | | | | | | | | | | | | | | | | For AAT shaping support, we need either the pre-QPA shaping trick or the new HarfBuzz on Mac; prefer the latter. Disable some test cases aimed to test the HB-old behavior; enable ones that should guarantee shaping-unaware behavior. [ChangeLog][OS X] Use CoreText text shaping engine for support of complex scripts. If required, the shaping engine used in previous versions can be preferred by configuring Qt with -no-harfbuzz. Alternatively, the QT_HARFBUZZ environment variable could be set to "old". Task-number: QTBUG-18980 (relates) Task-number: QTBUG-38246 Change-Id: Iee6fe4f5bc047e77259182b8585385c5febd02b3 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* QTextImageHandler: Load @2x images on retinaMorten Johan Sørvig2014-04-091-7/+35
| | | | | | | | | | | | | | | | Look for and load "@2x" image versions. Adjust getPixmap/ImageSize to take the image devicePxielRatio into account. Use doc->documentLayout()->paintDevice() to get the target window devicePixelRatio (like the existing DPI-based scaling). In practice this pointer may/ will be null, fall back to qApp->devicePixelRatio as usual. Task-number: QTBUG-36383 Change-Id: Ib5e113b67242b5a9b3410272f2183a76a60bc773 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* QTextLayout: Fix cursor movement from invalid positionKonstantin Ritt2014-04-042-7/+13
| | | | | | | | Actually guarantee cursor doesn't move in this case for both logical and visual modes (just what the documentation says we already do ;) Change-Id: Iabdca7aa1d205672386a0095e3487e585611cdb5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Optimize QTextEngine::insertionPointsForLine() a bitKonstantin Ritt2014-04-041-0/+3
| | | | | | | Reserve the insertionPoints vector capacity prior to multiple append()-s. Change-Id: I97ab5b2a1add9f2e87c04ad0707bf516c13ff4d7 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QTextLayout: Fix visual cursor movement in some casesKonstantin Ritt2014-04-041-12/+8
| | | | | | | | | | | | | | | | To guarantee proper positioning at the end of the last line in a bidirectional text we have to insert the eol position into the insertion points vector, accordingly to the visual ordering. Detection of the last *logical* item in a *visual* line is unrelaed to the text direction, it is simply `iterator.item == iterator.lastItem`. [ChangeLog][QtGui][QTextLayout] Fixed visual cursor movement in bidirectional text. Task-number: QTBUG-18060 (partially related) Change-Id: I53b6ab889ef580ab0560b620b808b1e09efc0fbd Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Ahmed Saidi <justroftest@gmail.com>
* QTextEngine: Fix visual position movement for tab and object casesKonstantin Ritt2014-04-041-8/+7
| | | | | | | | | QTextLineItemIterator::next() was never updating itemStart and itemEnd for QScriptAnalysis::TabOrObject, thus producing incorrect insertion points for the line that contains tabs and/or objects. Change-Id: Ia964c663cc0636ba6be4500702656f989b252fba Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [HB] Ensure we always working with non-multi font engineKonstantin Ritt2014-04-042-4/+9
| | | | | Change-Id: If88385d4cecdc527b7952d34e48f7ba889173c6c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix QFontCache::Key comparison for custom font fallbacks caseKonstantin Ritt2014-03-311-1/+1
| | | | | | | Just a C&P typo, of course we have to compare lists, not their sizes. Change-Id: I40542035b87f5bb8d75207cb02c0826cc3a2a413 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Drop dead codeKonstantin Ritt2014-03-311-4/+1
| | | | | | | The QFontEngineMulti's `base` font engine always non-null. Change-Id: I5092b66bc839a6a3216ffa0b0afe55a8b62be620 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Deprecate QFont::setRawName() and QFont::rawName()Sergio Ahumada2014-03-272-2/+6
| | | | | | | | | | | | | | We don't support xlfd fonts anymore and indeed QFont::setRawName() is an empty method. [Changelog][QtGui] QFont::setRawName() and QFont::rawName() are deprecated. Change-Id: Ic52d42a9bc200ba8b246dd4e28c77f84e086dad5 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Fix typos in QFont documentation.Mitch Curtis2014-03-271-2/+2
| | | | | | Change-Id: I0e8de5b47ec7b64719f875eecc46cc8ef009642b Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Android: Fix font mergingEskil Abrahamsen Blomfeldt2014-03-251-1/+1
| | | | | | | | | | | | | Our fallback fonts would contain a minimal list of hardcoded fallback fonts, which is neither sufficient for displaying all text, nor portable to different vendors which can supply different font sets. [ChangeLog][Android] Fixed font merging problem which caused e.g. missing glyphs for Arabic numerals. Task-number: QTBUG-37738 Change-Id: Ic971343a1cd5610c79a81f6f6152c637937b5626 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Fix grammar in QFontInfo::styleName() doc.Mitch Curtis2014-03-251-1/+1
| | | | | Change-Id: I673ecc8931f4824dc4fb923056354cfd2e119e40 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* [HarfBuzz-NG] Optimize Unicode de-/composition callbacksKonstantin Ritt2014-03-251-33/+26
| | | | | | | Use QStringIterator instead of QString::toUcs4() and escape earlier. Change-Id: If80b886bece1a43af7078e8cdc9c31babf602731 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Teach font database to populate families lazilyTor Arne Vestbø2014-03-203-26/+99
| | | | | | | | | | | | | | | | | | | | | | Instead of requiring that QPlatformFontDatabase::populateFontDatabase() populates every single font in the system by calling registerFont(), we now allow the platform database to call registerFontFamily() instead, and then keep track of which families we've yet to fully populate in the font database. Once a property of a family is requested (such as its writing system, style, etc), the family is lazily populated by calling back to the platform database through QPlatformFontDatabase::populateFamily(), which in turn does the final call to registerFont() as before. This cuts application startup on OS X and iOS (of which the font population used to be a major limiting factor) from roughly one second to about 350ms. Task-number: QTBUG-37165 Change-Id: Ic2fc3447beb818ffe23635a5b7816ed7e70c93a7 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Make QTextEngine::setAdditionalFormats() invalidate cached resultsKonstantin Ritt2014-03-171-1/+3
| | | | | | | | | ...which ensures we're not getting the formatting/rendering artefacts in case of QStackTextEngine. Change-Id: Ia0696a3e67eb866cf9776c6649c43775944edd1d Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2014-03-171-1/+1
|\ | | | | | | | | | | | | | | | | Conflicts: src/gui/painting/qdrawhelper.cpp src/gui/painting/qdrawhelper_avx.cpp src/gui/painting/qdrawhelper_x86_p.h Change-Id: I09352d05119f6fd000319074a2705b38361b2c90
| * CSS parser: fix the pseudo-classes array lengthGiuseppe D'Angelo2014-02-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pseudoclass array is declared with length "NumPseudos - 1", but the declaration has actually 44 elements, not 45. This caused a zero-initialized last element to be silently appended to the array. The zero-initialized element broke the sorting of the array, which in turn broke std::lower_bound usage (although of course the problem was there from before switching to the standard library algorithms). Task-number: QTBUG-36933 Change-Id: I8a02891fc36761b6ae72d15a0a8d6c6a96813947 Reviewed-by: Olivier Goffart <ogoffart@woboq.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>
* | Prevent DrawTextItemDevice::metric warning on MacMorten Johan Sørvig2014-03-151-0/+3
| | | | | | | | | | | | | | | | Implement PdmDevicePixelRatio. Task-number: QTBUG-36419 Change-Id: I4d2822d01e08c80e9b829d5f524e8e761e694fba Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* | Build bundled HarfBuzz-NG outside QtGuiKonstantin Ritt2014-03-141-1/+1
| | | | | | | | | | | | | | | | | | Being a part of QtGui, HarfBuzz-NG breaks build with -Werror. Instead of disabling a particular warnings-as-errors, build a prefixed static library and make it a link-time dependency. Change-Id: Id0be1f0e0034092d50f83cd364d5c65940fee869 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Ensure that QGuiApplication is inited before using QFontDatabaseTor Arne Vestbø2014-03-131-0/+3
| | | | | | | | | | | | Change-Id: I494c4fdfa49139316efac0f68f8d463c02056372 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Fix custom font substitution list supportKonstantin Ritt2014-03-112-8/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During the QPA refactoring, the custom font substitution list support was lost by ignoring the font request's fallbackFamilies member when the multi font engine gets created/initialized. If fallbackFamilies is not empty, it should be prepended to the font database default fallback families list. Also respect the custom fallback families list in the cache key to avoid picking a multi font engine with wrong fallbacks list. Task-number: QTBUG-36628 Change-Id: Ie2b84b3a397bee4816f421cddf76a5375829f13a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Guarantee QPFDB::fontEngine() always return non-multi font engineKonstantin Ritt2014-03-111-5/+4
| | | | | | | | | | | | | | | | | | | | 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>
* | Fix CJK languages support with HarfBuzz-NGKonstantin Ritt2014-03-101-14/+17
| | | | | | | | | | | | | | | | | | By some reason, mapping to Han script doesn't work for some (most?) fonts. Until the issue is really fixed, pretend the HB-old behavior and simply map to Common script. Change-Id: I4c146f5ff2a42f64b971b2f5ebd7f65e2513fdf0 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Use QStringIterator instead of homebrewKonstantin Ritt2014-03-104-44/+24
| | | | | | | | | | | | | | Task-number: QTBUG-15664 Change-Id: I1ed3eb04ddd822e57a4d993af656dfe283f3af1a Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | QFontEngineQPA: Get rid of unused externalCMapKonstantin Ritt2014-03-082-17/+6
| | | | | | | | | | | | | | It seems to be a leftover after dropping the QPF1 font engine. Change-Id: If8d3e1447fab9d042a85195d7bdb4d9811c37c6e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Make QFontEngineQPA report the TT 'cmap' table supportKonstantin Ritt2014-03-081-4/+8
| | | | | | | | | | | | | | The QPF2 CMap is identical to the TrueType CMap table format. Change-Id: I8c34d7c6a5942375538f3b8cb71d5a808b4fb400 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Improve code readabilityKonstantin Ritt2014-03-081-4/+3
| | | | | | | | | | | | | | | | Since we were requesting a multi font engine, the returned font engine must be a multi one or nothing at all. Change-Id: I1ee4e1b7c68f54c83a8c7292082d015ebfa0a8cb Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* | Prevent repeated and unnecessary font population QCoreTextFontDatabaseTor Arne Vestbø2014-03-053-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The platform font database is populated from QFontDatabase, through the static initializeDb() function, whenever the font database determines that the platform database has not been initialized (by checking if the font database is empty). There are other clients of QPlatformFontDatabase though, such as QFont, which uses the platform font database to check for the default family. The CoreText implementation of determining the default family relies on data that is computed during font population, and hence does an internal (self-triggered) populate. To prevent repeated populates as a result of calling QFont::defaultFamily() we guard the populate by a similar isEmpty() check as QFontDatabase does, but to ensure that this check works in the case of an invalidated font database, we need to propagate the font database invalidation down to the platform font database. Change-Id: I8d06c6f6fc5da6353c087335859eaca008c2f6a6 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* | Make QFontEngine::type() non-virtualKonstantin Ritt2014-03-056-37/+27
| | | | | | | | | | Change-Id: I24ece90d6d8f96dad0c41a474a491b4ea96d97c3 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Get rid of QFontEngine::name()Konstantin Ritt2014-03-055-20/+4
| | | | | | | | | | | | | | | | 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>
* | Optimize QFontEngineMulti::stringToCMap() in case of missing glyphsKonstantin Ritt2014-03-051-15/+7
| | | | | | | | | | | | | | | | | | Use recently introduced glyphIndex() method and only recalc advances if the glyph is present in the font. This allows to avoid restoring the old advance when the glyph was not found in the fallback fonts. Change-Id: I3e0aa549961767e5448816327328101cf6a78873 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Optimize glyph lookups with QFontEngine::glyphIndex(uint)Konstantin Ritt2014-03-058-264/+62
| | | | | | | | | | | | Change-Id: I56c7e727f3d9b08195f38939106620c744c6eaf0 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: BogDan Vatra <bogdan@kde.org>
* | Merge qfontdatabase_qpa.cpp with qfontdatabase.cppTor Arne Vestbø2014-03-042-475/+416
| | | | | | | | | | | | | | | | | | There's no point in separating them anymore, and it just makes editing and reasoning about the QFontDatabase code harder. Change-Id: I6bc8cb5e5daac26293e75553639e4a4d34eba3bd Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* | Disable 'gsub' table check for AAT fonts on MacKonstantin Ritt2014-03-041-0/+9
| | | | | | | | | | | | | | In AAT fonts, 'gsub' table is effectively replaced by 'mort'/'morx' table. Change-Id: Ifa044c8e28c3f2aab0f57ba5e3e6b99ada84d37c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Introduce a generic QFontEngine::canRender() implementationKonstantin Ritt2014-03-036-56/+17
| | | | | | | | | | | | | | | | ...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-036-0/+83
| | | | | | | | | | | | | | | | | | ...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-033-0/+3
| | | | | | | | | | | | | | | | 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>
* | Fix QFontEngineQPA::recalcAdvances() in case of missing glyphKonstantin Ritt2014-03-031-3/+1
| | | | | | | | | | | | | | | | Modifying the glyph indexes array in recalcAdvances() could lead to undefined behavior. Change-Id: Ibbb6642f381a5fe01b285dc8d2001c167dc66f46 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Make QGlyphLayout consume one byte less per glyphKonstantin Ritt2014-03-032-18/+23
| | | | | | | | | | Change-Id: Iddcc2e1f284dcf13ae98b57ea2d5854e57c83530 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Hide the justification algorithm implementation detailsKonstantin Ritt2014-03-032-43/+45
| | | | | | | | | | | | | | | | | | | | The justification "classes" stored in the glyph attributes are actually a justification priorities suitable for a particular language (script). The external API only uses the justification metrics array calculated on top of these priorities. Change-Id: I5b0a39e35954084c63a798b632fd6108f9ae7608 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Fix retreiving the 'head' table in QPAGeneratorKonstantin Ritt2014-03-021-5/+3
| | | | | | | | | | | | | | | | | | The 'head' table is usually of 54 bytes length. Passing the buffer of 4 bytes capacity for the 'head' table is expected to return false, thus skipping the FontRevision tag in QPAGenerator::writeHeader(). Change-Id: I02c0b13f3cbf13579a845fe78fcbc8a437ae22bf Reviewed-by: Lars Knoll <lars.knoll@digia.com>