summaryrefslogtreecommitdiffstats
path: root/src/gui/text
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/master' into refactorLars Knoll2011-07-131-2/+2
|\ | | | | | | Change-Id: I53c78056abde99198ffe1c67f7f9e90b4b08051d
| * Fix uses of qRound on non-floating-point types.Thiago Macieira2011-07-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | It's silly to round integeres, since they are already round. At most, this would waste CPU cycles without any benefit. Change-Id: I6fc0152f4416d723b65966e5d48cc7a07957b83c Merge-request: 17 Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com> Reviewed-on: http://codereview.qt.nokia.com/1541 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
* | Merge remote branch 'gerrit/master' into refactorSamuel Rødal2011-07-123-45/+52
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/image/qicon.cpp src/gui/image/qicon.h src/gui/image/qicon_p.h src/gui/text/qfontdatabase.cpp src/plugins/platforms/wayland/gl_integration/qwaylandglwindowsurface.cpp src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.cpp src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglwindow.cpp sync.profile Change-Id: Ie0a23a12177ff51bf562e15b2dd41f071afb19b4
| * Remove some metrics parsing code from Core TextJiang Jiang2011-07-112-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 (cherry picked from commit 8032d6f4ced50837e126f28c1475ad89eaf91ad7) Change-Id: I85e71a2e3228a367659be9f5f6ec3e667e0ce902 Reviewed-on: http://codereview.qt.nokia.com/1264 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
| * Don't cast a string from asciiLars Knoll2011-07-071-1/+1
| | | | | | | | | | | | | | Change-Id: Ia902e5be3ff61057b2e895a491bb68f1b7c6dd64 Reviewed-on: http://codereview.qt.nokia.com/1221 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Liang Qi <liang.qi@nokia.com>
| * Fix regressions in previous QFontDatabase patchJiang Jiang2011-07-076-57/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. 3. Move styleName out of QtFontStyle::Key so that the code can be clearer and more explicit. Change-Id: Icdee8e97568a0f31f57d2cdb8d414f47331fde75 Reviewed-by: Eskil Reviewed-on: http://codereview.qt.nokia.com/1263 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* | QLineControl: Fix compilation, warnings.Friedemann Kleint2011-07-082-1/+4
| | | | | | | | | | | | Change-Id: I6a2d2f24b13961e8dc113366f62402824d80e1c2 Reviewed-on: http://codereview.qt.nokia.com/1365 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* | Merge remote branch 'gerrit/master' into refactorLars Knoll2011-07-0612-181/+317
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/unix/opengldesktop/opengldesktop.cpp examples/itemviews/interview/interview.pro examples/mainwindows/mainwindow/mainwindow.pro examples/openvg/README examples/richtext/textedit/textedit.pro examples/tools/undo/undo.pro src/corelib/global/qglobal.h src/corelib/kernel/qcoreapplication.h src/corelib/kernel/qcoreevent.h src/corelib/kernel/qmetatype.h src/gui/kernel/qevent.cpp src/gui/kernel/qevent.h src/gui/painting/qpaintengine_raster.cpp src/gui/painting/qpaintengine_raster_p.h src/gui/text/qfontdatabase.cpp src/opengl/qgl.h src/openvg/qpaintengine_vg.cpp src/plugins/platforms/wayland/qwaylandwindow.cpp tests/auto/qmainwindow/qmainwindow.pro Change-Id: I6bfb586740a68379bb99f4612ec993393a5f3234
| * Doc: Fixed qdoc warnings.David Boddie2011-07-012-7/+33
| | | | | | | | | | | | | | Change-Id: I7b4e9ef513b82a82d2365c9256d09520a44ad10d Reviewed-on: http://codereview.qt.nokia.com/324 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-07-011-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Bug introduced by f54c5d9133d7aa7636988db36fa6cc51d26434b6. The release statement has to come before the return statement :) Reviewed-by: Jiang Jiang (cherry picked from commit d58eec3c932d1cdbcf3b42534e8fe870ec109487) Change-Id: Ib0b550ead3f971736142d88f4ca19bb8edc1b654 Reviewed-on: http://codereview.qt.nokia.com/949 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
| * Fix transformations on DirectWrite rasterized textEskil Abrahamsen Blomfeldt2011-07-012-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 (cherry picked from commit f54c5d9133d7aa7636988db36fa6cc51d26434b6) Change-Id: I3c3840b41e19fcacf926dbf454bdc2cba4bd5a99 Reviewed-on: http://codereview.qt.nokia.com/948 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
| * Fix text color in some cases of QML and QStaticTextEskil Abrahamsen Blomfeldt2011-06-301-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 Change-Id: Ia819b67cccc9eaedd23fde655eab58cd892646f8 Reviewed-by: Jiang Jiang Reviewed-on: http://codereview.qt.nokia.com/870 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
| * Add HB_LineBreakType to qharfbuzz_copy_p.h.Frederik Gladhorn2011-06-301-0/+7
| | | | | | | | | | | | | | | | | | The QTextLayout relies on this enum to be defined. Change-Id: Ibcc8a0073bd56e29431c52c4ea54a909ff42f07b Reviewed-on: http://codereview.qt.nokia.com/537 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
| * Move glyph run merging logic to QTextLayout levelJiang Jiang2011-06-302-110/+101
| | | | | | | | | | | | | | | | | | So that we can merge glyph runs from different QTextLines. Change-Id: Id8e0cc1aa21a482a995773fd55599c0011245e82 Reviewed-on: http://codereview.qt.nokia.com/950 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
| * compile on Mac OS XGunnar Sletta2011-06-281-1/+2
| | | | | | | | | | | | | | Change-Id: Ibe74e51aab6e6b8d7a0e71cd88dcc97f72fcd1f9 Reviewed-on: http://codereview.qt.nokia.com/833 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
| * Add missing APIs to QRawFont and some additional notes to fromFontJiang Jiang2011-06-272-0/+29
| | | | | | | | | | | | | | Change-Id: I8487a2e32f5b71a1eb51dcb8540cb5de2def09f6 Reviewed-on: http://codereview.qt.nokia.com/769 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
| * Only compare styleNames if they are not emptyJiang Jiang2011-06-272-2/+2
| | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-19366 (cherry picked from commit 15e6ac8f4d9e7a419cd0c10405954bde78559fac) Change-Id: I5f06bb5133f23dbc8ad6d745d44ca0a85ef49686 Reviewed-on: http://codereview.qt.nokia.com/760 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
| * Store styleName in font databaseJiang Jiang2011-06-273-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. Reviewed-by: 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>
* | added a QLineControl class to QtGuiLars Knoll2011-07-064-1/+2166
| | | | | | | | | | | | | | | | The class does not have support for completion, but is otherwise mostly on par with the control in QtWidgets. Change-Id: I2c89f8ea910cfacba67d4e5e56d8d650d27760b9
* | add QTextControl class to QtGuiLars Knoll2011-07-067-1/+3420
| | | | | | | | | | | | | | | | This is a reduced version of the old text control class, that doesn't support a few QWidget specific additions. Change-Id: Ib4542845a30473bb2462b2fe14daba178b571368
* | Adapt font engines for Windows/QPA.Friedemann Kleint2011-06-293-5/+40
| | | | | | | | | | | | | | | | | | Export QFontEngineMulti and glyph_metrics_t. Implement alphaMapForGlyph() for the multifont-engines which is called in the QPA code paths (similar to boundingBox()). Acked-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* | Merge remote-tracking branch 'base/master' into refactorJørgen Lind2011-06-278-10/+21
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: demos/demos.pro demos/embedded/digiflip/digiflip.pro examples/examples.pro examples/graphicsview/embeddeddialogs/embeddeddialogs.pro src/gui/kernel/qplatformglcontext_qpa.cpp src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxcontext.cpp src/plugins/platforms/wayland/qwaylanddisplay.cpp src/plugins/platforms/wayland/qwaylandwindow.cpp Change-Id: I2a4ec9e2ca9c9aa9d57b55f98985e810b77bb745
| * Add styleName to QFontDef comparisonJiang Jiang2011-06-272-0/+4
| | | | | | | | | | | | | | | | | | | | | | To make sure we cache different font engines with different style names. Task-number: QTBUG-19366 Change-Id: Iefaebd5418f212ff759e03c1745f839a7f23d013 Reviewed-on: http://codereview.qt.nokia.com/738 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
| * Fix fontconfig usage in X11 font databaseJiang Jiang2011-06-222-52/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We should do FcConfigSubstitute(0, pattern, FcMatchFont) on a FcPattern for query because the family list in it will contain almost all the families after FcConfigSubstitute(0, pattern, FcMatchPattern), then the test in <match target="font"> will almost always succeed. In general, FcMatchFont substitute should only be done on the FcPattern that we got after FcFontMatch() or FcFontRenderPrepare(). Based on the suggestion of fontconfig author Behdad Esfahbod, this patch reorganized the tryPatternLoad logic so that it only does the QFontEngine creation part, FcPattern *match is retrieved outside of that function. In this way, the match pattern we got can be either from FcFontMatch() or after FcFontRenderPrepare() on one of the fonts we got from qt_fontSetForPattern(). Then we don't need to duplicate the pattern and add all criterias back with qt_addPatternProps(). It not only simplified the code a lot but also fix the way we apply FcMatchFont substitution. This substitution will either be done by FcFontMatch() or FcFontRenderPrepare, both implicitly. Task-number: QTBUG-2148, QTBUG-19947 Change-Id: I2e4dbbe7f448e81850176732b4a65028f2b912fa Reviewed-by: Eskil Reviewed-on: http://codereview.qt.nokia.com/579 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
| * Support -qtnamespace and -qtlibinfix againLiang Qi2011-06-203-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | This fix is for qtbase libraries with -qtnamespace and -qtlibinfix options in configure. Task-number: QTBUG-19964 Change-Id: I2f2ff1748f2c1c2b20d5f73b6be36f68a7a26cef Reviewed-on: http://codereview.qt.nokia.com/505 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
| * Fix empty lines in Qt HTML when displayed in external browsers (again)Eskil Abrahamsen Blomfeldt2011-06-203-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This redoes f541c78e1bc5b293466b40e6f10496199a4a5d73 in a way which should be more compliant with different browsers. In particular, Outlook didn't support the CSS trick in the last fix, so we need the somewhat larger patch which adds an extra line break node to the tree and then ignores it when re-importing the document. Task-number: QTBUG-3669 Reviewed-by: Simon Hausmann (cherry picked from commit cb760eaef631abd49836ae5c8dc12a61ef5eff0d) Change-Id: Ia55bf39d52461aa9445a9a5d0bfb5b4c5bf1e9bd Reviewed-on: http://codereview.qt.nokia.com/492 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
| * Fix bug which caused repeated characters in a QML TextEskil Abrahamsen Blomfeldt2011-06-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | We would include too much in the characters displayed, since itemEnd is actually the start of the next item and not the end of the current one. Adding a minus one removes the duplicated characters at the end of text lines. Change-Id: I1e13470548fafaa692ae58e019e9e2469a947f5e Reviewed-on: http://codereview.qt.nokia.com/495 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
| * Fix missing empty lines in Qt HTML when displayed in compliant browsersEskil Abrahamsen Blomfeldt2011-06-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When QTextDocument exports HTML, it makes an effort to be compatible with its own importer, hence it has to be compatible with the dialect of HTML which Qt has developed over the years. One incorrect interpretation in Qt is that an empty paragraph is interpreted as an empty line. So if you use a QTextDocument to produce HTML for text where an empty line has been added, this empty line will not be visible when the document is viewed in a compliant browser. The fix is to set the height of the empty paragraph to 1em, so that it will match the current pixel size of the font, thus look the same as a <p><br /></p> but without altering the structure of the document. Reviewed-by: Gunnar (cherry picked from commit f541c78e1bc5b293466b40e6f10496199a4a5d73) Change-Id: Ic0eae2c81609b8872eb2eb9344a3ec416cd09149 Reviewed-on: http://codereview.qt.nokia.com/445 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* | Renamed QLine/TextControl to QWidgetLine/TextControlLars Knoll2011-06-273-3/+3
| | | | | | | | | | | | | | Renamed them to free up the QTextControl and QLineControl class names for a new API in QtGui. Reviewed-by: Jørgen Lind
* | Merge remote-tracking branch 'base/master' into refactorJørgen Lind2011-06-1017-55/+290
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/animation/animatedtiles/animatedtiles.pro examples/animation/appchooser/appchooser.pro examples/animation/moveblocks/moveblocks.pro examples/animation/states/states.pro examples/animation/stickman/stickman.pro examples/dialogs/configdialog/configdialog.pro examples/dialogs/sipdialog/sipdialog.pro examples/dialogs/standarddialogs/standarddialogs.pro examples/dialogs/tabdialog/tabdialog.pro examples/draganddrop/draggableicons/draggableicons.pro examples/draganddrop/draggabletext/draggabletext.pro examples/draganddrop/fridgemagnets/fridgemagnets.pro examples/draganddrop/puzzle/puzzle.pro examples/gestures/imagegestures/imagegestures.pro examples/graphicsview/basicgraphicslayouts/basicgraphicslayouts.pro examples/graphicsview/collidingmice/collidingmice.pro examples/graphicsview/elasticnodes/elasticnodes.pro examples/graphicsview/weatheranchorlayout/weatheranchorlayout.pro examples/itemviews/addressbook/addressbook.pro examples/itemviews/chart/chart.pro examples/itemviews/fetchmore/fetchmore.pro examples/itemviews/puzzle/puzzle.pro examples/mainwindows/menus/menus.pro examples/painting/basicdrawing/basicdrawing.pro examples/painting/concentriccircles/concentriccircles.pro examples/painting/imagecomposition/imagecomposition.pro examples/painting/painterpaths/painterpaths.pro examples/painting/transformations/transformations.pro examples/qtconcurrent/imagescaling/imagescaling.pro examples/qtestlib/tutorial1/tutorial1.pro examples/qtestlib/tutorial2/tutorial2.pro examples/qtestlib/tutorial3/tutorial3.pro examples/qtestlib/tutorial4/tutorial4.pro examples/qtestlib/tutorial5/tutorial5.pro examples/qws/dbscreen/dbscreen.pro examples/qws/svgalib/svgalib.pro examples/richtext/syntaxhighlighter/syntaxhighlighter.pro examples/statemachine/rogue/rogue.pro examples/tools/plugandpaintplugins/extrafilters/extrafilters.pro examples/tools/styleplugin/plugin/plugin.pro examples/uitools/multipleinheritance/multipleinheritance.pro examples/widgets/analogclock/analogclock.pro examples/widgets/calculator/calculator.pro examples/widgets/calendarwidget/calendarwidget.pro examples/widgets/codeeditor/codeeditor.pro examples/widgets/icons/icons.pro examples/widgets/imageviewer/imageviewer.pro examples/widgets/lineedits/lineedits.pro examples/widgets/movie/movie.pro examples/widgets/shapedclock/shapedclock.pro examples/widgets/softkeys/softkeys.pro examples/widgets/tetrix/tetrix.pro src/gui/painting/qpaintengine_raster.cpp src/gui/painting/qpaintengine_raster_p.h src/openvg/openvg.pro src/openvg/qpaintengine_vg_p.h src/plugins/graphicssystems/meego/meego.pro src/plugins/platforms/fontdatabases/basicunix/basicunix.pri
| * Fontengine buildfix for xcb platform plugin.Tapani Mikola2011-06-104-11/+7
| | | | | | | | | | | | Change-Id: Ic909e1ac08163e62634643c68862e802a016b911 Reviewed-on: http://codereview.qt.nokia.com/442 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
| * Allow selecting fonts with irregular style namesJiang Jiang2011-06-0911-96/+204
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fonts like "Helvetica Neue UltraLight" or "Skia Regular Black Condensed" can't be selected in Qt because either they don't report correct numeric values for weight/stretch/etc. or these values are not mapped from QFont enums in a linear way. Thus we provide a shortcut to select these fonts with PostScript name or full name without resorting to family name matching in QFontDatabase (these fonts are not registered in font database anyway). After this, we can simply use: QFont font("Helvetica Neue"); font.setStyleName("UltraLight"); to select these fonts. QCoreTextFontEngineMulti matched like this can be created directly from the CTFontRef instance instead of creating from the font name, making this process faster. The commit also cleaned up the font loading process in Mac font database a bit, moving the code for family matching into a separate function. Add QFontInfo::styleName() and QRawFont::styleName() to access the resolved style name for a font. Task-number: QTBUG-19366 Change-Id: Iad07768c02ed06cc8d6b7395dec554384f410506 Reviewed-on: http://codereview.qt.nokia.com/333 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
| * Duplicate some harfbuzz symbols inside Qt.Gunnar Sletta2011-06-094-3/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is done to remove a compile-time dependency on the harfbuzz source files inside qtbase/src/3rdparty. These are not accessible now that QT_SOURCE_TREE is not accessible as a qmake variable anymore. With the refactor branch we might solve this differently, but for now this is how we get svg and declarative to compile. Change-Id: I5dad23f2ea1f650e2621c1c1fcf39632a3a22ae8 Reviewed-on: http://codereview.qt.nokia.com/378 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
| * Reorder member varibles in QGlyphRunPrivate to eliminate warningJiang Jiang2011-06-081-4/+4
| | | | | | | | | | | | | | | | | | | | Reviewed-by: Eskil (cherry picked from commit 74a1135341783449970d579b273d00c837ac14b0) Change-Id: I8e1c6bdc7f0957d8f389531f5f5682c536cdc286 Reviewed-on: http://codereview.qt.nokia.com/374 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
| * Fix warning in qtextengine compilationJiang Jiang2011-06-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | enableHarfbuzz() should only be defined on Mac. Reviewed-by: Eskil (cherry picked from commit 5ce3fbb67b79c3732fd47b296ef9421398ca520c) Change-Id: I9ecb5db49478c3f5beb5d41cf99320f0faedce2e Reviewed-on: http://codereview.qt.nokia.com/375 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
| * Fix compile when configure with no fontconfig supportJiang Jiang2011-06-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-19716 Reviewed-by: Eskil (cherry picked from commit 5a598afa3f1928e9ad18257e2fa48fe3d5739917) Change-Id: I05107970e3273fce48303c9956e1c9aa928832b9 Reviewed-on: http://codereview.qt.nokia.com/376 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
| * Add function QGlyphRun::setRawData()Eskil Abrahamsen Blomfeldt2011-06-074-46/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To provide an optimized way of constructing QGlyphRun objects with no copying or allocation, we add function setRawData() (naming inspired by QByteArray::setRawData()). Data retrieved from QRawFont can be passed directly into this. The logic is now that the data pointers in QGlyphRunPrivate should always point to the current valid data and is what will be used in comparisons and drawing calls. The vectors are optimizations to avoid unnecessary copying if the user wants to use the QVector based API (which makes it easier to manage the memory.) This reflected in the functions that return QVectors, which will return the stored vector if and only if it is identical to the current pointer. Otherwise we will have to copy the memory. The internal addition operators in QGlyphRun have been removed since they really provide no real optimization and have an unclear definition if the two glyph runs are based on different fonts. Reviewed-by: Jiang Jiang (cherry picked from commit 86d88c5b719fd3d50336d9d8e7127b8045ee82ae) Change-Id: Id5bb55ee3d93afb32ffca850f53382e856df7b3e Reviewed-on: http://codereview.qt.nokia.com/342 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
| * Correct antialias disabling logic for Core TextJiang Jiang2011-06-041-3/+2
| | | | | | | | | | | | | | | | | | | | We should always turn antialias off when QFont::NoAntialias being passed in styleStrategy. That corrects some QStaticText tests. Change-Id: Iaffc5f3bb7f501dcb648cab41a8b6ffcf93f90ae Reviewed-on: http://codereview.qt.nokia.com/328 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* | QTextDocumentLayout has to be exported as it is used in widgetsOlli Werwolff2011-06-081-1/+1
| | | | | | | | | | Reviewed-by: Samuel Reviewed-by: Lars Knoll
* | Buildfix for Mac OSRichard Moe Gustavsen2011-06-071-1/+1
| | | | | | | | | | | | Since 'widgets' now is a separate library outside GUI, some previously hidden symbols now needs to be exported. This patch will make 'widgets' build.
* | Make building of platform plugins indifferent if its out of sourceJørgen Lind2011-06-061-1/+1
| | | | | | | | | | This requires some source files to be shipped with the Qt install They are now copied into QT_INSTALL_DATA/platform
* | Merge remote-tracking branch 'base/master' into refactorJørgen Lind2011-06-014-11/+86
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/embedded/qmousepc_qws.cpp src/gui/embedded/qwslock.cpp src/plugins/decorations/default/default.pro src/plugins/decorations/styled/styled.pro src/plugins/decorations/windows/windows.pro src/plugins/gfxdrivers/ahi/ahi.pro src/plugins/gfxdrivers/directfb/directfb.pro src/plugins/gfxdrivers/eglnullws/eglnullws.pro src/plugins/gfxdrivers/linuxfb/linuxfb.pro src/plugins/gfxdrivers/qvfb/qvfb.pro src/plugins/gfxdrivers/transformed/transformed.pro src/plugins/gfxdrivers/vnc/vnc.pro src/plugins/graphicssystems/meego/meego.pro src/plugins/graphicssystems/opengl/opengl.pro src/plugins/graphicssystems/openvg/openvg.pro src/plugins/graphicssystems/shivavg/shivavg.pro src/plugins/graphicssystems/trace/trace.pro src/plugins/kbddrivers/linuxinput/linuxinput.pro src/plugins/mousedrivers/linuxtp/linuxtp.pro src/plugins/mousedrivers/pc/pc.pro src/plugins/mousedrivers/tslib/tslib.pro src/plugins/platforms/minimal/minimal.pro tests/auto/qerrormessage/qerrormessage.pro
| * Make TextEdit word selection more natural.Andrew den Exter2011-06-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QTextControl will only extend the selection to a word if the cursor is directly over it which prevents the selection being extended if the mouse is dragged up or down a to a shorter line of text making it difficult to select multiple lines of text. Just disable that limitation when the TextEdit word selection is enabled. Change-Id: I3b9d1575c0141db8441197d740de94a90eacc077 Task-number: QTBUG-19230 Reviewed-by: Martin Jones Reviewed-on: http://codereview.qt.nokia.com/292 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
| * Ensure the TextEdit cursor delegate is repositioned on mouse events.Andrew den Exter2011-06-011-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | Update the micro focus when a mouse press changes the cursor position of a read only TextEdit. Change-Id: I11855037f7938b2cd23ac6ad165722b5289b4f46 Task-number: QTBUG-19109 Reviewed-by: Martin Jones Reviewed-on: http://codereview.qt.nokia.com/291 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
| * Fix build in C++0x modeBernhard Rosenkraenzer2011-05-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes compiler errors (gcc 4.6 -std=gnu++0x on x86_64 Linux): embedded/qwslock.cpp: In function `bool forceLock(int, int, int)': embedded/qwslock.cpp:121:39: error: narrowing conversion of `semNum' from `int' to `short unsigned int' inside { } [-fpermissive] (and equivalent errors in other lines/files) See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf Section 8.5.4/6 Change-Id: I2cbac5482b87f33287a416af5a5c9bde621720bc Reviewed-By: Olivier Goffart Merge-Request: 1240 Reviewed-on: http://codereview.qt.nokia.com/275 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
| * Support placing cursor in ligature with mouse or touchJiang Jiang2011-05-303-7/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 (cherry picked from commit 5338d78aa9d80ddd2bcb21e6b22cd2cf1522a7d3) Change-Id: Ic747e9458d561aca0848dcd1e8b94e0a23fd8189 Reviewed-on: http://codereview.qt.nokia.com/196 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
| * Fix ligature offset in multi-line textJiang Jiang2011-05-271-2/+2
| | | | | | | | | | | | | | | | | | Reviewed-by: Eskil (cherry picked from commit 278cf1f37945050c4a46d5acab0659f3a7546a43) Change-Id: Ice20aa38a49ea16cf56bd3705c7d400ee165a9c2 Reviewed-on: http://codereview.qt.nokia.com/195 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
| * Fix compile for systems with old fontconfigJiang Jiang2011-05-271-0/+5
| | | | | | | | | | | | Change-Id: Ia26796bdbab7988d14163d3c1290111c0cb22bf7 Reviewed-on: http://codereview.qt.nokia.com/182 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
| * Workaround a bug in Core Text to select Light fontsJiang Jiang2011-05-251-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently in Core Text there is not proper way to select fonts with Light weight, for example: QFont font("Helvetica"); font.setWeight(QFont::Light); will give you Helvetica-Light, as with: QFont font("Helvetica"); font.setWeight(QFont::Normal); because of a bug in Core Text, applying 0 symbolic traits with CTFontCreateCopyWithSymbolicTraits will always return the Light variant of that font family. Thus, we should only do this unless symbolicTraits is not 0 or font.weight is not Normal (Light is not a symbolic trait, but CT doesn't support selecting Light weight numerically). Reviewed-by: Eskil (cherry picked from commit 4d5b8f66d82e9087d9d58a4e76e6b46ce7bb53cc) Change-Id: I37a970aba5019a13b9f3bc43b7fb594b74a1aa37 Reviewed-on: http://codereview.qt.nokia.com/124 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
| * Fix QFontEngineX11FT compilationJiang Jiang2011-05-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | xglyph_format is only available when XRender is present. Reviewed-by: Fabien Freling (cherry picked from commit a6642e4659b3d45ffa94f9a3c6413124d49f2b91) Change-Id: Ibd767c5055c8fb4a7d28ace141f6713f4367d1ba Reviewed-on: http://codereview.qt.nokia.com/113 Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>