summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontengine_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Better handling of invalid font tablesHEAD4.8Eskil Abrahamsen Blomfeldt2015-10-231-1/+1
| | | | | | | | | | | | | | | 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>
* 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>
* 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>
* Add support for rawFonts loaded from data in FaceIdPierre Rossi2011-08-151-1/+2
| | | | | | | | | | | | | The problem was that with an empty filename and index of 0, all raw fonts loaded from data had the same FaceId, and we wouldn't bother to load another one after doing this once. This commit introduces a uuid in FaceId to help distinguish them in that case. Change-Id: I93655ff07a7d8856af1f854024e207c519f8ed1a Reviewed-on: http://codereview.qt.nokia.com/1882 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jiang Jiang <jiang.jiang@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
* Make QtQuick2 compile on QPAEskil Abrahamsen Blomfeldt2011-04-271-0/+2
| | | | | | | | | | | Moved the logic to set pixel size into the font engines to avoid making the platform plugin interface too complex, and added a function in QPA to make an isolated font engine based on font data. Currently none of the QPA back-ends supports it, but it compiles and spits out a warning if you try to create a QRawFont from data there. This isn't used in QtQuick2 anyway. Reviewed-by: Jiang Jiang
* Long live QRawFont!Eskil Abrahamsen Blomfeldt2011-04-151-4/+1
| | | | | | | | | | | | | | 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
* Fix positioning in GL2 paint engine with subpixel antialiasingJiang Jiang2011-04-041-1/+1
| | | | | | | | | | | | In this case we will use QTextureGlyphCache with FreeType renderer, which requires the subpixel positition to get correct left bearings, thus alphaMapBoundingBox is extended to support subPixelPosition. In QFontEngineFT we also simplify the code a bit by reusing loadGlyphs for metrics calculation instead of duplicate code. Since we need to use the glyphs after all, cache them here in alphaMapBoundingBox shouldn't be a problem. Reviewed-by: Eskil
* Introduce QFontEngineDirectWriteEskil Abrahamsen Blomfeldt2011-03-141-0/+2
| | | | | | | | | | | | | | | | Make a font engine for subpixel positioned text on Windows Vista (with platform update) and Windows 7. If selected during configuration, the engine will be selected only when the hinting preference of a font is set to None or Vertical hinting. The font database uses most of the same logic but creates a direct write font based on the LOGFONT rather than a GDI handle. The engine is currently regarded as experimental, meaning that code using it should do substantial testing to make sure it covers their use cases. Task-number: QTBUG-12678 Reviewed-by: Jiang Jiang
* Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2011-01-171-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Doc: Fixing typoSergio Ahumada2011-01-071-1/+1
| |
* | Merge branch 'master' of scm.dev.nokia.troll.no:qt/qtGunnar Sletta2010-11-191-0/+2
|\ \ | | | | | | | | | | | | | | | Conflicts: src/gui/text/qfontengine_mac.mm src/gui/text/qfontengine_p.h
| * | Fix for font engines that don't support subpixel positioningJiang Jiang2010-11-111-1/+2
| | | | | | | | | | | | Reviewed-by: aavit
| * | Support glyph subpixel positioning without subpixel renderingJiang Jiang2010-11-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Moving QCoreTextFontEngine with related classes into own fileJørgen Lind2010-10-281-210/+0
|/ / | | | | | | | | | | The declaration of QCoreTextFontEngine was ifdefed in qfontengine_p.h. So was QMacFontEngine. I have moved them into their own files (qfontengine_coretext_p.h and qfontengine_mac_p.h).
* | Merge remote branch 'qt/master' into lighthouse-masterPaul Olav Tvete2010-10-261-1/+1
|\ \ | | | | | | | | | | | | Conflicts: src/opengl/qwindowsurface_gl.cpp
| * | Merge branch 4.7 into qt-master-from-4.7Qt Continuous Integration System2010-10-251-1/+1
| |\|
| | * Fixed many spelling errors.Rohan McGovern2010-10-251-1/+1
| | |
* | | Merge remote branch 'qt/master' into lighthouse-masterPaul Olav Tvete2010-10-221-0/+13
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qapplication_win.cpp src/gui/kernel/qwidget.cpp src/gui/text/qfontengine_ft.cpp
| * | Fix text position with OpenGL engine and FreetypeEskil Abrahamsen Blomfeldt2010-10-121-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you use the OpenGL engine, the left bearing of the glyph was incorrectly retrieved from the system as the glyph was queried with the wrong format, and adjustments for antialiasing were not applied. To make the position identical to painting with, new API was added to QFontEngine (The bounding box of a glyph is also not logically necessarily the same thing as the bounding box of the rasterized glyph.) Done-with: Trond Task-number: QTBUG-14410
* | | Merge remote branch 'qt/master' into lighthouse-masterPaul Olav Tvete2010-10-051-0/+2
|\| | | | | | | | | | | | | | Conflicts: src/gui/painting/qpdf.cpp
| * | Merge remote branch 'origin/4.7' into master-from-4.7Rohan McGovern2010-10-051-0/+2
| |\|
| | * Moving QPdf::stripSpecialCharacter to fontengineJørgen Lind2010-09-301-0/+2
| | | | | | | | | | | | | | | | | | | | | 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-6/+7
|\| | | | | | | | | | | | | | | | | Conflicts: configure src/corelib/global/qglobal.h
| * | Fix Core Text font loading for certain Mac FontsJiang Jiang2010-09-101-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Font names enumerated by Core Text cannot be found by ATSFontFamilyFindFromName because ATS is expecting native names instead of the names returned by Core Text. This patch get rid of ATS font matching code in Cocoa code path to simplify the code, avoid deprecation warnings (in the future) and fix this issue. Task-number: QTBUG-11145 Reviewed-by: Eskil
| * | Support sub pixel positioning of glyphs in raster engineEskil Abrahamsen Blomfeldt2010-09-091-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+1
| |\ \ \ | | | |/ | | |/| | | | | | | | | | | | | 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-0/+1
|\ \ \ \ | | |_|/ | |/| | | | | | | | | | | | | | | | | | 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-08-301-0/+1
| |\ \ \ | | | |/ | | |/| | | | | | | | | | | | | | | | | 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/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+1
|\ \ \ \ | |/ / / |/| | / | | |/ | |/| Conflicts: src/opengl/qgl_p.h
| * | Say hello to Q_WS_QPA!Jørgen Lind2010-06-241-1/+1
| | | | | | | | | | | | Rename Q_WS_LITE -> Q_WS_QPA
| * | Merge remote branch 'qt/4.7' into lighthousePaul Olav Tvete2010-06-181-1/+2
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure mkspecs/common/qws.conf src/corelib/io/qresource.cpp src/gui/image/qpixmapdata_p.h src/gui/kernel/qapplication.cpp src/gui/kernel/qapplication_p.h src/gui/painting/qpaintengine_raster.cpp src/gui/text/qfontdatabase.cpp src/opengl/qgl_p.h src/plugins/mediaservices/gstreamer/gstreamer.pro
| * | Merge remote branch 'origin/4.7' into lighthouseJørgen Lind2010-04-211-0/+3
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 'origin/4.6' into lighthousePaul Olav Tvete2010-01-141-9/+9
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/corelib/global/qglobal.cpp src/gui/dialogs/dialogs.pri
| * \ \ \ Merge remote branch 'origin/4.6' into lighthousePaul Olav Tvete2009-11-191-1/+2
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/plugins/graphicssystems/graphicssystems.pro
| * \ \ \ \ Merge branch '4.6' into lighthousePaul Olav Tvete2009-09-301-4/+4
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+8
| |_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | | Fix platform regression: Support QFont::setStretch() on CocoaEskil Abrahamsen Blomfeldt2010-05-191-1/+2
| |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QFont::setStretch() would previously have no effect on Mac OS X/Cocoa. Task-number: QTBUG-10585 Reviewed-by: Eskil Done-by: Andy
* | | | | Recommit 1ebeb971d3382aec0fff927Eskil Abrahamsen Blomfeldt2010-03-221-0/+3
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 725c2c29c192349016b1332824a7716bbb992f31 which reverted the original commit because of a test failure on qws. This recommit adds a test for whether the metrics from QFontEngine::boundingBox() are valid, which is required for the bearings to be calculated. This test was also in the original logic.
* | | | Update copyright year to 2010Jason McDonald2010-01-071-1/+1
| | | | | | | | | | | | | | | | Reviewed-by: Trust Me