summaryrefslogtreecommitdiffstats
path: root/src/gui/text
Commit message (Collapse)AuthorAgeFilesLines
* Second attempt: Fixed a few compiler warnings from QtGui for Symbian.Janne Anttila2009-10-131-0/+1
| | | | | | | The previous commit 9c6e466dc09813dd4a641b2cf385f35ac99346f5 included some changes which were not meant to be pushed. Reviewed-by: TrustMe
* Revert "Fixed a few compiler warnings from QtGui for Symbian."Janne Anttila2009-10-131-1/+0
| | | | | | Accidentally used git commit -a when should have used only git commit :( This reverts commit 9c6e466dc09813dd4a641b2cf385f35ac99346f5.
* Fixed a few compiler warnings from QtGui for Symbian.Janne Anttila2009-10-131-0/+1
| | | | Reviewed-by: TrustMe
* Make QTextControl give the right default action to Drag managerShane Kearns2009-10-121-2/+6
| | | | | | | | | | When dragging text from a non editable widget, QTextControlPrivate was passing allowed actions = CopyAction, default action = MoveAction. Default action is always used if you don't press any modifier keys, so text could be moved (cut) out of a non editable widget such as QLabel Task-number: QTBUG-4356 Reviewed-by: Aleksandar Sasha Babic
* Make writing out word-spacing use the right property.Thomas Zander2009-10-121-2/+2
| | | | | | | | ODF seems to not specify this property, while xslt (which odf copied for this) does, writing it out will be much more useful than loosing the info silently, though. Reviewed-by: Denis Dzyubenko
* Fixed a bug visible in QPrintPreview with the X11 XLFD font engine.Trond Kjernåsen2009-10-121-1/+1
| | | | | | | QFontEngineXLFD::boundingBox() function did not take justification into account when calculating the bounding box for a set of glyphs. Reviewed-by: Eskil
* Fix compile error on symbian platformShane Kearns2009-10-091-0/+4
| | | | Reviewed-by: Espen Riskedal
* Fix printing bitmap fonts on X11 with FontConfig enabledEskil Abrahamsen Blomfeldt2009-10-093-11/+24
| | | | | | | | | | | | | | | | | When FontConfig was enabled, bitmap fonts would often get a different pixel size than the one we requested. Usually the size would only be a pixel off, but this was especially visible when printing in highres with bitmap fonts, because in those cases we would request a pixel size which was computed based on the printer's high dpi. The result was that all printed text with bitmap fonts would be really really tiny. The fix falls back to using the XLFD font engine when using bitmap fonts (when the returned pixel size is different from the requested), because this engine scales the fonts for us. This will cause bitmap fonts to be rendered without antialiasing. Task-number: QTBUG-3620 Reviewed-by: Simon Hausmann
* Fixed text positioning when printing in HighResolution on Mac OS XGunnar Sletta2009-10-091-3/+4
| | | | Reviewed-by: Richard
* Fix compilation with -pedanticDavid Faure2009-10-071-1/+1
| | | | | Merge-request: 1716 Reviewed-by: Thiago Macieira <thiago.macieira@nokia.com>
* Small doclet fixThomas Zander2009-10-061-3/+3
| | | | Rev-By: Trust-Me
* Fix QKeySequence::DeleteEndOfWord and QKeySequence::DeleteStartOfWordmae2009-10-051-2/+4
| | | | | | | | | QTextControl showed inconsistent behaviour with DeleteEndOfWord and DeleteStartOfWord when the cursor had a selection. With this patch, the commands will simply delete the existing selection, which is consistent behaviour with in other IDEs. Reviewed-by: Simon Hausmann
* Fix regression in Command link button font sizeJens Bache-Wiig2009-09-091-0/+1
| | | | | | | | | | | | | Since vista style polish sets the font on polish, the check for WA_SetFont will succeed, hence we never set the actual font. I replaced the check with a full resolve. However since the resolve would clear the resolve_mask, from the widget font it has to be restored manually so that QPainter:setFont can resolve it later. Task-number: QTBUG-4646 Reviewed-by: trond
* Make QPF's implementation of alphaMapForGlyph() consistent.Rhys Weatherley2009-09-292-3/+5
| | | | | | | | | | | | | | The QPF implementation of alphaMapForGlyph() was returning color values of RGBA = (a, a, a, 255) instead of (0, 0, 0, a), which was inconsistent with all the other font engines. This inconsistency caused some QPF-specific workarounds in the OpenGL and OpenVG paint engines. This change removes the workarounds and makes QPF generate the right colors from the start. Paint engines that ignore the color table or which don't use the alphaMapForGlyph() function (e.g. raster) are not affected. Reviewed-by: Paul
* doc: Fixed three /sa that should be \saThorbjørn Lindeijer2009-09-281-1/+1
|
* Merge branch '4.5' of scm.dev.nokia.troll.no:qt/qt into 4.6Simon Hausmann2009-09-241-0/+2
|\ | | | | | | | | | | | | Conflicts: examples/webkit/formextractor/formextractor.pro mkspecs/features/qt.prf src/gui/painting/qpaintengineex.cpp
| * Fixed text drawing regression in Assistant.Trond Kjernåsen2009-09-241-0/+2
| | | | | | | | | | | | | | | | Revert parts of adf322c514a5781dcb9ec304d44229fa47d5e8b3 to get this to work as in 4.5.2 again. What the original patch fixed, we don't really know.. Reviewed-by: Simon Hausmann
| * Clean up properly in the QPF1 font enginePaul Olav Tvete2009-09-141-0/+6
| | | | | | | | | | | | | | We have to munmap() what we have mmap()ed Reviewed-by: Gunnar Reviewed-by: Jeremy
| * Update license headers again.Jason McDonald2009-09-0889-356/+356
| | | | | | | | Reviewed-by: Trust Me
* | QTextDocument initial revision after setPlainText/setHtmlmae2009-09-241-0/+4
| | | | | | | | | | | | After separating document revisions from the undo stack, the initial revision after setText/setHtml could get to high. Now it's +1 from the previous revision
* | Only account for a negative right bearing in QTextLayoutEskil Abrahamsen Blomfeldt2009-09-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | We only want to expand the width of the text, never shrink it. This is so that we can account for text where the pixels of the text extend beyond the edge of the last glyph. When we shrinked the width, code that depended on the natural text width equalling the advance of the text (such as WebKit) broke, and some text items would be positioned wrongly. We now only take negative right bearings into account (right bearing is left-bound), meaning that we only expand the text width, never shrink it due to right bearing. Reviewed-by: Simon Hausmann
* | Fixed a text drawing problem in the GL2 engine under X11.Trond Kjernåsen2009-09-241-1/+1
| | | | | | | | | | | | | | | | In certain situations text would toggle between sub-pixel hinted and normal antialiased, when e.g. drawing menus with -graphicssystem opengl. Reviewed-by: Samuel
* | Fix QTextDocument::revision()mae2009-09-243-23/+17
| | | | | | | | | | | | | | | | | | The revision was bound to the current depth of the undo stack. This had the negative side effect, that equal revisions could point to different documents, and sometimes changes would not even increase the revision (in the case of undo command merging). Reviewed-by: Roberto Raggi
* | QTextCursor selection extension when inserting charactersmae2009-09-231-2/+6
| | | | | | | | | | | | | | | | | | The change makes QTextCursor not extend the selection when inserting characters at the end of the selection, provided that the cursor position is at the end. Reviewed-by: Simon Hausmann Reviewed-by: Roberto Raggi
* | Fix breaking on fixed column width when text has tabsEskil Abrahamsen Blomfeldt2009-09-221-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | When a text in QTextLayout contained tabs, these would be counted as single glyphs when breaking the text on a fixed number of columns, rather than the number of characters they span. The patch calculates the number of characters represented by a tab by using the average character width of the font engine. Task-number: QTBUG-4468 Reviewed-by: Simon Hausmann
* | Fixed text drawing in the GL2 engine after sub-pixel hinting was added.Trond Kjernåsen2009-09-221-0/+6
| | | | | | | | | | | | | | | | | | | | 1. The mono format was not handled at all. 2. We really, really wanted to use sub-pixel hinted glyphs even when they were not available. 3. The glyphFormat type in the FT font engine wasn't updated to reflect the correct system glyph type. Reviewed-by: Kim
* | Made subpixel antialiasing in the GL2 engine work on X11 as well.Samuel Rødal2009-09-212-0/+23
| | | | | | | | | | | | Need to add alphaRGBMapForGlyph to the Freetype font engine. Reviewed-by: Kim
* | Making Keypad Navigation more usableAlessandro Portale2009-09-191-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All changes of this commit are #ifdef'ed in QT_KEYPAD_NAVIGATION. Most desktop Qts won't notice any change. Navigating between QWidgets was not alwys a pleasure on keypad devices. This commit fixes the navigation behavior for some widgets, mostly itemviews. Furthermore, it adds a 'directional' navigation mode. Until now, the existing keypad navigation used the tab order do go back and forth between widgets. The new mode is supposed to provide a more intuitive navigation. It is the new default mode on Symbian. Screens (and their resolutions) become bigger, and also low resolution screens can be used in landscape mode. That's why the directional mode was requested. Another popular request was to put some more convenience into QSlider: If a (horizontal) slider has focus and the user presses left/right, the value of the slider may directing change without being selected (edit mode). This commit also adds the manual test 'keypadnavigation'. Reviewed-by: Shane Kearns
* | Switch glyph cache from Qt to SymbianLiang QI2009-09-181-1/+2
| | | | | | | | | | | | | | Use Symbian glyph cache directly in QRasterPaintEngine, do not need cache them in Qt if on Symbian Platform. Reviewed-by: Alessandro Portale Reviewed-by: Jason Barron
* | Introduce native Symbian bitmap support to QPixmapJani Hautakangas2009-09-183-11/+23
| | | | | | | | | | | | | | | | | | This is done to reduce heap consumption and to give a possibility to share bitmaps across process. QPixmap maps to Symbian CFbsBitmap which is stored in Symbian font and bitmap server. Reviewed-by: Jason Barron
* | Fix glyph selection in symbol fonts that contain unicode cmap tableEskil Abrahamsen Blomfeldt2009-09-171-14/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | Some symbol fonts will contain a unicode cmap table in addition to the microsoft symbol cmap table that maps the symbol range (private range 0xf000 - 0xf100) into the correct glyphs. This is essentially a broken unicode table, and we should not prefer it if these conditions are true. In the strict cases where these conditions apply, we fall back to the symbol table instead. Task-number: QT-2354 Done-with: Lars Reviewed by: Lars
* | Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt into 4.6Morten Sorvig2009-09-173-6/+12
|\ \
| * | Fix to QSyntaxHighlighter not rehighlighting enoughmae2009-09-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When entire blocks get deleted, the last block for rehighlighting would be the block _before_ the deleted blocks. This is wrong, since the deleted blocks could have contained characters which affect the state. The patch lets the highlighter check for one more character. Reviewed-by: thorbjorn
| * | QFontMetrics::boundingRect(QString) returns incorrect width on Mac OS XPrasanth Ullattil2009-09-161-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This bug appears only in Carbon port (ATSUI font engine). While finding the character stops, this font engine relys on the RTL flags. As an optimization, for this particular version of boundingRect(), BIDI is ignored. So for this font engine, we will always use the correct RTL flags. Task-number: 213109 Done-with: Eskil Reviewed-by: Simon Hausmann
| * | Small optimisation in QFontMetrics multi-length-stringOlivier Goffart2009-09-161-4/+6
| | | | | | | | | | | | | | | | | | | | | Change the len instead of copying the string. Idea from Warwick Reviewed-by: Warwick Allison
* | | Improve font handling on Mac/Cocoa.Morten Sorvig2009-09-161-0/+31
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Mac/Cocoa font database currently relies on two APIs, ATSUI (old) and CoreText (new). These are interchangable and work on the same font database. Some differences do exist, in particular ATSFontFamilyGetName seems to return the same as ATSFontGetName for some fonts - the font name, not the family name. In any case, the old ATS code path is initializing QFontDatabase::familes() with the font name. This causes a naming mismatch with code that uses CoreText and gets the proper family name, in this case in initializeDb(). The fix is to make sure the correct family name is used by using the CoreText API to access it. RevBy: TrustMe
* | If the font does not exist, then the right bearing becomes to bigJørgen Lind2009-09-143-2/+5
| | | | | | | | | | | | | | | | | | In the QPF1 engine if the font does not exist, then the default constructor of glyph_metrics_t is used which sets the x and y values to the unlikely value of 100000. These glyph_metrics_t instances are not suppose to be used in the text layout calculations. Task-number: pending
* | fix compile error debug outputGunnar Sletta2009-09-141-1/+1
| |
* | Clean up properly in the QPF1 font enginePaul Olav Tvete2009-09-111-0/+6
| | | | | | | | | | | | | | We have to munmap() what we have mmap()ed Reviewed-by: Gunnar Reviewed-by: Jeremy
* | S60 font db more tolerant of failuremread2009-09-101-1/+6
| | | | | | | | | | | | | | This now loads the fonts it can and asserts that at least one is loaded, rather than requiring all fonts to load. Reviewed-by: Alessandro Portale
* | QTextDocument::contentsChanged() was emitted twice for a singlemae2009-09-101-1/+1
| | | | | | | | | | | | | | | | insertion. This was caught by the QSyntaxHighlighter autotest. Reviewed-by: Paul
* | Fix crash (assert) in QTextDocumentmae2009-09-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | When loading binary files as text, QTextCursor did not check for beginning and end of frame (QChar(0xfdd0) and QChar(0xfdd1)), while QTextDocument asserted that those characters were absent. The patch makes QTextCursor::insertText() treat frame bounderies like paragraph separators. Reviewed-by: ck
* | Account for right bearing in QFontMetrics::boundingRect(string)Eskil Abrahamsen Blomfeldt2009-09-091-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | QFontMetrics::boundingRect() that takes a string needs to account for the right bearing of the last glyph, as it is documented to be the rectangle that contains the pixels of the text. I've added a test for this, and fixed tst_QFontMetrics::elidedText() to use boundingRect() to find the actual width of the text drawn (width() will return the advance of the text, which is larger than the actual width of the pixels.) I've also fixed a small typo in the "len" -> "ilen". Reviewed-by: Simon Hausmann
* | Removed some superfluous semicolonsAlessandro Portale2009-09-091-2/+2
| | | | | | | | Reviewed-by: TrustMe
* | Getting text widget OOM tests working in Symbianmread2009-09-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There is one actual bug fix, checking for null pointer return. The exception safety test code now initialises the fonts system. The S60 fonts system does not survive OOM testing without this. Otherwise some duplicate tests are removed and code tidied up. Reviewed-by: Liang Qi Reviewed-by: Harald Fernengel Reviewed-by: Alessandro Portale
* | Merge branch '4.6' of git@scm.dev.troll.no:qt/qt into 4.6Janne Anttila2009-09-0993-426/+473
|\ \
| * | Update license headers again.Jason McDonald2009-09-0993-372/+372
| | | | | | | | | | | | Reviewed-by: Trust Me
| * | Take right bearing of glyphs into account when doing text layoutEskil Abrahamsen Blomfeldt2009-09-081-54/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To support correctly breaking text and calculating the bounding rect of text that has a right bearing (like italic text), we need to take the bearing into account when doing the layout. We add the bearing when checking whether we need to break the text, and we add it to the natural width of the text whenever we've finished a text line, so that we get the correct bounding rectangle. This patch only takes the last glyph's bearing into account. The theoretically correct approach would be to take all bearings into account and use the one which gives the longest text width. However, in practice the bearing of the glyph will not be great enough for it to span over several other glyphs. Also refactored a little to make the code simpler. Task-number: 176401 Reviewed-by: Simon Hausmann
* | | Fixed 'use of function is deprecated' warnings reported by RVCTJanne Anttila2009-09-091-1/+1
|/ / | | | | | | | | Task-number: 241223 Reviewed-by: Janne Koskinen
* | Support setting font size in shorthand font propertiesEskil Abrahamsen Blomfeldt2009-09-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fontSizeAdjustment defaulted to 0 which means "medium" in internal semantics. This will override any font size you set in the short-hand. In other locations, fontSizeAdjustment defaults to -255 which has no meaning attached. To allow setting the font size in short-hand (as in "font: 20px Arial"), we can't default to a specific adjustment. Two tests are added: The first verifies the case that already worked, where you specify the font size using the "font-size" property. The other verifies the short-hand case and would previously fail. Task-number: 207189 Reviewed-by: Simon Hausmann