summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Turn off font hinting when we do high DPI scalingPaul Olav Tvete2015-01-161-0/+5
| | | | | | | | | Font hinting depends on the specific pixel size, and ends up very wrong when the painter is scaled. Change-Id: I2007ec7e7ad8d52358d76e88e030ea4df7e91455 Task-number: QTBUG-43809 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* fontconfig: do not assume the path to a font file is Latin1-encodedShawn Rutledge2014-10-291-1/+1
| | | | | | | Task-number: QTBUG-42249 Change-Id: Ie5d41ed26a69103991a5189c4f42aa37ac73de26 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* Make font hinting and antialiasing size dependent when using FontConfigAlexander Volkov2014-10-171-0/+3
| | | | | | | | | Add the pixel size of the font to the search pattern to get size dependent font settings. This patch allows to take into account KDE settings for font sizes which should be excluded from antialiasing. Change-Id: I8bd8b7b3d585009d0a39db631cd02b7970537f5c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
* Reduce code duplication in QFontconfigDatabaseAlexander Volkov2014-10-161-146/+92
| | | | | | | Extract common part from fontEngine() methods to setupFontEngine(). Change-Id: Id4aee43b2a477f9fd40dc564d96a2335bfde9e22 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Support antialias and rgba Xft settings as used by GNOME and UNITYAllan Sandfeld Jensen2014-08-181-17/+52
| | | | | | | | | We only parsed the hintstyle from the Xft settings. This patch adds parsing for also subpixel style and disabling antialiasing. Task-number: QTBUG-27106 Change-Id: Icdb88ccc10e50d76eb30a5b126bee7590e257022 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Support autohint and lcdfilter fontconfig configurationAllan Sandfeld Jensen2014-08-161-0/+20
| | | | | | | | | This patch adds support for reading autohint and lcdfilter settings from fontconfig and pass them on to freetype. Task-number: QTBUG-32254 Change-Id: Iaa69b70f7005ee7f21126a8d984c07b3a46a3e7f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Move SubpixelAntialiasingType from QFontEngineFT to QFontEngineAllan Sandfeld Jensen2014-08-141-30/+30
| | | | | | | | | | | To be able to use the SubpixelAntialiasingType enum without depending on QFontEngineFT we need to move it to QFontEngine. The patch also cleans up the left-overs of other enums moved the same way. Change-Id: I025bc8a5b429d376cfab0a643121ed6f99204988 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Add QFont strategy to disable subpixel antialiasingAllan Sandfeld Jensen2014-08-031-1/+3
| | | | | | | | | | | This patch adds the option to disable subpixel antialiasing on QFont basis. This can be useful when painting to offscreen surfaces. On OS X this option disables the aggressive LCD font smoothing, which can be necessary for certain fonts it may otherwise ruin. Task-number: QTBUG-40396 Change-Id: I1664b636520ae63ee1503b5df7436748106b9f5c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Merge remote-tracking branch 'origin/stable' into devSimon Hausmann2014-05-221-0/+3
|\ | | | | | | Change-Id: Ia36e93771066d8abcf8123dbe2362c5c9d9260fc
| * Fix crash when loading invalid font data in QRawFontEskil Abrahamsen Blomfeldt2014-05-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When passing invalid data to QRawFont, we need to fail gracefully and mark the font as invalid, instead of crashing. This crashed because of different missing sanity checks in the Windows and FontConfig font databases. [ChangeLog][Text] Fixed crash when trying to load a font from invalid data. Task-number: QTBUG-37190 Change-Id: I62c81217ec7d873350b575c9d4ae8e6f0a939540 Reviewed-by: Michael Bruning <michael.bruning@digia.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | qpa: Clean up and refactor qfontengine_qpaTor Arne Vestbø2014-05-151-1/+0
|/ | | | | | | | | | | QFontEngineQPA was really QFontEngineQPF2, and has been renamed. The multi font engine in qfontengine_qpa.cpp was really a base implementation of a multi font engine, used by other multi font engines, and has been renamed and moved accordingly into qfontengine_p.h/cpp. Change-Id: Iac7409c4dbf0fdc3ee993ce4f7dc96cb00a422e6 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Fix application font removal when using FontConfigFabian Bumberger2014-03-271-108/+112
| | | | | | | | | | | | | | | | | This patch fixes an issue when a font that was added with QFontDatabase::addApplicationFont can not be removed any more. The reason for that is that QFontconfigDatabase::addApplicationFont adds the font to the FontConfig application set from where it cannot be removed any more and is picked up every time the font database is repopulated (e.g. after a call to QFontDatabase::removeApplicationFont). This also fixes the QFontDatabase autotest which unfortunately does not fail on linux, because it tries to add "FreeMono" (which in most cases is already there as a system font). So this patch removes FreeMono and adds LED_REAL as test font. Change-Id: I70fc823075923aa426da1eb3e052affcc416e399 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Apply fontconfig settings to custom fontsAllan Sandfeld Jensen2014-03-221-0/+50
| | | | | | | | | | | Currently QtWebKits custom fonts does not follow the system settings on Linux. This is because they are only handled by the basic fontdatabase. This patch adds handling of custom fonts to QFontconfigDatabase. Change-Id: I676fc97840766b58cd937bb8e2c9f166f30c8a6e Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Cleanup and refactor QFontconfigDatabase::fontEngineAllan Sandfeld Jensen2014-03-211-65/+74
| | | | | | | | | | | | Refactors the logic to parse the font configuration from fontconfig, so that it maybe reused for custom fonts in a later patch. Also fixes a minor mistake that meant we defaulted to medium hinting, where we tried to default full hinting. Change-Id: I1e135b8b1e3faeb213aa370ea59ebde3a671273d Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Revert "Fix application font removal when using FontConfig"Eskil Abrahamsen Blomfeldt2014-02-251-128/+112
| | | | | | | | | | | | This reverts commit a4ff400e25c76a32ec8252285dda043f07b19c15. The patch caused a regression for bold fonts which is currently blocking the alpha of Qt 5.3, so lets revert it and try resubmitting a fixed version later to avoid delaying any release. Task-number: QTBUG-36929 Change-Id: I8d474b09b2270eb2f861853e60605429be08e2d9 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Decrease code duplicationKonstantin Ritt2014-02-061-11/+2
| | | | | | | | Check engine's supported scripts in a single place and remove unused script parameter from fontEngine(). Change-Id: Ic153803bef519320c370b058e77eac1a4d92afd0 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* REG: Fix font matching in FontConfigEskil Abrahamsen Blomfeldt2014-01-291-0/+4
| | | | | | | | | | | | | | | Change a4ff400e25c76a32ec8252285dda043f07b19c15 exposed a bug in the font matching in the FontConfig engine. FcFontMatch is documented to not work unless you call FcConfigSubstitute() and FcDefaultSubstitute() on the pattern first. We were neglecting to do this, but hiding the bug before since we were doing our own font matching and never reading back the file name from FC's match. When we started doing this, suddenly DejaVu Sans (for instance) would match its bold variant instead. Change-Id: Ie6b7026de24cfb0353dc892fa862d6ee79604f38 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Fix application font removal when using FontConfigFabian Bumberger2014-01-281-112/+128
| | | | | | | | | | | | | | | | This patch fixes an issue when a font that was added with QFontDatabase::addApplicationFont can not be removed any more. The reason for that is that QFontconfigDatabase::addApplicationFont adds the font to the FontConfig application set from where it cannot be removed any more and is picked up every time the font database is repopulated (e.g. after a call to QFontDatabase::removeApplicationFont). This also fixes the QFontDatabase autotest which unfortunately does not fail on linux, because it tries to add "FreeMono" (which in most cases is already there as a system font). So this patch removes FreeMono and adds LED_REAL as test font. Change-Id: I2fa5f4df0ad2099ac28673760ea25234c725dfc6 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Improve mapping between Font Config and Qt font attributesRoger Maclean2013-10-271-17/+50
| | | | | | | | | | | | | | | | | | | | | | | It was sometimes impossible to select the desired font due to the code completely ignoring the FC_WIDTH attribute and poor mapping of the FC_WEIGHT attribute. The result was that it was easy to have a font file that was inaccessible by Qt since it shared attributes with another font file. The FC_WIDTH attribute is now fetched and used unchanged as the font's stretch value other than ensuring it is within the allowed range. For FC_WEIGHT, the code no longer matches the value with the closest QFont::Weight enum but instead does a piecewise linear mapping so that Qt enum values match Font Config ones to the extent possible. Also removed bogus call to fetch the width that was doing nothing with it. Change-Id: Id39715f14a617c1d0e00ecf5a7d391cab99adc03 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Fabian Bumberger <fbumberger@rim.com> Reviewed-by: Bernd Weimer <bweimer@blackberry.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
* Merge branch 'stable' into devSergio Ahumada2013-09-131-0/+8
|\ | | | | | | | | | | | | | | Conflicts: src/concurrent/qtconcurrentmedian.h src/corelib/itemmodels/qabstractitemmodel.cpp Change-Id: Iac46a90bbb2958cef7670031a4b59c3becd8538a
| * QRawFont::fromFont does not get antialias setting from fontconfigAllan Sandfeld Jensen2013-09-091-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | When creating a fontengine in QFontconfigDatabase::fontEngine we solely base the antialias setting on the QFont StyleStrategy and forget to ask fontconfig it has an overriding definition for this font match. This patch will now let fontconfig decide the antialias setting unless the NoAntialias stylestrategy has been set. Change-Id: I67981582a37cfd3c59aa1db929095585af554088 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* | Warn if OpenType support missing for script of interestKonstantin Ritt2013-09-131-0/+1
| | | | | | | | | | | | Change-Id: I076cfc5244ca3c060fd005cc3fbf30b357604bc7 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Decrease code duplication in QFontDatabase-sKonstantin Ritt2013-09-131-11/+3
| | | | | | | | | | | | | | | | 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>
* | QFontConfigDatabase: Minor code clean-upKonstantin Ritt2013-09-131-22/+10
| | | | | | | | | | | | | | | | Get rid of duplicated includes, useless defines, and private enums that just duplicate a public ones; avoid variable names collisions. Change-Id: I540e812b6cd510eb1ed441d97e9af377611d804a Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | API-cleanup: Add QPlatformFontDatabase::registerAliasToFontFamily().Friedemann Kleint2013-07-161-3/+1
|/ | | | | | | | Unexport free function qt_registerAliasToFontFamily() and Make it a static member of QPlatformFontDatabase instead. Change-Id: I1df49a8e37a24b3961f92288d67b6f1108a7d520 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Windows font database: Resolve aliases for extra fonts.Friedemann Kleint2013-07-111-1/+4
| | | | | | | | | Ensure QFontDataBase::hasFamily() deals with aliases. Task-number: QTBUG-31689 Change-Id: Ia59bfcb93362ac9343c6d30dab1091a4db482dfa Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Speed up font database loading with fontconfigLars Knoll2013-07-061-89/+7
| | | | | | | | | | | | | Trust fontconfig if it claims that the font supports a language and don't use the expensive check for a symbol font in this case. Speeds up app startup if the system has many latin only fonts installed by a big amount. Also remove some compat handling for fontconfig versions from 2003 and earlier... :) Change-Id: I5de0812685ae76090b2c0ef5b6c2dcf430249bb8 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Fix QFontConfigDatabase crashRafael Roquetto2013-05-011-2/+2
| | | | | | | | Take into account the possibility that the target platform plugin does not support platform services. Change-Id: I48e7fac2e1230a9a7d450414044d23ed26b334be Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Read correct font hinting config on Gnome/UnityEskil Abrahamsen Blomfeldt2013-04-221-0/+19
| | | | | | | | | | | | | Fixes regression against Qt 4. This tries to recreate the logic from 5c46d9a4c85abbcc0b5db2bbbafded3efd784cd9 in Qt 4, where we on Gnome would override the default hint style specified in FontConfig with Xft.hintstyle settings. This is the configuration used for changing the hint style in the Gnome Tweak Tool. Task-number: QTBUG-29582 Change-Id: I6b9fe2c8ff55ff080d034e5a53fc8cbb49f7651f Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* QFontConfigDatabase: Fix performance regressionKonstantin Ritt2013-04-161-2/+16
| | | | | | | | | ..introduced by 244cc5da55b92bf08f32da01d7557decbd9ba66c Symbol fonts usually don't have code ranges support except Latin. Don't load FT face for font that doesn't look like a symbol font. Change-Id: Iec46aa84e27227e0bda5d50f96a2b2f75f58e950 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* QFreetypeFace: Fix getFace() uses UTF-8 paths on non UTF-8 localesKonstantin Ritt2013-04-111-2/+2
| | | | | | | | | | QFontEngine::FaceId::filename is intended to be local8Bit-encoded but QFreetypeFace::getFace() always treats it like UTF-8-encoded. Also replace explicit (to|from)Local8Bit and toLatin FaceId::filename conversions with QFile::(en|de)codeName, where appropriate. Change-Id: Ic7beabf0a160f2f02f1667bcb8e6067adaba1c16 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Fix QFontconfigDatabase unable to fallback to a localized familyKonstantin Ritt2013-04-111-0/+5
| | | | | | | | | | | | | | | | When populating the font database, FcPatternGetString(FC_FAMILY) gets a localized font family name; but, in fallbacksForFamily, it gets a non-localized font family name, so it unable to find the proper font to fallback. Simply register all family name variants as aliases to localized name and make sure they are checked when getting fallback families. Task-number: QTBUG-28806 Task-number: QTBUG-30415 Change-Id: I71c03ae9b51a28736c2576f3442f1bbdb3497c09 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: jian liang <jianliang79@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* QFontConfigDatabase: fix fallbacksForFamily() for CJK languagesKonstantin Ritt2013-04-011-4/+4
| | | | | | | | | | For Han Unicode script, the language couldn't be determined algorithmically, the only way is guessing based on the user's locale. The is a regression introduced in 9b0fab6b62df98519ebfab117f14b9d3465d8c68 Change-Id: I84645885a825fdfb6c268edaf10185bf5e447eb5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* FontConfig: Correctly report Symbol writing system supportEskil Abrahamsen Blomfeldt2013-03-261-0/+23
| | | | | | | | | | | When all the Q_WS_X11 were removed, we also removed the special case for symbol fonts in QFontDatabase for FontConfig. This was checkSymbolFont() in Qt 4, and this patch copies the code and adapts it to Qt 5. Task-number: QTBUG-30044 Change-Id: I346f208052013eae9de3c33c210bf5db1d2aef87 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Fix selection of fonts that require OpenType featuresKonstantin Ritt2013-03-041-2/+1
| | | | | | | | HB_Face's supported_scripts[] expects HB_Script, so QChar::Script should be remapped via script_to_hbscript(). Change-Id: Ib068c35ab76567fe9a61da7d8ab01133a6f58bc0 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-01-221-1/+1
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qsavefile_p.h src/corelib/tools/qregularexpression.cpp src/gui/util/qvalidator.cpp src/gui/util/qvalidator.h Change-Id: I58fdf0358bd86e2fad5d9ad0556f3d3f1f535825
| * Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | | | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Merge branch 'stable' into devFrederik Gladhorn2013-01-041-5/+9
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: examples/widgets/painting/shared/shared.pri src/corelib/tools/qharfbuzz_p.h src/corelib/tools/qunicodetools.cpp src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp src/plugins/platforms/windows/qwindowsfontdatabase.cpp Change-Id: Ibc9860abf570e5ce8b052fb88feb73ec35e64bd3
| * Fix styleName support in QPA font databaseJiang Jiang2012-12-141-5/+9
| | | | | | | | | | | | | | | | | | Font styleName support was disconnected since Qt switched to QPA fontdatabase. Now add the code from Qt 4.8 back to enable this in QPA. Change-Id: Iab2cbfd5468f87542183348c2123ca4b2c270692 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* | Skip FcCharSetHasChar() callKonstantin Ritt2013-01-021-1/+1
| | | | | | | | | | | | | | ...if writing system is already known to be supported Change-Id: Id7ea11e92507a283b2fba2ad944dd0a9772e484d Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* | Update Qt internals to use QChar::ScriptKonstantin Ritt2012-12-211-48/+91
|/ | | | | | | | | | | | | | ...and remove the outdated QUnicodeTables::Script enum. QFontEngineData now has one extra slot that never used (engines[QChar::Script_Inherited]). engines[QChar::Script_Unknown], if accessed, would be set with a Box engine instance, and could be used as a minor optimization some time later. In order to preserve the existing behavior, we map all scripts up to Latin to Common. Change-Id: Ide4182a0f8447b4bf25713ecc3fe8097b8fed040 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* default to Regular font with FontConfigMichał Sawicz2012-11-231-5/+5
| | | | | | | | | | | | | | | Default to Regular/Normal instead of Medium in QFontConfigDatabase. Requesting Medium as default was fine until the font actually provided a Medium font, at which point it was selected by default. Tweak the buckets so that Medium has preference over Bold when DemiBold is requested. They will have to be extended for Medium when QTBUG-25814 is resolved. Change-Id: I111b7f99083d50c3e8264f84f10a997f619ef4b3 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Make font fallback list for common script locale awareJiang Jiang2012-06-011-0/+13
| | | | | | | | | | | | Even in common script we may need to have a preferred font list (which font should be used for CJK codepoints, Chinese, Japanese or Korean? Since the codepoints they cover may overlap.) Adding current default language into the pattern in that case will give a better recommendation for the fallback list if the system have configuration files like that. Change-Id: Idbc7f7b0cf24108d6cc255a1add0b29b730588c0 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Make fontconfig default font locale awareJiang Jiang2012-05-311-1/+24
| | | | | | | | | | | Application default font should be locale aware in fontconfig db as in other font databases. We use a hack to obtain the system default language parsed by fontconfig and use that to find out the preferred font for a given language (such font list is edited by fontconfig from fonts.conf in FcConfigSubstitute() process). Change-Id: I99bb8dd29d2dde2c8019ed8e77f5bfc09ddf3ca5 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Do not use charset loaded by fontconfigJiang Jiang2012-05-111-5/+0
| | | | | | | | | | | | | | | | | | The only use for storing charset loaded by fontconfig in font engines is for determine if a font supports certain codepoint, however FreeType already does that. The charset loaded is sometimes not complete, for instance in fontconfig 2.9.0 it removed Apple Roman platform support for cmap loading, thus results a regression in common symbol fonts (Wingdings, Webdings) rendering. Because those symbol fonts produced by Monotype only contain two cmap tables: Apple Roman and Microsoft Symbol, since the Microsoft Symbol table has a weird 0xF000 offset, we always fallback to the Apple Roman cmap table. Removing freetype charset cache also make each font engine consuming less memory. Change-Id: I88f3f44981f3a1c517b84809a3f5b834ffff7681 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Expose QPA API under qpa/*Girish Ramakrishnan2012-05-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main reasons for doing this are: 1. _qpa.h end up in the master QtGui include file. QtGui is meant for userland applications. qpa code is neither binary nor source compatible. Inadvertant use of QPA api makes the user code binary-incompatible. 2. syncqt creates forwarding headers for non-private header files. This gives people the impression that this is public API. As discussed on the mailing list, even though QPA api is internal and subject to change, it needs to treated differently from private headers since they will be used by in-qtbase and out-of-qtbase plugins. This commit does the following: 1. The _qpa in QPA header files is dropped. 2. syncqt now treats any file with qplatform prefix as a special file and moves it to qpa/ directory. The recommended way of using QPA API in plugins is: #include <qpa/qplatformfoo.h>. This allows the user include QPA API from multiple modules (for example, qplatformfoo might be in QtPrintSupport) 3. The user needs to explicitly add QT += <module>-private to get access to the qpa api. 4. Creates compat headers for the olden style qplatformfoo_qpa.h and QPlatformFoo includes. This commit does not change the cpp filenames. This requires a more careful merging of existing non qpa cpp files and existing cpp files on a case by case basis. This can be done at anytime. The following files are not renamed as part of this changed but will be fixed as part of a future change: src/gui/kernel/qgenericpluginfactory_qpa.h src/gui/kernel/qgenericplugin_qpa.h src/gui/kernel/qwindowsysteminterface_qpa.h files were renamed using for x in `find . -name "qplatform*_qpa.h"`; do git mv $x "${x/_qpa.h/.h}"; done for x in `find . -name "qplatform*_qpa_p.h"`; do git mv $x "${x/_qpa_p.h/_p.h}"; done includes were renamed using script for file in `find . -name "*.h" -or -name "*.cpp" -or -name "*.mm"`; do sed -i -e 's,.*#.*include.*<\(Qt.*/\)\?\(QPlatform.*\)>,#include <qpa/\L\2.h>,g' \ -e 's,.*#.*include.*"\(Qt.*/\)\?\(QPlatform.*\)",#include <qpa/\L\2.h>,g' \ -e 's,.*#.*include.* "\(qplatform.*\)_qpa.h",#include <qpa/\L\1.h>,g' \ -e 's,.*#.*include.*"\(qplatform.*\)_qpa_p.h",#include <qpa/\L\1_p.h>,g' \ -e 's,.*#.*include.*<\(Qt.*/\|Qt.*/private/\|private/\)\?\(qplatform.*\)_qpa\(.*\)>,#include <qpa/\2\3>,g' \ -e 's,.*#.*include.*"\(Qt.*/\|Qt.*/private/\|private/\)\?\(qplatform.*\)_qpa\(.*\)",#include <qpa/\2\3>,g' \ $file done Change-Id: I04a350314a45746e3911f54b3b21ad03315afb67 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Don't hardcode the default families in qfont_qpa.cppPierre Rossi2012-04-101-0/+7
| | | | | | | | | Since different platforms come with different fonts, we should probably leave it up to the platform to decide which family to use. Change-Id: I18bb81c0ce87cc7e9ac7f3abaeae1b41c0ce8410 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Fix for fontconfig 2.9 behavior changeJiang Jiang2012-03-261-11/+9
| | | | | | | | | | | | | | | | Start from 2.9, fontconfig will reset the result to FcResultNoMatch at the beginning of FcFontSort(). According to http://lists.freedesktop.org/archives/fontconfig/2012-March/003857.html the result value of FcFontSort() can be ignored, checking the nfont value of the fontset returned is sufficient. The fix works for pre-2.9 versions as well, since those versions don't touch the result at all. Change-Id: Iba6c1157e314088a90867292a4bd970bb873e284 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>