summaryrefslogtreecommitdiffstats
path: root/src/gui/text
Commit message (Collapse)AuthorAgeFilesLines
* Make sure we don't use subpixel positions in full hinting modeJiang Jiang2011-04-011-0/+2
| | | | | | | | | Some of the text can start from subpixel positions (start from 100.5 for instance), we need to make sure they stick to pixel grid in this case. Reviewed-by: Eskil (cherry picked from commit bf03b38d2b32a0cfca181398597884e4252466f4)
* Compile with QStringBuilder and QByteArrayOlivier Goffart2011-04-011-1/+1
| | | | Reviewed-by: Denis
* Chnaged Q_AUTOTEST_EXPORT marco into Q_GUI_EXPORT for QZipWriter classPavel Mogilevskiy2011-04-011-1/+1
| | | | | | | | | Merge-request: 1162 Reviewed-by: João Abecasis <joao.abecasis@nokia.com> [ Symbols for QZipReader were previously exported with 959ab5d84d67ec84c2342b083e362ca75613e8cb. There's no good reason not to do the same for QZipWriter. Classes remain private API. -- João ]
* Fix horizontal centered text drawing without word wrapJiang Jiang2011-04-013-18/+18
| | | | | | | | | In this case we can't use line width to align the text, we have to use the rectangle width given in QPainter::drawText for alignment instead. Reviewed-by: Eskil (cherry picked from commit b92a31da01ee50fed4b10282e79f812167faf659)
* Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging into ↵Qt Continuous Integration System2011-03-285-96/+158
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | master-integration * 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging: Fix crash and infinite recursion caused by previous commits Fix remaining regressions in QWS Take Xft.hintstyle by default to match the behavior of GTK+ Fixed remaining issues in subpixel positioning with FreeType Fix QTransform debug output qFloor the decoration line width before painting Let QTextLine decide its own x position in QPainter Avoid repeatedly trying to load unloadable plugins, causing slowness Reset GL glyph cache when texture limit is reached unlockFace was put in the wrong place in previous patch Implement subpixel positioning with FreeType
| * Fix crash and infinite recursion caused by previous commitsJiang Jiang2011-03-282-2/+3
| | | | | | | | Reviewed-by: TrustMe
| * Fix remaining regressions in QWSJiang Jiang2011-03-252-0/+2
| | | | | | | | Reviewed-by: TrustMe
| * Take Xft.hintstyle by default to match the behavior of GTK+Jiang Jiang2011-03-251-1/+6
| | | | | | | | | | | | | | | | For Qt apps running in GNOME, we use the GTK+ settings by default (instead of fontconfig settings). Task-number: QTBUG-13800 Reviewed-by: Samuel
| * Fixed remaining issues in subpixel positioning with FreeTypeJiang Jiang2011-03-242-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Merge QStaticText and QGlyphs drawing code of raster engine into glyph drawing code for normal QTextItem, it simplify the caching system (we don't use QImageTextureGlyphCache for raster anymore, just glyph set cache in FreeType engine is enough), and fix some regressions in QStaticText and QGlyphs drawing. 2. Fix subpixel positioning support for OpenGL texture glyph cache. Including a transform handling regression introduced by the initial patch. 3. Disable subpixel positioning for bitmap fonts (mono format). After this change, we only have two code paths for glyph rendering with FreeType: raster will always use the simple code path (with QFontEngine_FT cache) while GL will always use QTextureGlyphCache. Reviewed-by: Eskil
| * unlockFace was put in the wrong place in previous patchJiang Jiang2011-03-221-2/+2
| | | | | | | | | | | | Should only unlock once after the loop. Reviewed-by: TrustMe
| * Implement subpixel positioning with FreeTypeJiang Jiang2011-03-224-95/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QFontEngineFT are used in raster/OpenGL paint engine and QGLWidget, also in Symbian, etc. We want to make sure it works well in raster and QGLWidget first. Regardless subpixel antialiasing (LCD filtering) is enabled or not (though it does look better when subpixel antialiasing is on). We also need to support transformations. The tricky part here is that, under X11, we have a different code path for QFontEngineFT and other font engines in raster engine, which uses QFontEngineFT's own glyph cache system. While in other platforms (Windows and Mac) and QGLWidget, we will use the generic QTextureGlyphCache. The generic QTextureGlyphCache already has support for subpixel positions, this solution is ported to QFontEngineFT for its QGlyphSet: the key for QGlyphSet hash table has been extended from glyph_t to <glyph_t, QFixed subPixelPosition> pair. The real work to enable subpixel positioning with FreeType is in fact really simple, we just set the horizontal translation to the subpixel position * 64 (FreeType uses a coordinate system of 1/64 of a pixel resolution internally) immediately before loading the glyph. A slight tweek to bitmap width is applied when we are getting the bitmap ourselves instead of using FT_Render_Glyph to accommodate the subpixel translation, which will only be used in non-LCD filtering cases (grayscale antialiasing). From what we have observed, FreeType can generate different bitmaps for at least 12 different subpixel positions (each with a slight difference). To limit the memory consumption, we restrict the number of subpixel positions to be 4 (hardcoded), which should be good enough for most low resolution displays. Subpixel positioning (and fractional glyph advances) will only be enabled when the hintingPreference for the font being used is PreferNoHinting or PreferVerticalHinting. We will use fontconfig hintstyle setting by default when no hintingPreference is set for the font. Task-number: QTBUG-12279 Reviewed-by: Eskil
* | Merge remote-tracking branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2011-03-221-1/+1
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/declarative/positioners/layoutdirection/layoutdirection.qml src/corelib/global/qglobal.h src/plugins/qpluginbase.pri src/qbase.pri src/s60installs/bwins/QtOpenGLu.def src/s60installs/eabi/QtOpenGLu.def tests/auto/selftests/expected_cmptest.txt tests/auto/selftests/expected_crashes_3.txt tests/auto/selftests/expected_longstring.txt tests/auto/selftests/expected_maxwarnings.txt tests/auto/selftests/expected_skip.txt tools/assistant/tools/assistant/doc/assistant.qdocconf tools/qdoc3/test/assistant.qdocconf tools/qdoc3/test/designer.qdocconf tools/qdoc3/test/linguist.qdocconf tools/qdoc3/test/qdeclarative.qdocconf tools/qdoc3/test/qmake.qdocconf tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf
| * Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2011-03-211-1/+1
| |\ | | | | | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Don't crash calling QTextDocument::blockBoundingRect on invalid block
| | * Don't crash calling QTextDocument::blockBoundingRect on invalid blockEskil Abrahamsen Blomfeldt2011-03-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | If the block is invalid, QTextBlock::layout() will return 0 and we would dereference a null pointer. Task-number: QTBUG-18192 Reviewed-by: Jiang Jiang
* | | Merge remote branch 'qt/master' into staging-masterSamuel Rødal2011-03-212-23/+26
|\ \ \ | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/image/qpnghandler.cpp src/opengl/qwindowsurface_gl.cpp
| * \ \ Merge remote-tracking branch 'origin/master' into lighthouse-masterJørgen Lind2011-03-1715-41/+54
| |\ \ \ | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/qws/macx-nacl-g++/qplatformdefs.h
| | * \ \ Merge remote-tracking branch 'origin/4.7' into HEADThiago Macieira2011-03-161-22/+25
| | |\ \ \ | | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure mkspecs/symbian-gcce/qmake.conf qmake/generators/metamakefile.cpp qmake/generators/win32/mingw_make.cpp src/corelib/global/global.pri src/corelib/global/qglobal.h src/opengl/qgl.cpp src/opengl/qwindowsurface_gl.cpp src/plugins/platforms/wayland/qwaylandbuffer.h tests/auto/qnetworkreply/tst_qnetworkreply.cpp tools/designer/src/components/formeditor/qdesigner_resource.cpp
| | | * | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2011-03-151-22/+25
| | | |\ \ | | | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Designer: Fix a bug affecting tab reordering of promoted tab widgets. Designer: Fix a bug clearing the Z-Order when adding a new widget. Adjust right bearing when breaking with line separators
| | | | * Adjust right bearing when breaking with line separatorsJiang Jiang2011-03-151-22/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we found a forced line break with line separator (e.g. '\n'), take the right bearing of previous glyph into account, otherwise the resulting text width will be slightly smaller than the one without a line separator. Task-number: QTBUG-17020 Reviewed-by: Eskil
| * | | | don't print debug outputcon2011-03-041-1/+1
| | | | |
* | | | | Only enable RightToLeft forcing in OS X 10.6 and skip the testJiang Jiang2011-03-161-0/+2
| | | | | | | | | | | | | | | | | | | | Reviewed-by: Eskil
* | | | | Fix some warnings in font codeEskil Abrahamsen Blomfeldt2011-03-152-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Comma at the end of enumerator list and wrong initializer list on Mac. Reviewed-by: Jiang Jiang
* | | | | Fix grayscale antialiasing with DirectWrite engineEskil Abrahamsen Blomfeldt2011-03-151-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code that converted DirectWrite's output to grayscale in alphaMapForGlyph() had a bunch of copy-paste errors and had obviously not been tested properly. We invert the input to the gamma function to get the right curve and then invert the output back. See windows font engine for comparison. Reviewed-by: Jiang Jiang
* | | | | Merge remote branch 'qt-mainline/master'aavit2011-03-1514-15/+22
|\ \ \ \ \ | | |/ / / | |/| | |
| * | | | Merge branch 'qt-master-from-4.7' of ↵Qt Continuous Integration System2011-03-141-2/+9
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | scm.dev.nokia.troll.no:qt/qt-integration into master-integration * 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration: QS60Style: QTreeView::indexRowSizeHint returns incorrect value Fix TextEdit mouseSelectionMode overriding selectByMouse.
| | * \ \ \ Merge branch 4.7 into qt-master-from-4.7Qt Continuous Integration System2011-03-141-2/+9
| | |\ \ \ \ | | | | |/ / | | | |/| |
| | | * | | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integrationQt Continuous Integration System2011-03-141-2/+9
| | | |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: Fix TextEdit mouseSelectionMode overriding selectByMouse.
| | | | * | | Fix TextEdit mouseSelectionMode overriding selectByMouse.Andrew den Exter2011-03-141-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If selectByMouse is false don't allow any text selection on mouse move. Change-Id: Ic9f309899bc0de48066a2393e088e15b3a2f06db Task-number: QTBUG-18072 Reviewed-by: Martin Jones
| * | | | | | Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging into ↵Qt Continuous Integration System2011-03-141-1/+2
| |\ \ \ \ \ \ | | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | master-integration * 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging: Fix static text item positioning GL2 paint engine Fix combining marks handling in Core Text shaper Fix PBuffer example to work again
| * | | | | | Merge remote-tracking branch 'origin/master' into qt-master-from-4.7Thiago Macieira2011-03-1112-12/+12
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/s60installs/eabi/QtOpenVGu.def
| | * | | | | | Update copyright year to 2011.Rohan McGovern2011-03-1012-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed-by: Trust Me (cherry picked from commit 774a3536b00c4d6e4c4c10b708e31b4373a338e3)
| * | | | | | | Merge remote-tracking branch 'origin/4.7' into qt-master-from-4.7Thiago Macieira2011-03-111-1/+1
| |\ \ \ \ \ \ \ | | |/ / / / / / | |/| | / / / / | | | |/ / / / | | |/| | | | | | | | | | | | | | | | | | Conflicts: mkspecs/common/symbian/symbian.conf src/s60installs/bwins/QtGuiu.def src/s60installs/eabi/QtGuiu.def
| | * | | | | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2011-03-101-1/+1
| | |\ \ \ \ \ | | | | |_|_|/ | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Fix QGraphicsScene returning incorrect focus item. Not requiring valid QTextBlock in previous()
| | | * | | | Not requiring valid QTextBlock in previous()Jiang Jiang2011-03-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 64852122ba7 introduced a regression in QTextBlock::previous(), programs that do doc.end().previous() will not be able to retrieve the last valid block. Revert this change so that we can keep the behavior consistent with previous versions. Task-number: QTBUG-18026 Reviewed-by: Eskil
* | | | | | | Fix checking hintingPreference in Windows font databaseEskil Abrahamsen Blomfeldt2011-03-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was a left-over of when the API was flags-based. Reviewed-by: Jiang Jiang
* | | | | | | Add RightToLeft direction forcing to Core Text shaperJiang Jiang2011-03-141-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So that setting Qt::TextForceRightToLeft flag on QTextLayout can work. Reviewed-by: Eskil
* | | | | | | Introduce QFontEngineDirectWriteEskil Abrahamsen Blomfeldt2011-03-1413-56/+1163
| |_|_|/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make a font engine for subpixel positioned text on Windows Vista (with platform update) and Windows 7. If selected during configuration, the engine will be selected only when the hinting preference of a font is set to None or Vertical hinting. The font database uses most of the same logic but creates a direct write font based on the LOGFONT rather than a GDI handle. The engine is currently regarded as experimental, meaning that code using it should do substantial testing to make sure it covers their use cases. Task-number: QTBUG-12678 Reviewed-by: Jiang Jiang
* | | | | | Fix combining marks handling in Core Text shaperJiang Jiang2011-03-111-1/+2
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For fonts without combined glyph for combinations like U+0062 U+0300, Core Text will return glyph sequences like <b> <`>, the latter will have advance_x = 0, advance_y = <positive value> to keep it above the previous glyph. To get correct positioning in flipped coordinate, we need to store the negative y advance in Qt. Task-number: QTBUG-15675 Reviewed-by: Eskil
* | | | | Merge branch 4.7 into qt-master-from-4.7Qt Continuous Integration System2011-03-091-1/+1
|\ \ \ \ \ | |/ / / /
| * | | | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integrationQt Continuous Integration System2011-03-091-1/+1
| |\ \ \ \ | | | |/ / | | |/| | | | | | | | | | | | | | | | | | | | | | * '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: Fix unstable qdeclarativeflickable test. Update TextEdit's visible selection when only the anchor changes. Set correct initial value for TextEdit and TextInput canPaste property
| | * | | Update TextEdit's visible selection when only the anchor changes.Andrew den Exter2011-03-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the limits of a TextEdit's text a key press can change/reset the anchor position without changing the cursor position. Checking the cursor position alone isn't enough to determine the selection hasn't changed. Change-Id: Ic425ac0c06897d77e9c86b907ff10b39d78dd7a1 Task-number: QTBUG-17982 Reviewed-by: Martin Jones
* | | | | Merge branch 4.7 into qt-master-from-4.7Qt Continuous Integration System2011-03-041-2/+4
|\ \ \ \ \ | |/ / / / | | | | / | |_|_|/ |/| | |
| * | | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integrationQt Continuous Integration System2011-03-041-2/+4
| |\ \ \ | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | * '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: Fix TextInput auto test failure on mac. Fix word selection locking on string boundaries. Fix potential crash in QTextControl. QDeclarativePropertyMap::keys() cannot be called from qml Compensate for horizontal scroll in TextInput micro focus.
| | * | Fix potential crash in QTextControl.Lasse Holmstedt2011-03-041-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | inputContext() is only safe to call if there is a current contextWidget. Change-Id: I6cbccf5f5fbb2d8c9ca6acf5f7e02f680eb84483 Reviewed-by: Andrew den Exter
* | | | Merge branch 'qt-master-from-4.7' of ↵Qt Continuous Integration System2011-03-011-2/+3
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | scm.dev.nokia.troll.no:qt/qt-integration into master-integration * 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration: (26 commits) Fix FolderListModel test - set folder to one containing files. Fix Mac synthesized italic fonts clipping issue for QGLWidget Fix openvg compilation on win32. Drag over bounds errors when ListView has variable height content FolderListModel emitted incorrect rowsRemoved range causing crash. fix/improve docs for new QtQuick 1.1 attributes Fix test instability. Document BorderImage::asynchronous Make QtScript support COLLECT_ON_EVERY_ALLOCATION define QSortFilterProxyModel::reset() should invalidate. Add missing API shims to QScriptValue constructors Don't crash when marking arguments object of native context Update QtOpenGL def files Fix extern usage in qpixmapdata_gl.cpp Fix for loading QPixmaps from file in GL graphics system Fix code style in qgl_symbian.cpp QPixmap::to/fromSymbianCFbsBitmap() in OpenGL graphics system. Use the 'convertInPlace' versions of QImage in QGLPixmapData load. Recreate GL surface when native window is resized on Symbian spelling fixes in extending.qdoc ...
| * \ \ \ Merge remote-tracking branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2011-03-011-2/+3
| |\ \ \ \ | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/text/qfontengine_mac.mm src/opengl/qpixmapdata_gl.cpp src/opengl/qwindowsurface_gl.cpp src/s60installs/bwins/QtOpenGLu.def src/s60installs/eabi/QtOpenGLu.def tests/auto/qtextlayout/tst_qtextlayout.cpp
| | * | | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2011-02-282-7/+13
| | |\ \ \ | | | |/ / | | |/| / | | | |/ | | | | | | | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Fix Mac synthesized italic fonts clipping issue for QGLWidget Fix cursor position adjustment when removing strings Fix out of bounds handling in Mac shaper
| | | * Fix Mac synthesized italic fonts clipping issue for QGLWidgetJiang Jiang2011-02-281-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport 43d5a0757d857c2a6694ae81d6b70c04ef876aff from 4.8. Task-number: QTBUG-16954 Reviewed-by: Eskil
| | | * Merge branch 'graphics-team-text-4.7' into 4.7Eskil Abrahamsen Blomfeldt2011-02-281-2/+3
| | | |\
| | | | * Fix cursor position adjustment when removing stringsJiang Jiang2011-01-251-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 0ba1b4d0 introduced a regression to QTextDocument: it postponed cursor position adjustment until the move operation is done, but contentsChanged will be triggered by finishEdit() in this move operation, thus cursor positions in this signal handler will be in inconsistent states (normally we should first update cursor position then trigger contentsChanged). In this case we should also postpone finishEdit() handling after cursor positions have been adjusted, then the states expose to applications will be consistent. Task-number: QTBUG-15857 Reviewed-by: Eskil