summaryrefslogtreecommitdiffstats
path: root/src/gui/text
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into ↵Qt Continuous Integration System2011-01-1096-97/+97
|\ | | | | | | | | | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: QFont/Windows: restrict the pixel size accuracy Update copyright year to 2011. For non-developer builds, skip test that requires private API tst_qhttpnetworkconnection: Compile fix Change QHostInfoCache to use QElapsedTime instead of QTime. Fix for qtdemo bug
| * QFont/Windows: restrict the pixel size accuracyJoerg Bornemann2011-01-101-1/+1
| | | | | | | | | | | | | | | | Like on all other platforms, the pixel size accuracy is now restricted to two digits after the decimal point. Task-number: QTBUG-15688 Reviewed-by: Jiang Jiang
| * Update copyright year to 2011.Jason McDonald2011-01-1096-96/+96
| | | | | | | | Reviewed-by: Trust Me
* | Merge branch 'graphics-team-text-4.7' into 4.7Eskil Abrahamsen Blomfeldt2011-01-101-2/+2
|\ \ | |/ |/|
| * Fix crash in QTextBlock::next()/previous()Jiang Jiang2011-01-071-2/+2
| | | | | | | | | | | | | | | | | | We should check not just p but also n in next()/previous(), which is what isValid() does. Otherwise n == 0 will cause crash in QFragmentMap. Task-number: QTBUG-16279 Reviewed-by: Eskil
* | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2011-01-076-6/+6
|\ \ | | | | | | | | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Fixes crash in QGraphicsItem's destructor. Doc: Fixing typo
| * | Doc: Fixing typoSergio Ahumada2011-01-076-6/+6
| |/
* | improve performance of QTextEngine, esp. setBoundary by using non-detaching ↵Milian Wolff2010-12-231-7/+7
|/ | | | | | | | | | | | | | | | | operator[] Improves scrolling in testfile content.xml attached to QTBUG-9549. According to callgrind, the improvement is nearly 35% (comparing total incl. cost of QTextEngine::setBoundary) total incl cost / calls to setBoundary = before: 6.0883269E9 / 46520 = approx. 130875.47 after: 2.4834313E9 / 29370 = approx. 84556.733 in relation this gives us: 84556.733 / 130875.47 = approx. 0.64608542 Merge-request: 975 Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
* Runtime dependency on Symbians Font Table APIAlessandro Portale2010-12-093-147/+181
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Symbian Font Table API is a feature from (the former) Symbian^4 which will be backported into Symbian^3 in a random minor OS version. In order to keep Qt source and binary compatible between these minor versions, we cannot decide at compile time whether or not to use the new Font Table API. This patch changes many "#ifdef Q_SYMBIAN_HAS_FONTTABLE_API" into "if (symbianFontTableApiAvailable())". The Font Table feature is detected at runtime. Currently, CFeatureDiscovery is not used, because at the time of writing, that feature flag test would give false positives or false negatives. Instead, CFont::ExtendedFunction() is called with KFontGetFontTable to see if the return value is KErrNone, which indicates that the feature is available. The avalibility information gets cached, so the hack happens only once per application run. The font table Api feature comes with helper classes such as "RFontTable" and "TGetFontTableParam". But we cannot use those, because we want to stay source and binary compatible across the Symbian(^3) versions without the Font table API and those with. So, in Qt, RFontTable is simply not used and TGetFontTableParam is replicated as "QSymbianTGetFontTableParam". Same for KFontGetFontTable, KFontReleaseFontTable and later also FfFontTable. This patch has been looked at by colleagues, who verified the overall #ifdef to if() conversion, but did not feel entitled to give their official Reviewed-By for an obscure topic like Qt font support on Symbian. (It sucks to be the only creature in this universe who -kind of- knows how Qt text handling and Symbian text handling interact) Task-Number: QTBUG-15515
* Fix crash in QTextDocument::markContentsDirtyJiang Jiang2010-12-061-2/+4
| | | | | | | | 6f6c25b6 introduced this regression because it didn't check d->lout before calling d->lout->documentChange(). Task-number: QTBUG-15777 Reviewed-by: Eskil
* Fix QTextEdit::selectAll crash from textChanged()Jiang Jiang2010-12-061-0/+3
| | | | | | | | | Doing selectAll() after the entire block of text has been removed will cause this crash, because we didn't check if the block we found is valid or not. Task-number: QTBUG-15857 Reviewed-by: Eskil
* Fix strict-aliasing violation warning.Thiago Macieira2010-11-261-1/+9
| | | | | Strict aliasing is violated here, so just silence the compiler (GCC) by using an extension.
* Doc: Fixing typoSergio Ahumada2010-11-221-1/+1
|
* Fix possible crash in QStaticText and QDeclarativeTextLayoutEskil Abrahamsen Blomfeldt2010-10-292-10/+66
| | | | | | | | | | | | | The QStaticTextItem held an uncounted reference to QFontEngine. The pointer would dangle in some cases where there was no font object referencing the engine and the cache was cleaned out (e.g. when a new application font is added.) Properly count the reference, and also add reference counting to userData to make it harder to shoot yourself in the foot, since the QStaticTextItem class is now being used in different places, Task-number: QTBUG-14446 Reviewed-by: Martin Jones
* Fixed many spelling errors.Rohan McGovern2010-10-256-8/+8
|
* Fixed font rendering in manually built Qt on ARMv6.Samuel Rødal2010-10-201-2/+19
| | | | | | | | The pixelSize ends up being 0 unless these changes are applied. Must be a compiler bug in GCC 4.3.x, fixed in GCC 4.4.1. Reviewed-by: Prasanth Reviewed-by: Olivier Goffart
* Remove obsolete tweak in QFontEngineS60::alphaMapForGlyphAlessandro Portale2010-10-121-17/+5
| | | | | | | | | | | | | | | | | | | | | | On some Symbian versions (apparently <= Symbian^1), CFont::GetCharacterData() returns 8-bit data with gray values 0x00, 0x10 ... 0xe0, 0xf0 due to a bug. The glyphs are nowhere perfectly opaque, which is bad for blitting. This has been however been fixed for Symbian^3. The funny thing about this tweak was that it was only executed on Symbian^3 (with the OpenVG/OpenGL paintengines). On Symbian^1 and below (rasterpaintengine), QFontEngineS60::alphaMapForGlyph() does not get called at all, anymore. Therefore, the removal of this tweak should not be noticable anywhere, except that on Symbian^3, quite a few CPU cycles are now saved. See the attachments in QTBUG-14419 for details. Task-Number: QTBUG-14419 Reviewed-By: TrustMe
* Optimize QFontEngineS60::recalcAdvances()Alessandro Portale2010-10-121-3/+6
| | | | | | | | | | | | | | | | | | | (Addition to ab057be7228d20d909246183505b72e821cc440f) Instead of using a glyph_metrics_t (which gets filled with data from a TOpenFontCharMetrics), we use a TOpenFontCharMetrics, directly. Also, the advances_y gets set to 0. Like on the other platforms. These change increases the Fps in qt\tests\manual\textrendering\textperformance "Latin" from 16.5 to 16.6 Fps on an XM5800. I am sure that I can construct a benchmark where the speed gain is bigger. Task-number: QTBUG-14378 Reviewed-by: TrustMe
* Implement QFontEngineS60::emSquareSize()Alessandro Portale2010-10-122-0/+29
| | | | | | | | | | | | | | | Some glyph position tweaks during the shaping phase require the "Units per Em" information for the font. QFontEngineS60 did not reimplement emSquareSize(), therefore, some combined glyphs were rendered incorrectly (see QTBUG-10725) This patch implements QFontEngineS60::emSquareSize() Since Symbian does not provide the "Units per Em" via public Api, we have to pick that out of the 'head' font table. The value is cached per font. Task-Number: QTBUG-10725 Reviewed-by: Eskil Abrahamsen Blomfeldt
* Remove unnecessary calls to GetHorizBounds() + boundingBox()Alessandro Portale2010-10-121-6/+4
| | | | | | | | | | | | | | | | | | | | | | | QFontEngineS60::boundingBox_const(): The metrics that CFont::getCharacterData() returns is equivalent to what TOpenFontCharMetrics::GetHorizBounds() returns. So, remove the use of TRect glyphBounds, and TOpenFontCharMetrics::GetHorizBounds(). Implementation of TOpenFontCharMetrics::GetHorizBounds(): http://developer.symbian.org/oss/API_REF/Public_API/file/837f303aceeb/epoc32/include/openfont.h#l1352 QRasterPaintEngine::drawGlyphsS60(): The metrics that QFontEngineS60::getCharacterData() returns are equivalent to what QFontEngineS60::boundingBox() returns. So, remove the use of glyph_metrics_t metrics, and QFontEngineS60::boundingBox(). These changes increase the Fps in qt\tests\manual\textrendering\textperformance "Latin" from 16.2 to 16.5 Fps on an XM5800. And they do that by removing code :) Task-number: QTBUG-14378 Reviewed-by: Jason Barron
* Fix memory leak in QFontEngineS60::addGlyphsToPath()Alessandro Portale2010-10-121-0/+1
| | | | | | | | | | | An "Open()"ed RGlyphOutlineIterator needs to be "Close()"d before destroying the iterator. Otherwise some allocated memory does not get freed. The RGlyphOutlineIterator destructor does not close an open iterator. Task-Number: QTBUG-14408 Done-by: Colleague from Nokia, Oulu Reviewed-by: Alessandro Portale
* Fix infinite loop when justifying undisplayable Arabic textEskil Abrahamsen Blomfeldt2010-10-081-6/+10
| | | | | | | | | | | If the Arabic text is for some reason undisplayable, e.g. because of QTBUG-13132, the font engine will be unable to find the tatweel character and the kashida width may be returned as 0. This would potentially cause an infinite loop, as "need" would remain >= minKashida forever because x - 0 is still >= 0. Task-number: QTBUG-13130 Reviewed-by: Lars
* Moving QPdf::stripSpecialCharacter to fontengineJørgen Lind2010-09-305-17/+23
| | | | | | | It is only used by the fontengines. This is one of the steps to make it easier to make fontengines build outside of QtGui. Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Fix QFontMetrics::lineWidth() for fonts with defined point sizeAlessandro Portale2010-09-281-1/+7
| | | | | | | | | | | | | | | | | | | | QFontMetrics::lineWidth() and ::underlinePos() return value 1 regardless of the font size if the size was defined in points (instead of pixels). (On Symbian) QFontMetrics::lineWidth() calls QFontEngine::lineThickness() which uses its fontDef.pixelSize in order to come up with a suitable line width. If the QFont size was defined in points, Qt needs to make sure that fontDef.pixelSize is set accordingly. This patch adds the code to make sure that QFontEngine::fontDef always has a valid pixel size. tst_QFontMetrics::lineWidth() was added, wich failed before and passes after this patch. Task-Number: QTBUG-13009 Autotest: Passes Reviewed-By: Eskil
* Implemeting, exporting and autotesting QFont::lastResortFont()Alessandro Portale2010-09-281-0/+10
| | | | | | | | | | | | | | | | | | | | | An implementation of QFont::lastResortFont() is still(!) missing in Qt 4.7.0. I only became aware of QTBUG-6921, lately. This patch... 1) implements QFont::lastResortFont() in qfont_s60.cpp by first trying to get the lastResortFamily() and then falling back to a hardcoded font. 2) updates the .def files with one additional entry 3) adds an autotest which verifies that lastResortFamily() does return a non-empty string. In the firt place, that autotest makes sure that lastResortFamily() is implemented and exported, so that something like this issue will not go unnoticed in the next Qt port. Task-number: QTBUG-6921 Reviewed-by: Eskil
* Fix text direction setting in QTextBlock layoutJiang Jiang2010-09-231-6/+0
| | | | | | | | QTextControl should no longer inherit the layout direction of parent widget as its default text direction. Reviewed-by: Eskil Abrahamsen Blomfeldt Reviewed-by: Lars Knoll
* remove extra includesRitt Konstantin2010-09-212-2/+0
|
* Make QStaticText honor QPainter::pen() for rich text on X11 w/rasterEskil Abrahamsen Blomfeldt2010-09-201-1/+4
| | | | | | | | | | | The document layou will call setPen() with the PaintContext's text color. If this is different from the current painter settings, the pen will be passed on to the paint engine. The result was that, on X11 using the raster (or opengl) engine, QStaticText would record the pen as changed even when it hadn't explicitly been changed by the document. Task-number: QTBUG-13740 Reviewed-by: Samuel
* Doc: Listed undoable operations in QTextDocumentGeir Vattekar2010-09-151-1/+12
| | | | | Task-number: QT-1212 Reviewed-by: David Boddie
* Merge branch '4.7-upstream' into 4.7-docA-Team2010-09-131-2/+2
|\
| * Linux: Fix mispositioned, misclipped glyphs in large fonts (QStaticText)Eskil Abrahamsen Blomfeldt2010-09-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | While drawText() will use the path fallback for large fonts, and never hit this problem, QStaticText will draw the large fonts into the glyph cache. This broke when the freetype (or any other font engine) falls back to the generic implementation of alphaMapForGlyph() which uses path drawing. The problem was that alphaMapForGlyph() is not supposed to contain the bearing of the glyph, only the actual pixels. Since QFontEngine did not honor this contract, we would sample the wrong area in the glyph cache to get the glyph image. Task-number: QTBUG-12540 Reviewed-by: Gunnar
* | Merge branch '4.7-upstream' into 4.7-docA-Team2010-09-102-2/+4
|\ \ | |/
| * Fix cache_cost initialization of QFontEngineMultiWinJiang Jiang2010-09-101-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Originally, QFontEngineMultiWin does not set its cache_cost according to the regular font engines it refers to, which makes cache management in QFontCache useless because cache_cost is always 0, and garbage collecting timerEvent can hardly be triggered. This patch solve part of the problem by using cache_cost of the first font engine for QFontEngineMultiWin. However, if a font engine is loaded by QFontEngineMulti::loadEngine, the cost is still not counted. Task-number: QTBUG-12562 Reviewed-by: Eskil Abrahamsen Blomfeldt
| * Fix crash when using unprintable chars in QStaticTextEskil Abrahamsen Blomfeldt2010-09-101-2/+1
| | | | | | | | | | | | | | | | | | The assumption that the output glyph array and input glyph array is of equal size is wrong when unprintable characters are used (and discarded in getGlyphPositions()) Task-number: QTBUG-12614 Reviewed-by: Jiang Jiang
* | Merge branch '4.7-upstream' into 4.7-docA-Team2010-09-094-73/+90
|\ \ | |/
| * Pulled code form initializeDb() out into addFontToScreenDevice()Alessandro Portale2010-09-081-52/+53
| | | | | | | | | | | | Preparations for Application font support on Symbian Task-Number: QTBUG-6611
| * Moved font list getter to qfontdatabase_s60.cpp. Reusable.Alessandro Portale2010-09-082-9/+19
| | | | | | | | | | | | Preparations for Application font support on Symbian Task-Number: QTBUG-6611
| * Pulled some code from One long function into a short oneAlessandro Portale2010-09-081-5/+11
| | | | | | | | | | | | Preparations for Application font support on Symbian Task-Number: QTBUG-6611
| * Merge remote branch 'origin/4.6' into qt-4.7-from-4.6Thiago Macieira2010-09-072-7/+7
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/Makefile.win32 src/corelib/io/qfsfileengine_win.cpp src/corelib/kernel/qeventdispatcher_win.cpp src/gui/dialogs/qfiledialog_win.cpp src/gui/inputmethod/qcoefepinputcontext_s60.cpp src/gui/text/qfontdatabase_win.cpp src/gui/util/qsystemtrayicon_win.cpp src/script/utils/qscriptdate.cpp tests/auto/qinputcontext/tst_qinputcontext.cpp tests/auto/qscriptengine/tst_qscriptengine.cpp
| | * Ensure that we load system libraries from the correct location.Jan-Arve Sæther2010-09-032-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was a security hole that has been there for a while, but the public awareness have recently rised so the threat is more imminent now. The solution is to fix all places where we dynamically load system libraries. More specifically, we now load all system libraries with an absolute path that points to a library in the system directory (usually c:\windows\system32). We therefore introduce a small class named QSystemLibrary that only loads libraries located in the system path. This shares some of the API with QLibrary (in order to make the patch as small as possible). We don't fix QLibrary due to risk of regressions. In addition, applications can fix the code that calls QLibrary themselves. The problem does not apply to Windows CE, since the search order is documented as not searching in the current directory. However, it touches some CE-specific code - therefore QSystemLibrary is sometimes used on WinCE (however, it will just do a normal LoadLibrary() since its safe anyway). This change does not affect the testability plugin (it is not clearly documented where that plugin is located, and the plugin should never be used in production code anyway) Loading OpenSSL libraries The ssl libraries are handled specially, and searched in this order (we cannot expect them to always be in the system folder): 1. Application path 2. System libraries path 3. Trying all paths inside the PATH environment variable Task-number: QT-3825 Reviewed-by: Thiago Macieira Reviewed-by: Peter Hartmann
* | | Merge branch '4.7-oslo1' into 4.7-docA-Team2010-09-072-3/+7
|\ \ \ | |/ /
| * | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into ↵Qt Continuous Integration System2010-09-031-0/+4
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (25 commits) Recognize @, #, $ and ` as word separators rebuild configure.exe Fix dependencies so JOM will handle parallellization properly Symbian: Disable IPv6 for now Doc: Fixed namespaced Qt build breakage in the model/view tutorial. Doc: Fixing links on index page and corecting HTML in the template. Accept empty authority segments in QUrl as different from not-present Doc: Adds line about non-support for Webkit on Solaris protect nil dictionary from release. Fix potential KERN-EXEC 0 on Symbian. Ukrainian translation updated Fix remote crash in delivering D-Bus calls with too few arguments Ensure that OpenGL contexts are attached to an NSView before first paint Doc: Updating the 3rd party lib used in Qt - including JQuery Doc: Changed the default URL to avoid a Flash plugin crash on x86-64. Reduce memory consumption of QtScript/JSC on Symbian Doc: Updated Supported Platforms page. Finished New binary of configure.exe with -mp/-no-mp option Turn Makefile.win32 into batch-mode, enable /MP and PCH Add option to enable -MP compile option for MSVC ...
| | * | Recognize @, #, $ and ` as word separatorsThorbjørn Lindeijer2010-09-031-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The behavior of Qt with these characters was different than other toolkits, which annoys some people. Task-number: QTCREATORBUG-2241 Reviewed-by: mae
| * | | Fix QStaticText copy constructor to also copy text option propertyEskil Abrahamsen Blomfeldt2010-09-031-3/+3
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | The text option property of QStaticText was not copied in the copy constructor, so when the text was detached, the property would be reset to the default. Task-number: QTBUG-13368 Reviewed-by: Gunnar
* | | Merge commit 'staging-1/4.7' into doc-4.7Morten Engvoldsen2010-09-037-19/+51
|\ \ \ | |/ /
| * | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public into ↵Qt Continuous Integration System2010-09-021-8/+28
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public: Symbian: return better default font for SansSerif style hint Removing a left over #if 1..#endif construct Fixed a few warnings. Fixed a bug where passwords would not be committed when confirming.
| | * | Symbian: return better default font for SansSerif style hintAlessandro Portale2010-09-021-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The latest QtWebkit will use QFont::defaultFamily() with style hints to ask for the appropriate default fonts on a system. This patch makes sure thath "Nokia Sans S60" and "Series 60 Sans" are prioritized for QFont::SansSerif, if they are present. Task-Number: QTBUG-12611
| | * | Removing a left over #if 1..#endif constructAlessandro Portale2010-09-021-8/+1
| | | |
| * | | Fix broken S60 buildJiang Jiang2010-09-022-1/+7
| | | | | | | | | | | | | | | | Reviewed-by: Liang Qi
| * | | Keep mirrored char handling consistent between some font enginesJiang Jiang2010-09-023-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mirrored character subsitution should be used in right-to-left text direction unless the font is a symbol font. This patch will keep this behavior consistent between FreeType, QPF and S60 font engines. For Mac font engines, the shaping process is delegated to Core Text or ATSUI, so we don't do mirrored char handling by ourselves. Task-number: QTBUG-3852 Reviewed-by: Lars Knoll