summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontengine.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Better handling of invalid font tablesHEAD4.8Eskil Abrahamsen Blomfeldt2015-10-231-51/+161
| | | | | | | | | | | | | | | Specifically when reading files with broken cmap tables, we could get some undeterministic results. We handle this more gracefully by verifying that the offsets are sane and bailing out early if not. This replaces the current pattern throughout the font engine for consistency. This is a back-port of 4a1e5dbade4bab55f39bd368480dcca9a11e4b38 from Qt 5. Change-Id: If4172b9ef0808801c8e27ffaad962535afe572ed Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Update copyright headersAkseli Salovaara2015-03-311-13/+13
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I7e3e96183e073877b46bc8071b2ccae19e69426b Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
* Memory and file descriptor leak in QFontCacheSimon Yuan2014-05-141-5/+2
| | | | | | | | | | | | Make the cache also use the ref counts Make everyone who decrements a ref count check for 0 and delete Move all cache logic to the cache Same idea as 36cb3f3 and b3dae68 in Qt 5 without the extra stuff Task-number: QTBUG-38035 Change-Id: I27bea376f4ec0888463b4ec3ed1a6bef00d041f8 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Updated year in copyright headerKai Koehne2014-03-261-1/+1
| | | | | | | | | | | | | | | | | | find . -path '*/3rdparty/*' -prune -o -type f -print | xargs -L1 sed -i -E 's/Copyright(.*) 2013 Digia/Copyright\1 2014 Digia/g' Manually patched files: demos/spectrum/3rdparty/fftreal/fftreal_wrapper.h demos/spectrum/3rdparty/fftreal/fftreal_wrapper.cpp src/3rdparty/s60/eiksoftkeyimage.h tools/qdoc3/test/qt-project.qdocconf tests/auto/qsharedpointer/nontracked.h tests/auto/qsharedpointer/nontracked.cpp Change-Id: I3f9074923b4d6bd4666258ab04f01476cc6e901c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Sergio Ahumada <sahumada@blackberry.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-131-1/+1
| | | | | | Change-Id: I52bf8ef0447b701b4ebf7d7d240013a72adb9425 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-291-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: I280c0a575987d1770e354b4948f1d4d767d711ea Reviewed-by: Simo Fält <simo.falt@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Update contact information in license headers.Sergio Ahumada2012-08-011-2/+2
| | | | | | | | | | | | | - Replace Nokia contact email address with Qt Project website. - Remove "All rights reserved" line from license headers. As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: Ie7ba62011752fcb149b99b26317c54f2a0cfa931 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Fix for Thai characters with a below markMarko Kenttala2012-02-281-3/+9
| | | | | | | | | | | Some Thai characters with a mark below got drawn under fonts descent causing them to be clipped in some situations. Added checking for this and use of lower offset if needed. Task-Number: ou1cimx1#979179 Change-Id: If9fb643d4dee24342215a637c805d52b78584333 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Update year in Nokia copyright messages.Jason McDonald2012-01-111-1/+1
| | | | | | | | | Simple search and replace. This commit doesn't touch 3rd-party files, nor translations (where the change is not so simple and will be handled in a separate commit). Change-Id: I4e48513b8078a44a8cd272326685b25338890148 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Converting from double to qreal in guimread2011-10-101-2/+2
| | | | | | | | | | | | | | | | | | There were a number of places in QtGui where doubles were used in expressions due to the use of floating point constants in the code. Many of these constants are now constructed as qreal, removing the use of double operations where unneeded. These changes have been limited to constants that have exactly the same value whether double or float, to ensure that precision errors are not introduced. This should not affect any of the desktop platforms where qreal is double. On Symbian, where qreal is float, appropriate autotests have been run. Task-number: QTBUG-4894 Reviewed-by: Sami Merila
* Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging into ↵Qt Continuous Integration System2011-09-111-0/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | master-integration * 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging: Disable autotest broken by the change to QCache in 7ab0bed Generate glyphs in un-transformed coordinate system. Use QT_MAX_CACHED_GLYPH_SIZE in QFontEngineFT Reset trailingSpaces in relayout Prevent QPixmapCache potentially growing indefinitely. Allocate 16-byte aligned memory independent of platform for raster pool. Fix trailing spaces problem by not adding it to QScriptLine.length Fix RTL layout for fonts when non-printable character has an advance Fix regression in tst_qrawfont Make it compile on mac Fixed compiling error in qvfb. micro optimizations fix "comparison between signed and unsigned" warnings on windows, don't resolve the gdi32's symbols for each QRawFont instance fix typo in the docs QRawFont: add missed operator != optimize QGlyphRun's operator == a bit QGlyphRun: make operator != inlined QGlyphRun: don't detach if the decoration wasn't actually changed QPA event loop: Set a timeout != 0 if there are no timers.
| * Fix RTL layout for fonts when non-printable character has an advanceJohn Tapsell2011-09-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | If a non-printable character has an advance, we would lay out the text as if the character was part of the output, and then ignore the character later when the text was rendered. To fix cases such as this, we take the dontPrint attribute into consideration when adjusting the advances. Task-number: QTBUG-21347 Reviewed-by: Eskil Reviewed-by: Lars
* | Replace explicit surrogate handlers by inline methods of QChar classsuzuki toshiya2011-09-071-2/+1
|/ | | | | Merge-request: 1284 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Update licenseheader text in source files for qt4.8Jyri Tahtela2011-05-131-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Long live QRawFont!Eskil Abrahamsen Blomfeldt2011-04-191-18/+0
| | | | | | | | | | | | | | The QGlyphs API was initially attempted with a bastardization of QFont which was meant to encapsulate a single, physical font instance (a QFontEngine) where a set of glyph indexes would make sense. This is not how QFont was intended to be used, and it caused several issues. At the same time, the requirement for loading a font from ttf/otf data and be able to access it and use it without polluting the rest of the process with the font arose. To support these two APIs we introduce QRawFont, which is an abstraction on top of a single physical font. Done-with: Jiang Jiang
* Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2011-01-171-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/webkit/imageanalyzer/imageanalyzer.h examples/webkit/imageanalyzer/mainwindow.h mkspecs/unsupported/qws/linux-x86-openkode-g++/qplatformdefs.h src/corelib/io/qfsfileengine_iterator_unix.cpp src/corelib/io/qfsfileengine_iterator_win.cpp src/corelib/kernel/qcoreapplication.cpp src/network/access/qnetworkaccessdatabackend.cpp src/plugins/bearer/connman/qconnmanservice_linux.cpp src/plugins/platforms/openvglite/qwindowsurface_vglite.h src/s60installs/bwins/QtCoreu.def src/s60installs/eabi/QtCoreu.def src/s60installs/s60installs.pro tools/assistant/tools/assistant/helpviewer_qwv.h tools/qdoc3/test/qt-html-templates.qdocconf
| * Update copyright year to 2011.Jason McDonald2011-01-111-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | Fix for font engines that don't support subpixel positioningJiang Jiang2010-11-111-3/+17
| | | | | | | | Reviewed-by: aavit
* | Support glyph subpixel positioning without subpixel renderingJiang Jiang2010-11-101-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | Previously subpixel positioning was only used when subpixel rendering is enabled (glyphType == Raster_RGBMask), however, it does not necessarily require that and for Mac OS X it will keep using subpixel positioning even when LCD font smoothing (subpixel rendering) is turned off. To maintain consistency when switching to raster, we should support subpixel positioning in this case. Task-number: QTBUG-5053 Reviewed-by: Jørgen Lind
* | Merge remote branch 'qt/master' into lighthouse-masterPaul Olav Tvete2010-10-051-6/+18
|\ \ | | | | | | | | | | | | Conflicts: src/gui/painting/qpdf.cpp
| * | Merge remote branch 'origin/4.7' into master-from-4.7Rohan McGovern2010-10-051-6/+18
| |\|
| | * Moving QPdf::stripSpecialCharacter to fontengineJørgen Lind2010-09-301-6/+18
| | | | | | | | | | | | | | | | | | | | | 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>
* | | Merge branch 'master' of scm.dev.nokia.troll.no:qt/qtGunnar Sletta2010-09-271-4/+4
|\| | | | | | | | | | | | | | | | | Conflicts: configure src/corelib/global/qglobal.h
| * | Merge remote branch 'origin/4.7' into qt-master-from-4.7Thiago Macieira2010-09-211-3/+3
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qobject.h src/declarative/graphicsitems/qdeclarativeflickable.cpp src/declarative/graphicsitems/qdeclarativeflickable_p_p.h src/declarative/util/qdeclarativelistmodel.cpp
| | * Merge branch '4.7-upstream' into 4.7-docA-Team2010-09-141-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 commit 'staging-1/4.7' into doc-4.7Morten Engvoldsen2010-09-031-2/+2
| | |\|
| | * | Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/qt-doc-team into doc-4.7Morten Engvoldsen2010-09-021-1/+1
| | |\ \
| | | * | Fixed spelling, broken links, and missing default values.Jerome Pasion2010-08-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Tasks: QTBUG-13271, QTBUG-13212, QTBUG-12321 Reviewer: David Boddie
| * | | | Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2010-09-111-1/+1
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | master-integration * 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Fix typos. Fix typo in declative example. test for gdb version before runnning dwarf indexing Fix Core Text font loading for certain Mac Fonts Support sub pixel positioning of glyphs in raster engine Added basic tests for threaded QPainter drawing onto FBOs and PBOs.
| | * | | | Support sub pixel positioning of glyphs in raster engineEskil Abrahamsen Blomfeldt2010-09-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the raster engine to provide the same quality of text rendering as the native engine on Mac Cocoa, we need to support rendering to different sub pixel positions for each glyph. The number of subpixel positions is arbitrary and has to be detected, but it's usually three or four. Each position will give slightly different coverages inside the pixel and thus different rasterizations. Other font engines which support sub pixel positioning of glyphs can provide the same functionality by implementing supportsSubPixelPositions() to return true, and then adding the subPixelPosition argument to the x coordinate used in alphaRGBMapForGlyph(). Task-number: QTBUG-5053 Reviewed-by: Jiang Jiang
* | | | | | Merge remote branch 'lighthouse/4.7' into lighthouse-masterPaul Olav Tvete2010-09-131-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/text/text.pri src/plugins/generic/linuxinput/qlinuxinput.cpp
| * \ \ \ \ \ Merge branch 'qt-4.7' into lighthouse-4.7Paul Olav Tvete2010-09-131-2/+14
| |\ \ \ \ \ \ | | | |_|_|_|/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/corelib/tools/qsimd.cpp
| * | | | | | Initial pluggable fontdatabaseJørgen Lind2010-09-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QPlatformFontDatabase added. QPlatformIntegration now has a new virtual function: QPlatformDatabase::fontDatabase() const. Most unix platform plugins wants to follow the pattern implemented in directfb, linuxfb, vnc etc. In the pro file do: include(../fontdatabases/genericunix/genericunix.pri) In the QPlatformIntegration class do: and instansiate a QGenericFontDatabase in the constructor and return it in the getter function.
* | | | | | | Merge remote branch 'qt/master' into lighthouse-masterPaul Olav Tvete2010-09-131-2/+14
|\ \ \ \ \ \ \ | | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/corelib/global/qglobal.h src/corelib/tools/qsimd.cpp
| * | | | | | Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2010-09-101-2/+2
| |\ \ \ \ \ \ | | | |/ / / / | | |/| / / / | | |_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bin/syncqt demos/declarative/snake/content/snake.js demos/declarative/snake/snake.qml doc/src/development/qmake-manual.qdoc src/corelib/plugin/plugin.pri src/gui/kernel/qapplication_win.cpp src/gui/kernel/qdesktopwidget_win.cpp src/gui/painting/qdrawhelper.cpp tests/auto/qdir/tst_qdir.cpp tools/qdoc3/test/assistant.qdocconf tools/qdoc3/test/designer.qdocconf tools/qdoc3/test/linguist.qdocconf
| | * | | | Fix symbol font detection in generic CMap decodingJiang Jiang2010-09-021-2/+2
| | | |/ / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For fonts that have an AppleRoman name table, *isSymbolFont failed to return correct value even if they have a symbol table. This patch corrected this behavior by using symbolTable variable to detect that instead of checking if score == Symbol. Also prefer symbol table over AppleRoman table to make generic CMap decoding consistent with QFontEngineFT (which will use the symbol table whenever its available). Task-number: QTBUG-3852 Reviewed-by: Lars Knoll
| * | | | Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2010-08-301-0/+12
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/win32/msbuild_objectmodel.cpp qmake/generators/win32/msvc_vcxproj.cpp tests/auto/qnetworkreply/tst_qnetworkreply.cpp
| | * | | Correct last right bearing in boundingBox(glyphs)Jiang Jiang2010-08-271-0/+12
| | | |/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 07880542ecc479807c23c5646d263135240822ff introduced regression to QFontMetrics::boundingRect and QTextEngine::boundingBox on FT, XLFD and QPF font engine. Because on these platforms, rightBearing of the last glyphs is already removed from the width returned in glyph_metrics_t. Subtracting that rightBearing twice will cause the resulting boundingBox smaller than expected. This patch fix this by removing last right bearing accounting code from generic QTextEngine::boundingBox, instead, we put it into font engines that need them: QFontEngineWin, QCoreTextFontEngine, QFontEngineMac, QFontEngineS60 and QFontEngineQWS. So that the resulting width should be correct on all platforms without introducing any performance penalties. Task-number: QTBUG-6854, QTBUG-12950 Reviewed-by: Eskil
* | | | Merge remote branch 'remotes/lighthouse/4.7' into lighthouse-masterPaul Olav Tvete2010-07-191-2/+2
|\ \ \ \ | |/ / / |/| | / | | |/ | |/| Conflicts: src/opengl/qgl_p.h
| * | Say hello to Q_WS_QPA!Jørgen Lind2010-06-241-2/+2
| | | | | | | | | | | | Rename Q_WS_LITE -> Q_WS_QPA
| * | Merge remote branch 'origin/4.7' into lighthouseJørgen Lind2010-04-211-0/+15
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/gui/kernel/qapplication.cpp src/gui/painting/qbackingstore.cpp src/opengl/qgl.cpp src/opengl/qgl_p.h src/plugins/plugins.pro tests/auto/declarative/qdeclarativedom/data/importlib/sublib/qmldir tools/tools.pro
| * | Merge remote branch 'qt/4.7' into lighthouse-4.7Paul Olav Tvete2010-03-011-3/+7
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/gui/egl/qegl.cpp src/gui/kernel/qdnd_p.h
| * \ \ Merge remote branch 'remotes/qt/4.6' into lighthousePaul Olav Tvete2010-02-101-3/+0
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure tests/auto/qwidget/tst_qwidget.cpp
| * \ \ \ Merge remote branch 'origin/4.6' into lighthousePaul Olav Tvete2010-01-141-104/+20
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/corelib/global/qglobal.cpp src/gui/dialogs/dialogs.pri
| * \ \ \ \ Merge branch '4.6' into lighthousePaul Olav Tvete2009-10-141-1/+1
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qapplication.cpp src/gui/kernel/qwidget.cpp
| * \ \ \ \ \ Merge branch '4.6' into lighthousePaul Olav Tvete2009-09-301-18/+67
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/gui/image/qpixmapdatafactory.cpp src/gui/kernel/qapplication_p.h src/gui/painting/qgraphicssystem.cpp
| * | | | | | | Please welcome the Lighthouse Research Project!Paul Olav Tvete2009-09-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lighthouse is a lighter, nimbler version of Qt/Embedded, which does not contain a window system. Instead, it uses graphics system plugins to provide the necessary functionality or interface with existing window systems. The first version was written by Rhys. Squashed commit.
* | | | | | | | Make QFontEngineGlyphCache explicitly sharedEskil Abrahamsen Blomfeldt2010-07-121-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QFontEngine will delete its glyph cache (and if it's a GL engine, its texture) when the font engine dies. The font engine can die when the QFontCache decides to clean it up, e.g. based on the trigger of a timer. To make it possible to use the glyph cache elsewhere, without interference by the font cache, it has been made explicitly shared. Reviewed-by: Kim
* | | | | | | | New class: QGlyphsEskil Abrahamsen Blomfeldt2010-06-041-0/+18
| |_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce an API to access glyph indexes in a font directly. A bug was discovered during this work, where different hinting flags in loadGlyph() and loadGlyphMetrics() would make the metrics in the two functions different, thus causing drawCachedGlyphs() (which uses loadGlyphMetrics() indirectly) to use different metrics than the standard drawTextItem() code path (which uses loadGlyph()). The bug was visible in the tst_QGlyphs::drawExistingGlyphs() test. Reviewed-by: Simon Hausmann