summaryrefslogtreecommitdiffstats
path: root/src/gui/text
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging into ↵Qt Continuous Integration System2011-07-212-2/+9
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | master-integration * 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging: Move separator skipping to proper place Skip shaping for hidden line/paragraph separators Support interface orientation for uikit. Add support for opening LinuxInput devices exclusively ('grabbing'). Fixed regression in compilerwarnings. Properly quit the input event thread in the directfb platform plugin. Apply 57993ba7 properly to 4.8 Deprecate some QPixmap functions (marked as obsolete already). Deprecate some functions in QImage (that have been obsolete since 4.1). Add QLocale::toUpper/Lower Fix warning for uninitialized variable
| * Move separator skipping to proper placeJiang Jiang2011-07-192-6/+7
| | | | | | | | | | | | So that it won't crash some places that requires shaping results. Reviewed-by: TrustMe
| * Skip shaping for hidden line/paragraph separatorsJiang Jiang2011-07-191-0/+6
| | | | | | | | | | | | | | | | | | | | Since we are not going to draw them in QTextLine::draw either, and shaping them here will cause performance issue on certain systems like Mac OS X 10.7 (most fonts don't have glyph for U+2028, while font fallback handling in Core Text slowed down a bit). Task-number: QTBUG-20252 Reviewed-by: Eskil
| * Apply 57993ba7 properly to 4.8Jiang Jiang2011-07-141-1/+1
| | | | | | | | | | | | | | Because we have moved alignLine from qtextlayout.cpp to QTextEngine, this patch has to be applied manually. Reviewed-by: TrustMe
| * Fix warning for uninitialized variableJiang Jiang2011-07-121-1/+1
| | | | | | | | Reviewed-by: Eskil
* | namespace fixJoerg Bornemann2011-07-141-1/+2
| | | | | | | | Reviewed-by: hjk
* | Merge remote-tracking branch 'origin/4.7' into qt-4.8-from-4.7Liang Qi2011-07-141-0/+1
|\ \ | | | | | | | | | | | | | | | Conflicts: src/s60installs/bwins/QtGuiu.def src/s60installs/eabi/QtGuiu.def
| * | Fix potential crash when clicking in a text editEskil Abrahamsen Blomfeldt2011-07-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since the attributes() call might resize the layout and therefore delete the previous data, the logClusters pointer might be dangling at this point. We need to reget it to make sure it's valid. Task-number: QTBUG-20310 Reviewed-by: Jiang Jiang
| * | Check engine existence before increasing reference countJiang Jiang2011-07-121-3/+6
| | | | | | | | | | | | | | | Reviewed-by: TrustMe (cherry picked from commit 244620438700464a862ceab7c881974a5b1d1fea)
| * | Keep reference count for cached font engines in QTextEngineJiang Jiang2011-07-111-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | So that if these font engines are deallocated elsewhere (by QFontCache for instance), we can still access them in QTextEngine. Task-number: QTBUG-17603 Reviewed-by: Eskil (cherry picked from commit 6e23fb69e441871829765ff512e90fed17b6798d)
| * | Optimize text layout.Michael Brasser2011-07-113-25/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When laying out text, a significant amount of time was being spent querying for the font engine. This patch: * changes the layout to only query for the engine when a new script item is encountered. * adds an internal cache of the previous result to QTextEngine::fontEngine(). This catches the important case of multiline text with few font engine changes. With these changes layout costs are now approximately 60% of what they were previously, as measured by the text layout benchmarks. Reviewed-by: Eskil Abrahamsen Blomfeldt (cherry picked from commit 0c56bef89b6e3fe4c9fb32eb8b51a6ea316a89fa)
| * | Fix crash when app font is addedJiang Jiang2011-07-113-19/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Loading app fonts will clear the application font cache, but QFontPrivate::engineWithScript will try to load the font again, in Mac the font engine used here must be the one used for shaping, because subsequent sub font engines may be added to it during the shaping process (QCoreTextFontEngineMulti::stringToCMap). That is why we need to fetch the font engine directly from QTextEngine's fontEngine cache instead of QFontCache. Task-number: QTBUG-20250 Reviewed-by: Eskil (cherry picked from commit 1f90ae36cff8acf581d1624bf011fe3a55c623c0)
| * | Fix horizontal center alignment with trailing spaceJiang Jiang2011-07-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Text drawn with horizontal center alignment (AlignHCenter) and QTextOption::IncludeTrailingSpaces flag as off should consider the trailing space width (leading space width for RTL lines), because textAdvance here ignores the space. Disregard that space width here in alignLine will make RTL lines aligned a bit to the right. In short, for something like this: |w1|space|text|w2| |<- totalWidth ->| we want to have w1 + spaceWidth = w2 = (totalWidth - textWidth)/2, so that the actual rendered text will appear at the center of the bounding rect. Task-number: QTBUG-18303 Reviewed-by: Eskil
* | | Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging into ↵Qt Continuous Integration System2011-07-125-23/+33
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | master-integration * 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging: Fix compiler warning in qtextdocument.cpp Fix crash when app font is added Use truncate only for subpixel boundingBox x position Use more numerically robust algorithm to compute QBezier::pointAt(). Fix editable combobox style on Mac Revert 344a4dcfe and part of 93bce787 Fix raster subpixel positioning in Lion
| * | Fix compiler warning in qtextdocument.cppEskil Abrahamsen Blomfeldt2011-07-111-1/+1
| | | | | | | | | | | | | | | | | | Missing QLatin1String() wrapper to ensure codec of text. Reviewed-by: Jiang Jiang
| * | Fix crash when app font is addedJiang Jiang2011-07-113-19/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Loading app fonts will clear the application font cache, but QFontPrivate::engineWithScript will try to load the font again, in Mac the font engine used here must be the one used for shaping, because subsequent sub font engines may be added to it during the shaping process (QCoreTextFontEngineMulti::stringToCMap). That is why we need to fetch the font engine directly from QTextEngine's fontEngine cache instead of QFontCache. Task-number: QTBUG-20250 Reviewed-by: Eskil
| * | Use truncate only for subpixel boundingBox x positionJiang Jiang2011-07-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since Lion, Core Text starts to return fractional values for x origin in the glyph bounding box. To get correct alignment we need to make it integer, it seems that round will cut certain pixels (x = 0.6 will be round to 1, then that glyph will be moved too much to the left in image glyph cache). Reverting 4297b85a appears to work fine on previous version of Mac OS X as well. This change will not affect Windows (DirectWrite) and FreeType font engines since they both return integer values for that. Reviewed-by: Eskil
| * | Revert 344a4dcfe and part of 93bce787Jiang Jiang2011-07-071-3/+4
| | | | | | | | | | | | | | | | | | Due to subpixel grid change, these changes are no longer needed. Reviewed-by: Eskil
| * | Fix raster subpixel positioning in LionJiang Jiang2011-07-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | In Lion, the x position returned by CTFontGetBoundingRectsForGlyphs can be fractional, we need to round().truncate() it as we did in QTextureGlyphCache to save the baseLineX. Reviewed-by: Eskil
| * | Merge remote branch 'mainline/4.8'Jiang Jiang2011-07-073-165/+73
| |\ \ | | | | | | | | | | | | | | | | Conflicts: dist/changes-4.8.0
* | \ \ Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-doc-staging into ↵Qt Continuous Integration System2011-07-084-4/+18
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | master-integration * 'master' of scm.dev.nokia.troll.no:qt/qt-doc-staging: Applied fix (dea9ca8b7a4166e1c3d3fc374621ad02c1220d3a)from qt5/qtbase. Committing the qt-webpages.qdoc file with the online links Preparing documentation package for 4.8-beta Doc: Clarified the range of return values from QLineF::angle(). Doc: Fixed \since declarations. (cherry picked from commit 358e018dbb4b4dbdbfc702a6d462f113a1357e1e) Doc: Standardized on QtQuick for \since declarations. (cherry picked from commit 609dc22f719ecb8d48349fd56f84960bbf46d731) Doc: Removed whitespace. (cherry picked from commit 01b3f508d1f7e9951baf60f487feadfa98ba4751) Modified \since command behavior slightly to handle project and version. Doc: Added a simple introduction to Qt and fixed links. (cherry picked from commit 9ed61311bce15b8f1bb4b30ee9133f1a2355f41d) Doc: Added more appropriate links to help reduce confusion. Doc: Removed non-ASCII characters from the documentation. (cherry picked from commit 1bd6f1bd280ee6e1ecd4de2291c8ccfb4d06b7a4) Doc: Updated documentation with \since 4.8 declarations.
| * \ \ \ Merge remote branch 'upstream/4.8'Jerome Pasion2011-07-083-165/+73
| |\ \ \ \ | | | |/ / | | |/| | | | | | | | | | | | Conflicts: doc/src/external-resources.qdoc
| * | | | Doc: Updated documentation with \since 4.8 declarations.David Boddie2011-06-304-4/+18
| | | | |
* | | | | Merge remote branch 'mainline/4.8' into stagingJiang Jiang2011-07-083-165/+73
|\ \ \ \ \ | | |/ / / | |/| / / | |_|/ / |/| | | Conflicts: dist/changes-4.8.0
| * | | Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into ↵Qt Continuous Integration System2011-07-022-162/+66
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | master-integration * 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1: changelog Compile with DEBUG_FONTENGINE define minor optimization remove the old compatibility code make QFontEngineQPF1 work even without mmap(2) support Doc: Fixing typo
| | * | | Compile with DEBUG_FONTENGINE defineHarald Fernengel2011-07-011-4/+4
| | | | | | | | | | | | | | | | | | | | Trivial fix to make the debug code compile again after latest changes
| | * | | minor optimizationRitt Konstantin2011-07-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | use the cached data from fileinfo rather than re-creating it one line later Merge-request: 1260 Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
| | * | | remove the old compatibility codeRitt Konstantin2011-07-011-95/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | obsoleted by the last commit (and moreover, disabled a while ago) Merge-request: 1260 Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
| | * | | make QFontEngineQPF1 work even without mmap(2) supportRitt Konstantin2011-07-011-62/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this also fixes a memory leaking on Integrity (an allocated data was unmap()'ed rather than free()'d) Merge-request: 1260 Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
| * | | | Merge remote-tracking branch 'origin/4.7' into qt-4.8-from-4.7Liang Qi2011-07-011-3/+7
| |\ \ \ \ | | |_|/ / | |/| | / | | | |/ | | |/| Conflicts: src/s60installs/s60installs.pro
| | * | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2011-06-291-3/+7
| | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Fix text color in some cases of QML and QStaticText
| | | * | Fix text color in some cases of QML and QStaticTextEskil Abrahamsen Blomfeldt2011-06-291-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts 518c2a58ed6fdfd7449cb4476aa8ea0d32ad16e3 which caused a regression. When writing systems are mixed and an underline is set on the font, QPainter will set a pen with the current color and a new width on itself before drawing the decoration. This would cause the recorder in QStaticText to mark the pen as dirty, saving the current pen color in all subsequent text items. The effect was e.g. that in QML the cached color would override the current one, making it impossible to change the color on the text without forcing a relayout somehow. The right fix is to only mark the pen as dirty when its color actually changes. Task-number: QTBUG-20159 Reviewed-by: Jiang Jiang
* | | | | Fix S60 compileJiang Jiang2011-07-061-1/+1
| | | | |
* | | | | Remove some metrics parsing code from Core TextJiang Jiang2011-07-062-20/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The respective value in some of the default fonts like Lucida Grande are simply not reliable. It seems that the only reliable way to get such information is by going through all the glyphs. It seems that these code are not well tested on Mac and should be removed for now since it caused visible regressions in QLineEdit rendering. Reviewed-by: Eskil
* | | | | Fix Windows compileJiang Jiang2011-07-061-1/+1
| | | | |
* | | | | Move styleName out of QtFontStyle::KeyJiang Jiang2011-07-065-46/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makes the code clearer and more explicit. Reviewed-by: Eskil
* | | | | Fix regressions in previous QFontDatabase patchJiang Jiang2011-07-051-12/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. QtFontStyle::Key comparison should either use styleName or style, etc., but not both. 2. When initializing a QFont from QFontDatabase::font(), style and weight parameters should always be set even when we found a match styleName, in case these parameters will be used for comparison later. Reviewed-by: Eskil
* | | | | Store styleName in font databaseJiang Jiang2011-07-043-12/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So that queries like QFontDatabase::styles() can return exactly the same styles as the system does. Then application can use QFont::setStyleName() to select those styles later. With a lot of fonts not providing correct numeric weight/width values and even if they did, values are usually not directly mapped to QFont enums, styleName is probably the only reliable way to select any possible font in the system. Task-number: QTBUG-13518 Change-Id: Id8a9469b804f1b5bb81d8c7378e7e8778f9a4fff Reviewed-on: http://codereview.qt.nokia.com/739 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* | | | | Fix resource leak in QFontEngineDirectWriteEskil Abrahamsen Blomfeldt2011-06-301-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug introduced by f54c5d9133d7aa7636988db36fa6cc51d26434b6. The release statement has to come before the return statement :) Reviewed-by: Jiang Jiang
* | | | | Fix transformations on DirectWrite rasterized textEskil Abrahamsen Blomfeldt2011-06-302-47/+104
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were a few bugs in the DirectWrite font engine that caused transformed text to break. First of all, alphaMapForGlyph() ignored the transform, so no gray antialiased text would be transformed. Second of all, the imageForGlyph() function would use the wrong bounding box for the rasterized glyph, causing its positioning to become a little bit off when rotating. The fix is to get the bounding box from the system and add a margin to this instead of trying to predict how it will appear after the vertical hinting etc. has been applied. So that the positioning metrics are in sync with the actual metrics used by the alphaMap* functions, we also need to implement the alphaMapBoundingBox() function. Task-number: QTBUG-19829 Reviewed-by: Jiang Jiang
* | | | Merge remote-tracking branch 'qt-mainline/4.8'aavit2011-06-274-5/+3
|\ \ \ \ | | |_|/ | |/| |
| * | | Merge branch 'qt-4.8-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration ↵Qt Continuous Integration System2011-06-243-3/+3
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into master-integration * 'qt-4.8-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration: (28 commits) Use numeric virtual keyboard for all number entry modes. QTBUG-17776, reporting terminated threads as not running on Symbian Splitview - Auto-translation rules changed Support clipboard function on Symbian Added qmlshadersplugin to Symbian qt.iby-file. Workaround webkit deadlock on macos x Disable antialiasing for tiled image drawing. Ensure visibility of input widget in QML app when doing layout switch Def update for gui, openvg, and opengl. Revert "Def update." Fix trailing whitespace Remove unnecessary resizes during orientation change Revert "Symbian: Fix QFontInfo::pixelSize()" Improving warning messages in QVolatileImage. Proper naming for raster pixmap and paintengine on Symbian. Def update. Handle QVolatileImage-backed pixmaps optimally in drawPixmap(). Resizable graphicsview's background is drawn incorrectly in splitview Add inputcontext reset to orientation switch in Symbian QS60Style: QGroupBox is drawn as white box in upcoming Symbian release ...
| | * \ \ Merge remote-tracking branch 'origin/4.7' into qt-4.8-from-4.7Liang Qi2011-06-243-3/+3
| | |\ \ \ | | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/image/qpixmap_raster_symbian.cpp src/gui/image/qpixmapdatafactory.cpp src/gui/painting/qgraphicssystem.cpp src/gui/styles/qs60style.cpp src/network/bearer/qnetworkconfigmanager_p.h src/s60installs/bwins/QtGuiu.def src/s60installs/bwins/QtOpenGLu.def src/s60installs/bwins/QtOpenVGu.def src/s60installs/eabi/QtGuiu.def src/s60installs/eabi/QtOpenVGu.def tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp
| | | * | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt into 4.7Laszlo Agocs2011-06-204-29/+134
| | | |\ \ | | | | |/
| | | | * Fix glyph metrics with QStaticText/Freetype/raster and light/no hintingEskil Abrahamsen Blomfeldt2011-05-311-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a back-port of part of cad70d64d0bbada. In the raster engine's drawCachedGlyphs(), which is used by QStaticText, we would use the wrong metrics to lay out the glyphs, because loadGlyphMetrics() would assume full hinting. A visible effect of this was that the baseline of rotated text became wavy. Task-number: QTBUG-18185 Reviewed-by: Jiang Jiang
| | | | * Fix boundry conditions for cursor hit testJiang Jiang2011-05-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clicking at the edge of a glyph means lookup for the left glyph. Reviewed-by: TrustMe (cherry picked from commit 31110bf84bb06d57983501fa65fe0db3f7c61927)
| | | | * Fix cursor position test on CursorOnCharacter caseJiang Jiang2011-05-253-4/+9
| | | | | | | | | | | | | | | | | | | | Reviewed-by: TrustMe
| | | | * Fix xToCursor issue due to backporting from 4.8Jiang Jiang2011-05-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-19260 Reviewed-by: TrustMe
| | | | * Support placing cursor in ligature with mouse or touchJiang Jiang2011-05-233-7/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to find out the closest element in the ligature to the point we clicked (or tapped), currently we do this by dividing the width of that ligature glyph evenly by the number of characters it covered. We only support Common and Greek script at this point, ligatures in other scripts are still handled as a whole. Task-number: QTBUG-19260 Reviewed-by: Eskil
| | | | * Fix ligature offset in multi-line textJiang Jiang2011-05-201-2/+2
| | | | | | | | | | | | | | | | | | | | Reviewed-by: Eskil