summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontdatabase.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Fix regression in styleName searchingJiang Jiang2011-11-091-24/+9
| | | | | | | | | 1. Faked styles should have styleNames as well otherwise we couldn't find them. 2. With a QtFontFoundry mixed with style keys and style names, there is no way to sort them in a manner than binary search will work, we have to use linear search instead.
* Fix styleName listing with the same QtFontStyle::Key valueJiang Jiang2011-11-081-14/+17
| | | | | | | | | | | | | | We should store fonts with different style names but the same QtFontStyle::Key value (italic, weight and stretch) separately, so that fonts like Osaka (Regular, Regular-Mono) can be listed correctly. dd0205e0fbacf340508686cc136d70eda7bf664d introduced this regression when moving styleName out of Key. Without a styleName specified, we will do binary search and insertion for styles by comparing QtFontStyle::Key. We should do the same but comparing styleName instead when it's available. Reviewed-by: Eskil
* Fix localized font family access in OS XJiang Jiang2011-11-081-1/+1
| | | | | | | | | | | | | | | | | | | Font family names listed in QFontDatabase::families() should be localized names rather than their default (English) names, to be consistent with behaviors in other Mac apps and previous Qt/Mac based on ATS. It should also be possible to verify if a font exists with any family name, regardless it's localized or not. Say we have font "Hiragino Mincho Pro", which has a Japanese name called "ヒラギ ノ明朝 Pro", then db.hasFamily(QString::fromUtf8("ヒラギノ明朝 Pro")) should return true. Task-number: QTBUG-22372 Reviewed-by: Morten Sorvig
* 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
* Doc: Fixed qdoc warnings.David Boddie2011-08-151-4/+6
|
* Merge remote branch 'mainline/4.8'Jiang Jiang2011-07-221-1/+2
|\
| * namespace fixJoerg Bornemann2011-07-141-1/+2
| | | | | | | | Reviewed-by: hjk
* | Add a way to check if we have a matching family in the database.Pierre Rossi2011-07-211-0/+10
|/ | | | | | | | | | | | | | This is needed in order to get proper font fallback, and incidentally webfonts, working in QtWebKit. See: https://bugs.webkit.org/show_bug.cgi?id=55036 Internal for now, maybe it could be made public for a future release. Task-number: QTBUG-15575 Change-Id: I5c454689125cd9d5fda26ff2149208ed1beec24d Reviewed-on: http://codereview.qt.nokia.com/1829 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Fix Windows compileJiang Jiang2011-07-061-1/+1
|
* Move styleName out of QtFontStyle::KeyJiang Jiang2011-07-061-33/+44
| | | | | | Makes the code clearer and more explicit. Reviewed-by: Eskil
* Fix regressions in previous QFontDatabase patchJiang Jiang2011-07-051-12/+8
| | | | | | | | | | | 1. QtFontStyle::Key comparison should either use styleName or style, etc., but not both. 2. When initializing a QFont from QFontDatabase::font(), style and weight parameters should always be set even when we found a match styleName, in case these parameters will be used for comparison later. Reviewed-by: Eskil
* Store styleName in font databaseJiang Jiang2011-07-041-11/+31
| | | | | | | | | | | | | | | | So that queries like QFontDatabase::styles() can return exactly the same styles as the system does. Then application can use QFont::setStyleName() to select those styles later. With a lot of fonts not providing correct numeric weight/width values and even if they did, values are usually not directly mapped to QFont enums, styleName is probably the only reliable way to select any possible font in the system. Task-number: QTBUG-13518 Change-Id: Id8a9469b804f1b5bb81d8c7378e7e8778f9a4fff Reviewed-on: http://codereview.qt.nokia.com/739 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Fix build in C++0x modeBernhard Rosenkraenzer2011-05-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | This fixes compiler errors (gcc 4.6 -std=gnu++0x on x86_64 Linux): embedded/qwslock.cpp: In function `bool forceLock(int, int, int)': embedded/qwslock.cpp:121:39: error: narrowing conversion of `semNum' from `int' to `short unsigned int' inside { } [-fpermissive] (and equivalent errors in other lines/files) See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf Section 8.5.4/6 Change-Id: I2cbac5482b87f33287a416af5a5c9bde621720bc Reviewed-By: Olivier Goffart Merge-Request: 1240 Reviewed-on: http://codereview.qt.nokia.com/275 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com> (cherry picked from commit 15871d606a0a85cfcd2b68b95c0891165f61e402)
* 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-5/+22
| | | | | | | | | | | | | | 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
* Put all the declarations of qt_defaultDpi{,X,Y}() in one placeJiang Jiang2011-04-051-2/+0
| | | | Reviewed-by: Samuel Rødal
* Introduce QFontEngineDirectWriteEskil Abrahamsen Blomfeldt2011-03-141-0/+21
| | | | | | | | | | | | | | | | 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
* Resolve font alias before testing for exact matchingJiang Jiang2011-02-281-0/+6
| | | | | | | | | It is required in X11 for resolving some default substitutions like 'sans', 'serif', etc. It also provides stub to implement similar replacement in other platforms like Windows. Task-number: QTBUG-15575 Reviewed-by: Eskil
* Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2011-01-251-7/+13
|\ | | | | | | | | | | Conflicts: configure src/network/bearer/bearer.pri
| * Avoid possible font name collisions on fbservAlessandro Portale2011-01-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QTBUG-6611 implemented the long awaited app font support on Symbian. One of the problems with the underlying Symbian Api for font loading is that all fonts go into one system wide font store on fbserv. All fonts are visible to and accessible by every application. And there is no way to find out if a font is an app font and whose process' app font it is. If a font with a certain family name is already loaded on fbserv, no other application can load its font with the same family name. If two applications access the same font, bad things can happen (details: QTBUG-16514). This patch works around naming collisions on the fbserv. It also prevents Qt applications from using other Qt applications' app fonts. It does so by "marking" the name of the temporary ttf file before the file gets loaded by fbserv. All font name strings in the font's 'name' table get a marker string appended. The marker is composed by a "Q", the uid3, and on Symbian^3|PR1&below the pid. The marker length is four characters. When the QFontDatabase is populated, all own app font names are cleand from the marker, so that the Qt app can use the original font name. Other applications' app fonts are detected and filtered out of the own font database. Symbian's font Api supports only 24 characters as names for font families. The name marker reduces the effective characters to 20. The reduced name length is documented for QFontDatabase::addApplication[FontFromData] as a note. Since the app font feature is much safer now, it got re-enabled for Symbian^1 and below by reverting 25ac59fcf1bb03c9af9a2c967218c96c7c77361a . Task-number: QTBUG-16514
| * Supporting Qt application fonts on SymbianAlessandro Portale2011-01-191-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch finally implements the missing application font support on Symbian. QFontDatabase's addApplicationFont[FromData], applicationFontFamilies and removeApplicationFont are now functional and allow an application to load, use and unload fonts at run-time. The underlying Symbian API comes with some restrictions/specialties. Most of them are worked around in this patch, the missing ones are left as part of QTBUG-16514: - The font file must be a file, not a memory buffer. Web fonts and qrc fonts come as memory buffers. These buffers are saved to a temporary .ttf file and the file is loaded by the underlying Symbian API. The temporary file can only be deleted after the font is unloaded. - The font file must be in a public location in order to be loadable by Symbian. It can for example not reside in the private application directory. Therefore, all application fonts (also those that are on the file system) become a temporary .ttf file in c:\temp\. - Symbian3/PR2 will come with a font table API which provides direct access to font tables. Symbian3/PR1 and below are missing this API, therefore, an own TFontStore is (ab)used to read font tables out of a font. This patch is considering both code paths in several occasions, making the Qt Symbian font implementation significantly less maintainable. - The fonts are loaded into Symbian's central font server. Loaded fonts from different processes can have colliding font typeface names (not file names) on that server. The server does not separate loaded fonts by their origin processes. Working around such collisions is part of QTBUG-16514. The number of fonts loadable at the same time by a Qt application is limited to the random value 5. Just to prevent abuse of the font server's memory. As usual, this patch was looked at by colleagues, and it was adjusted according to the feedback. But since the bus factor for the interaction of Qt's and Symbian's font systems is 1, I reviewed this patch, myself. Task-Number: QTBUG-6611 Autotest: tst_QFontDatabase::addAppFont
* | 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-101-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | Make application font family names locale sensitive in X11Jiang Jiang2011-01-061-0/+3
| | | | | | | | | | | | | | | | | | | | | | So that they will match the family names returned by QFontDatabase::families. Because the family names returned by FcFreeTypeQueryFace are not sorted with locale as the names returned by FcFontList, we have to find out the family name matching the system language in the former case. Task-number: QTBUG-14269 Reviewed-by: Eskil
* | Merge remote branch 'qt/master' into lighthouse-masterPaul Olav Tvete2010-10-221-4/+6
|\ \ | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qapplication_win.cpp src/gui/kernel/qwidget.cpp src/gui/text/qfontengine_ft.cpp
| * | Replaced sample text for Japanese fontTasuku Suzuki2010-10-201-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | The previous word was improper because it means "lazy" Task-number: QTBUG-14527 Merge-request: 868 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* | | Merge remote branch 'lighthouse/4.7' into lighthouse-masterPaul Olav Tvete2010-09-131-19/+48
|\ \ \ | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/text/text.pri src/plugins/generic/linuxinput/qlinuxinput.cpp
| * | | Initial pluggable fontdatabaseJørgen Lind2010-09-021-19/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-08-191-4/+0
|\ \ \ \ | |/ / / |/| / / | |/ /
| * | Remove obsolete code & workarounds for unsupported versions of MS Visual C++miniak2010-08-031-4/+0
| |/ | | | | | | | | | | | | The minimum supported version of MS Visual C++ 2003, which is _MSC_VER 1310. Merge-request: 756 Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
* | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt into lighthouseJørgen Lind2010-06-241-1/+1
|\ \ | |/
| * Make QtFontFamily::symbol_checked a bitfield.Andreas Kling2010-06-241-1/+1
| | | | | | | | Reviewed-by: Benjamin Poulain <benjamin.poulain@nokia.com>
* | Say hello to Q_WS_QPA!Jørgen Lind2010-06-241-20/+20
| | | | | | | | Rename Q_WS_LITE -> Q_WS_QPA
* | Merge remote branch 'qt/4.7' into lighthousePaul Olav Tvete2010-06-181-4/+9
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Allocate the memory for QtFontSize when count > 1Benjamin Poulain2010-06-161-1/+1
| | | | | | | | | | | | | | | | This fix a regression introduced by 71ba2b0973d291e991e1498c266e69d6640c8531. In the case count >= 1 && count < 8, no memory is allocated. Reviewed-by: Andreas Kling
| * Reduce the memory consumption of QtFontStyleBenjamin Poulain2010-06-161-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QtFontSize::pixelSize() was allocating 8 slots for QtFontSize while most fonts only require one. This patch add a special case for the first QtFontSize in order to reduce memory consumption. The size of QtFontSize in memory has also been reduced. Overall, the memory consumtion of QtFontStyle instances go down from 100kb to 10kb. Reviewed-by: Eskil Abrahamsen Blomfeldt
* | Merge remote branch 'qt/4.7' into lighthouse-4.7Paul Olav Tvete2010-05-101-7/+7
|\ \ | |/ | | | | | | | | Conflicts: src/gui/egl/egl.pri src/gui/painting/qwindowsurface_p.h
| * Renaming a few unexported, private symbolsAlessandro Portale2010-04-281-7/+7
| | | | | | | | | | | | | | | | That reduces the delta between 4.6/4.7 and a patch that I am pre- paring for Symbian^4. The renaming will help me a lot when main- taining font issues on 4.6 and 4.7 and different Symbian versions. Reviewed-by: trustme
* | Merge remote branch 'origin/4.7' into lighthouseJørgen Lind2010-04-211-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | 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
| * Symbol visibility fixes for RVCT4 on SymbianIain2010-04-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | RVCT 4 is far more strict with regards to symbol visiblity that RVCT 2.2, and will hide symbols unless all references have default visibility in the object files. Update the various places in Qt code where the symbol visibility was set incorrectly for DLL-based platforms (those that use __declspec(dllimport) and (dllexport). Note: QtWebkit and QtScript are fixed in different commits. Task-number: QTBUG-9903 Reviewed-by: Jason Barron
* | Merge remote branch 'origin/4.6' into lighthousePaul Olav Tvete2010-01-141-8/+8
|\ \ | |/ | | | | | | | | | | Conflicts: configure src/corelib/global/qglobal.cpp src/gui/dialogs/dialogs.pri
| * Update copyright year to 2010Jason McDonald2010-01-061-1/+1
| | | | | | | | Reviewed-by: Trust Me
| * Doc: Fixed references to "old" 2.x and "new" 3.x font name conventions.David Boddie2009-12-071-7/+7
| | | | | | | | | | Reviewed-by: Trust Me As-reported-by: Eskil
* | Merge remote branch 'origin/4.6' into lighthousePaul Olav Tvete2009-11-191-5/+22
|\ \ | |/ | | | | | | | | Conflicts: configure src/plugins/graphicssystems/graphicssystems.pro
| * CompileEskil Abrahamsen Blomfeldt2009-11-061-1/+1
| | | | | | | | | | | | Missing comma in qfontdatabase.cpp Reviewed-by: Gunnar
| * add support for the N'Ko writing system to QtLars Knoll2009-11-061-3/+20
| | | | | | | | | | | | | | | | Enables N'Ko support in Qt, after having now a harfbuzz version that supports it. Task-number: QTBUG-1042 Reviewed-by: Gunnar
| * Line spacing fixesJoerg Bornemann2009-10-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QTextEdit (via QTextLayout) and QPlainTextEdit in Qt used to ignore any font leading but added one extra pixel in QFontMetrics. With many freetype fonts, this resulted in a "spacy" text layout. The necessary fixes on X11 and Windows were to take (positive) leading into account, to make the font database convert point sizes to pixel sizes without rounding to plain integer values, and to subtract the extra pixel from QFontMetrics from the font engines' descent value. The change also fixes several places in styles and widgets, where QFontMetrics::lineSpacing() was wrongly used instead of QFontMetrics::height(). Ideally we should also handle negative leading, which would require additional and bigger code changes in QTextLayout and QPlainTextEdit. In addition, all other editors we have tested seem to ignore leading on X11. If we choose to believe the values provided by freetype, our text layout would be one pixel smaller than everybody else's. On the Mac, this change does nothing. There our layout is still too spacy, and for smaller fonts quite ugly compared to native Mac applications. Done with mae. Reviewed-by: mae
* | Merge branch '4.6' into lighthousePaul Olav Tvete2009-10-141-2/+7
|\ \ | |/ | | | | | | | | Conflicts: src/gui/kernel/qapplication.cpp src/gui/kernel/qwidget.cpp