summaryrefslogtreecommitdiffstats
path: root/src/gui/text
Commit message (Collapse)AuthorAgeFilesLines
* Streamline font match() function.Friedemann Kleint2013-11-281-10/+6
| | | | | | | Determine writing system before executing the loop. Change-Id: I6c462bdef4d70860e76c7cc9d939e3e92983b173 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Remove unused variable in font match() function.Friedemann Kleint2013-11-281-3/+0
| | | | | Change-Id: I0752901556a44c3b7fb4440e3ba0ca88559c1fe2 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Merge "Merge remote-tracking branch 'origin/release' into stable" into ↵Frederik Gladhorn2013-11-283-5/+1
|\ | | | | | | refs/staging/stable
| * Merge remote-tracking branch 'origin/release' into stableSimon Hausmann2013-11-283-5/+1
| |\ | | | | | | | | | Change-Id: I860404a1ef18c88a968a9eded405bb67967047b9
| | * Revert "Store the font's scalability in QFontEngine."Yoann Lopes2013-11-273-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 65b12fbdb13d34c61bcadd5cc8fd6ee28a8dfafd. QFontEngine is not always loaded from QFontDatabase, resulting in the flag not being set. Change-Id: I39bc5bd4a8dea153d191cfc55f4324195f75f64c Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | | Fix font lookup.Friedemann Kleint2013-11-282-16/+29
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | Change match() to return an index and use that to reintroduce the blacklist bookkeeping for fonts for which font engine creation fails (for example, due to missing open type support). Change the algorithm to retry search if that happens. Add empty string as fallback for non-common scripts indicating 'try to find any font matching the script' as is done in Qt 4. Task-number: QTBUG-34908 Change-Id: I9ac81ff1c275ebb635675dc26b52394789fca60c Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | src/gui/text: whitespace fixesJ-P Nurmi2013-11-267-122/+122
| | | | | | | | | | Change-Id: Idd0e0673d76a23593b03558e18bc6afbdb9b38ab Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* | Cleanup freetype data in a thread-safe wayRobin Burchell2013-11-204-15/+45
|/ | | | | | | | | | | | | | | One less obvious part of this patch: the fontCache pointer in engineData was not safe. It isn't safe to rely on pointer addresses to verify we're cleaning up the right thing, as a sequence of malloc()/free()/malloc() can return the same pointer, and nothing was cleaning up the dangling pointer in engineData. With this, it is possible to safely drop OpenGL contexts in QtQuick under all conditions with no possibility of crashes. Done-with: Aaron Kennedy <aaron.kennedy@jollamobile.com> Change-Id: I7b91384251593730124323a74737d41333a05f59 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Request the glyph at the right subpixel offsetGunnar Sletta2013-11-101-1/+1
| | | | | Change-Id: Iace18740565862f1c66e2d654a1a2e7bc1a16fc7 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Revert "Use Qt's own glyph cache with the freetype engine."Gunnar Sletta2013-11-061-1/+2
| | | | | | | | | | | This reverts commit 8c58640fdfe5d182cd8ab9ad0598c54c0487eb7c. The intent was to reduce the maintenance of parallel code paths, but this had a negative impact on performance so we need to enable it again. Change-Id: Ic58f7781ff076055e7c48f20fc0e7a8a2c9e51a4 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Revert "Ensure CSS rules are inherited from the parent tags"Andy Shaw2013-11-051-5/+1
| | | | | | | | | | | Since the original change caused a problem with the CSS rules being always inherited where in some cases this should not be happening. This reverts commit 6f6546613774a48fe12f13f796ed7115dfe49a27. Change-Id: I6e9cf163d752b1869b5e967a7ab59963d655ba87 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Doc: Fix broken linksSze Howe Koh2013-11-051-1/+1
| | | | | | | | Task-number: QTBUG-33360 Change-Id: Ic944cb2f575c35ebad64852ef5fc44a50ac03571 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Store the font's scalability in QFontEngine.Yoann Lopes2013-10-313-1/+5
| | | | | | | | | This is an enabler to fallback to native font rendering when using a bitmap font in Qt Quick. Task-number: QTBUG-32737 Change-Id: I6d841dd5ef54d78a00f7fab9d80e9c95ff7f7b98 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Fix finding cursor position in words with accentsJoshua Grauman2013-10-301-3/+3
| | | | | | | | | | | | | | In positionInLigature() we were mixing indexes into the script item with indexes into the entire string. The getClusterLength() function would expect an attributes array for the current script item and it thus needs to be adjusted by si->position. In addition, when looking for the next grapheme boundary, we were comparing pos (which indexed the string) with end (which indexed the script item). This has also now been fixed by adjusting for si->position as well. Task-number: QTBUG-30123 Change-Id: Id02e2eddcc5b7888eacb34bd1e39cc6911880ca1 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* remove some vestiges of QFontEngineQPFOswald Buddenhagen2013-10-282-67/+0
| | | | | | | | | | amends d7e424ee66. Change-Id: I9aaef14f8ecba78685ce5f7e908a0b42e554434f Reviewed-by: thiago Reviewed-by: paulot Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix misaligned selection region with text when centeredJonathan Liu2013-10-231-5/+14
| | | | | | | | | | | | | If the text is centered, the x/y position in the selection QRectF may be a multiple of 0.5 which is rounded up. This rounding causes misalignment of the selection region with the text. The alignment is fixed by using qFloor on the x and y components. Task-number: QTBUG-34218 Task-number: QTBUG-34234 Change-Id: I4f2fadeb38602f62a93773c6e5faecf03b28069f Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* QTextHtmlParser: restore the default link color from app paletteJ-P Nurmi2013-10-231-2/+2
| | | | | | | | | | The default link color used to be resolved to the link color of the application palette, but got lost during the Qt 5 modularization (see commits 7351a43 and 3f9a7f9). Task-number: QTBUG-28998 Change-Id: I7f07427f6c03f83c557100938ad9f7a39349d303 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Make it possible to clear glyph caches from the font engine.Gunnar Sletta2013-10-182-0/+11
| | | | | Change-Id: Iea62bc1727269ed3893d8b4dbcefa583f1b85d7f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Restore handling of bullets for lists with a font size of > 36 pixelsAndy Shaw2013-10-161-13/+0
| | | | | | | | | | | | | | This patch partially reverts ad443dfb1d8e9096c4913686aa2ed0bc9b3f5de7, the test that was added is still there as it can be used to compare against Chrome and to check that indenting works correctly. The original behavior of clipping the bullets is correct because the specified indent is where the text itself should be positioned, the bullet uses the available space to the side of it. This is how other web browsers handle the same situation. Change-Id: I63440e037d8efec356459c09228ef4817ccb9cb6 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Doc: Fix typos and add missing words.Marcel Krems2013-10-121-2/+2
| | | | | Change-Id: I40e4780bcabbca29425945a69d8a0781cd5c0e9f Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Export the block's line-height settings to htmlAndy Shaw2013-10-121-0/+23
| | | | | | | | Task-number: QTBUG-28404 Change-Id: I87e03ecd981c302a5aefdadf7bcfd9729e37bd13 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Re-add deprecated symbol for ABI compatibility with Qt 5.1.Harri Porten2013-10-112-1/+7
| | | | | | | | | | | When b0b786a2f05e9451a65519ab8904f55c35f51b7d deprecated QFontDatabase::supportsThreadedFontRendering() it made the function inline also. That way compilers like gcc did not export the symbol anymore. Change-Id: If9c343eaa2ff90540decbc19b0af33d439c0bbaa Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Use QAtomicInt ref/deref patternAllan Sandfeld Jensen2013-10-111-1/+2
| | | | | | | Change check of QAtomicInt::load with the preferred ref() deref() pattern. Change-Id: I12d2e24812259c16623c8a59cac30cafa4b05565 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Memory leak with Small-caps QRawFontAllan Sandfeld Jensen2013-10-111-0/+4
| | | | | | | | | | | | | | | Make sure we deallocate the scaled rawfont, when it is not used due to a cached engine being used instead. This fixes a major memory leak in Qt WebKit when using Small Caps in the complex font path. The complex font path is always used for small caps since Qt 5.1. Task-number: QTBUG-33576 Change-Id: I500db9ae6f6576734f1a972387a1a488218a9db6 Reviewed-by: pierre.rossi@digia.com Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Ensure CSS rules are inherited from the parent tagsAndy Shaw2013-10-111-1/+5
| | | | | | | | | | | | | | | | When CSS was set in the head tag then it was not being inherited by the child tags. This ensures that the inhertiance happens and that the deeper the CSS is set then it will ensure that it has precedence over the ones set on the parent. A test is added that shows the standard inheritance from the head tag and the precedence from child tags in effect too. Task-number: QTBUG-28770 Change-Id: I30be3ec141b2cd8d6e0db8a92669aed34da93b33 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix broken text layout with ShowLineAndParagraphSeparatorsEskil Abrahamsen Blomfeldt2013-10-091-0/+3
| | | | | | | | | | | | | | | Before we add the current cluster we need to check if there's space for it. Calling checkFullOtherwiseExtend() also has the side effect of resetting the space data. We would add the cluster without checking for space when showing separators, causing broken behavior like we would count the space in the current item as trailing space, which would make us chop the end of the string. Task-number: QTBUG-28832 Change-Id: I8169662218ff6e645575d4e89a57f6b234f3c4cb Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Doc: Adding mark-up to boolean default values.Jerome Pasion2013-10-0819-208/+208
| | | | | | | | | | | | | | | | | Default values should have mark-up to denote that they are code. This commit changes: -"property is true" to "property is \c true". -"Returns true" to "Returns \c true". -"property is false" to "property is \c false". -"returns true" to "returns \c true". -"returns false" to "returns \c false". src/3rdparty and non-documentation instances were ignored. Task-number: QTBUG-33360 Change-Id: Ie87eaa57af947caa1230602b61c5c46292a4cf4e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Correct the bit field sizes in QTextOptionThiago Macieira2013-10-012-1/+5
| | | | | | | | | There's an off-by-one error that has been carried over since at least Qt 4.0.0. Because of that, the class is actually 4 bytes bigger than calculated. Change-Id: Iaefdf657fdc780aae16390fde3c01074160e4cd9 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Doc: Add docs for rvalue references and move constructorsGeir Vattekar2013-09-272-0/+16
| | | | | | | | | These members were introduced in 4.8, but left undocumented. Because we consider undocumented API to be internal, the members are \since 5.2. Change-Id: I52e2840a8cfaa7f59f410b3e2a06c0942ea06539 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Fix WinCE/MSVC2008 build errors related to std::lower_bound patches.Sérgio Martins2013-09-253-0/+25
| | | | | | | See QTBUG-33473 for more information about this compiler bug. Change-Id: I13b945350fdc38165c1515f0cdd75a53cf37cd6c Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Remove some qBinaryFind usages from QtGuiGiuseppe D'Angelo2013-09-235-14/+23
| | | | | | | | This is done per the mailing list discussion at http://www.mail-archive.com/development@qt-project.org/msg01603.html Change-Id: Iecb921cd778571d24680254566e9aa8fc8d5edff Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* De-inline virtuals of some non-exported private classes in QtGuiThiago Macieira2013-09-232-2/+11
| | | | | | | | | | This is to work around a bug in GCC 4.7's link-time optimiser. Without it, linking QtOpenGL and QtPrintSupport fails because the compiler generates the code for the virtuals, including the virtual table, but not the methods. Change-Id: Idcecd51c32e6228e0eefe67f1bd630ea1f5d5da7 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Fix memory leaks in the FT font engineLaszlo Agocs2013-09-201-2/+18
| | | | | | | | | | | | | | The glyph returned by loadGlpyh() must be freed manually when caching is not enabled (that is, QT_USE_FT_CACHE is not set). This change and https://codereview.qt-project.org/#change,65672 together should stop QGLWidget::renderText() from leaking memory extensively. Task-number: QTBUG-32792 Change-Id: Iff7e1591a1ea994a97b6a56bc16c64bf544e6713 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Un-export qt_registerFont() internal functionKonstantin Ritt2013-09-162-10/+10
| | | | | | | QPlatformFontDatabase::registerFont() method must be used instead. Change-Id: I80aa5567a748a980f689c90125f8bcc20c304ee2 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix QTextEngine build on MSVC2008 debug mode.Nicolás Alvarez2013-09-151-0/+1
| | | | | | | | | | | This was broken in 7ac6ce21 which removed some unused functions; but MSVC2008 in debug mode requires this particular operator overload. I'm re-adding it in an appropriate #ifdef so it doesn't cause "unused" warnings in other platforms/compilers. Task-number: QTBUG-33473 Change-Id: I6dfba0fa5f835e848e8a1e4213efb030fb5def3d Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Fix build with -WerrorKonstantin Ritt2013-09-141-1/+1
| | | | | | | | | The actual warning is: src/gui/text/qharfbuzzng.cpp:589:67: error: cast from ‘void*’ \ to ‘uint {aka unsigned int}’ loses precision [-fpermissive] Change-Id: I75cc7bad2147cd5e5e7c17bc22fe613280e86755 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge "Merge branch 'stable' into dev" into refs/staging/devSergio Ahumada2013-09-141-6/+0
|\
| * Merge branch 'stable' into devSergio Ahumada2013-09-131-6/+0
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: src/concurrent/qtconcurrentmedian.h src/corelib/itemmodels/qabstractitemmodel.cpp Change-Id: Iac46a90bbb2958cef7670031a4b59c3becd8538a
| | * Removed unused distance field functions.Yoann Lopes2013-09-091-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | They are not needed anymore since 5971e091 and 184e27c0 have been integrated. Change-Id: Id611f1432a010f3c2af86951e1c79cb8fc73f9e4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* | | Remove unused QPF font engine support.Thiago Macieira2013-09-132-1501/+0
|/ / | | | | | | | | | | | | | | | | QWS is gone. Change-Id: Ic04c4dcfff51522dd538bf2cb198dc2e02fe7572 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com> Reviewed-by: Peter Kümmel <syntheticpp@gmx.net>
* | Remove Q_PACKED from structures that do not need to be packedThiago Macieira2013-09-132-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These structures do not need to be packed. With some compilers, Q_PACKED was defined to be empty, which means that the code was working fine without packing. Or there were some lingering problems on those platforms (MSVC) and we're now exposing them in all platforms. Actually, it shouldn't be a problem anywhere. QCharAttributes, quint24 and QFontEngineQPA::Glyph have only char/uchar members, so they're packed already (they have alignof == 1). The only platform where that wasn't true was ARM OABI, which we don't support anymore. QFontEngineQPA::Header seems to always come from a QByteArray, so it doesn't neeed to be packed either. However, just to be sure, I'm inserting a check for alignment. And QFontEngineQPA::Block isn't used anywhere. Change-Id: Iacfa25edf336ef2a03aeb6e40ae90937a21661ae Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* | Decrease code duplication in QFontDatabase-sKonstantin Ritt2013-09-131-0/+8
| | | | | | | | | | | | | | | | Move scriptRequiresOpenType() body right into QFontEngine::supportsScript(), thus centralizing use of this performance cheat. Change-Id: I5f494b086f8f900b631c491f41e9cb800002c0f6 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Implement QFontEngine::harfbuzzFont/Face() with HarfBuzz-NGKonstantin Ritt2013-09-131-2/+2
| | | | | | | | | | Change-Id: I5d4fed66d66e8aa650fe181e61dcc2345f0f907a Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Deprecate QFontDatabase::supportsThreadedFontRendering()Konstantin Ritt2013-09-103-6/+6
| | | | | | | | | | | | | | | | As of 5.0, this always return true. Change-Id: If225c7219e283da97e870f0d66a87b21c3cacfc0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Use Qt's own glyph cache with the freetype engine.Gunnar Sletta2013-09-101-2/+1
| | | | | | | | | | | | | | | | | | | | This fixes rendering in the OpenGL paint engine, simplifies our internal code paths and also produces nicer text for non-90 rotated glyphs Change-Id: Ib206065cd486ac29067f9ebf4a0d74189a673f1e Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | Make QFontEngine not derive from QObjectKonstantin Ritt2013-09-103-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | Whilst having the objectName set for each engine is somewhat handy when debugging, deriving from QObject just for that is a wasting of memory in all other cases. This also broke the font engine abstraction by allowing qobject_cast() to access some private data; the only sane way to distinguish engines is querying their Type value. Change-Id: Ib1d195692859eb39089f6d8d9016cb8f9dcc0400 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | QFontEngineFT: Drop modularization leftoversKonstantin Ritt2013-09-091-4/+0
| | | | | | | | | | | | | | FontConfig is not used in GUI these days. Change-Id: I0bf89de912f2df9f6397b5452b642df19829af7f Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* | Add HarfBuzz-NG supportKonstantin Ritt2013-09-082-1/+178
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some features are of limited usefulness for now (same as with HB-old): * mixed scripts cases aren't handled correctly due to an outdated script and bidi itemization implementation; * language-by-script detection: the only fallback to locale's LANG is used Some features are missing entirely (in compare to HB-old): * justification points support: not implemented in HarfBuzz-NG Task-number: QTBUG-18980 Task-number: QTBUG-14590 Task-number: QTBUG-16128 Change-Id: Ic98a10054be5fac55224ef31c7261168c0bf8739 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Add HarfBuzz-to-Qt bridging codeKonstantin Ritt2013-09-084-0/+861
| | | | | | | | | | Change-Id: I2f61566fe69d18b80d5831238beb27b34b7be1c8 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | QTextEngine::shapeText(): Better error handling for corner casesKonstantin Ritt2013-09-081-4/+4
| | | | | | | | | | | | | | | | | | Use Q_UNREACHABLE() instead of silly return to catch shaping errors, which are fatal ones in fact, since the application would assert/crash some later due to a hard dependency on the shaping result. Change-Id: Ie58a2f2686a795f6178a588de6f2a2e37e1ed13c Reviewed-by: Lars Knoll <lars.knoll@digia.com>