summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qrawfont.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-07-011-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.cpp src/corelib/global/qglobal.h src/corelib/global/qsysinfo.h src/corelib/global/qsystemdetection.h src/corelib/kernel/qobjectdefs.h src/plugins/plugins.pro tests/auto/widgets/itemviews/qlistview/qlistview.pro Change-Id: Ib55aa79d707c4c1453fb9d697f6cf92211ed665c
| * Replace MAC OS X with OS XNico Vertriest2015-06-301-1/+1
| | | | | | | | | | | | Task-number: QTBUG-46374 Change-Id: I7bc633ab551740bd328a24b0ccae1d534af47138 Reviewed-by: Martin Smith <martin.smith@digia.com>
* | doc: Remove uses of \mainclassMartin Smith2015-06-051-1/+0
|/ | | | | | | | This qdoc command is deprecated. Task-number: QTBUG-46476 Change-Id: Iee36f91bdcf500c2e88022a5f8a9c3accc6048c2 Reviewed-by: Martin Smith <martin.smith@digia.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | 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. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Make QRawFont usage safer in a multi-threaded environmentKonstantin Ritt2014-12-131-26/+5
| | | | | | | | | | QFontEngine must be accessed amd deleted only in a thread in which it was instantiated, so we remember that thread and check if it hasn't been changed every time we access the engine. Change-Id: I28bc0394ced9cbd437dc950d35ffcbd99cfa7152 Reviewed-by: Pierre Rossi <pierre.rossi@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@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>
* qpa: merge qrawfont_qpa.cppTor Arne Vestbø2014-05-131-2/+16
| | | | | | Change-Id: I8552199c8b3e365adefbc2bb096c8153e222cec8 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Drop dead codeKonstantin Ritt2014-03-311-4/+1
| | | | | | | The QFontEngineMulti's `base` font engine always non-null. Change-Id: I5092b66bc839a6a3216ffa0b0afe55a8b62be620 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Optimize glyph lookups with QFontEngine::glyphIndex(uint)Konstantin Ritt2014-03-051-1/+1
| | | | | | Change-Id: I56c7e727f3d9b08195f38939106620c744c6eaf0 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Optimize stringToCMap() usageKonstantin Ritt2014-02-071-12/+5
| | | | | | | | | | | | CMAP guarantees there is 1:1 mapping between the Unicode code points array and the glyph indexes array, which means the QString length always greater than or equal to a sufficient glyph indexes array length. Simply add some asserts and improve the memory consumption and the performance where possible. Change-Id: I0bc8cdba5f86c1c0ba9e79c8d5f96cbe56ec463e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Get rid of QGlyphLayout::advances_yKonstantin Ritt2014-01-301-5/+3
| | | | | | | | | | | | | | | ...and thus consume 4 bytes less per glyph and increase the performance a bit. It seems, the only CTFontGetAdvancesForGlyphs() returns both x and y advances, though y advances are always equal to 0 for horizontal orientation and x advances are always equal to 0 for vertical orientation. Also, rename `advances_x` to `advances` for consistency and declare QGlyphLayout's data size in a single place. Change-Id: I56b20f893f8a6feb7aa870e3edbca99dd93ba2e2 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Doc: Adding mark-up to boolean default values.Jerome Pasion2013-10-081-5/+5
| | | | | | | | | | | | | | | | | 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>
* Fix the font engines leakingKonstantin Ritt2013-03-201-4/+2
| | | | | | | | | | | | | | | 1. when there were some engines with ref > 1 in the cache, prior to calling QFontDatabase::{add,remove}ApplicationFont()/removeAllApplicationFonts() (QFontCache::clear() has never decreased engine's cache_count); 2. when the QFontEngineData's engine is not in cache i.e. the Box or Test font engine (~QFontEngineData() didn't free engines it keeps). Instead of using the font engine's (external) "cache_count" counter, QFontCache now references a given font engine every time it is inserted to the cache and dereferences exactly that number of times in clear(). Change-Id: I87677ebd24c1f4a81a53526f2e726e596b043c61 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Perform kerning in QRawFont::advancesForGlyphIndexesAllan Sandfeld Jensen2013-03-191-5/+56
| | | | | | | | | | | | Being able to calculate advances for series of glyphs include kerning is important to be able get kerning on QGlyphRun. Note this kerning is only truetype kerning, since opentype kerning is performed during shaping. Change-Id: I8d7458066431cbdce699647056fd0d7a76b20aa2 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Replace HB types used in API with Qt analogsKonstantin Ritt2013-03-121-1/+1
| | | | | | | | | | hb_uint32 <-> quint32 HB_Glyph <-> glyph_t HB_Fixed <-> QFixed, HB_FixedPoint <-> QFixedPoint HB_GlyphAttributes <-> QGlyphAttributes Change-Id: I4338ec4ce9a9c20ea591606ab10e6ef4f19931b8 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Get rid of qt_determine_writing_systems_from_truetype_bits()Konstantin Ritt2013-03-121-5/+8
| | | | | | | Move this code to QPlatformFontDatabase and get rid of all dups of it. Change-Id: Idea6c84819039bf3b345b1305305951ade8d1ac4 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add more qtbase implictly-shared classes to the listGiuseppe D'Angelo2012-11-301-1/+2
| | | | | | | QText*Format and QDns* ones are still missing. Change-Id: I8e87fba596e87289ca935717e0a90bfc0b0a26c0 Reviewed-by: hjk <qthjk@ovi.com>
* QRawFont: improve performance and safety of glyphIndexesForString()Konstantin Ritt2012-10-151-38/+32
| | | | | | | | | | | As of 98c1eb1750498cdff9d3b26658e5e5be9c026c92, partially initialized QGlyphLayout is ok for stringToCMap() if GlyphIndicesOnly flag is set, thus we can use the glyphIndexes buffer directly and avoid copying. Also add some checks to guarantee we're not falling into an undefined behavior for the empty text or NULL buffer. Change-Id: I662953703e4c65edbebabbe4b753972417d963f3 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>
* Fix docs for QRawFont.Jason Barron2012-08-211-2/+2
| | | | | | | Use correct function name for 'swap' and replace QGlyphs -> QGlyphRun. Change-Id: I4997a59ef643c688e8084a2013208fb760a2784a Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Move ShaperFlags enum from QTextEngine to QFontEngineKonstantin Ritt2012-07-101-1/+1
| | | | | | | | These flags are specific to font engine(s) and has nothing to do with the text engine or the text layout. Change-Id: I4bb793c3c634b3cf0ae0a8a8c23b946fad5874b6 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* QtGui: add member-swap to shared classesMarc Mutz2012-07-031-0/+8
| | | | | | | Implemented as in other shared classes (e.g. QPen). Change-Id: I5b96d4a4795870d6252aa53de6fbaedde7c0095a Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Get started with patching up the Qt GUI docsGunnar Sletta2012-06-281-0/+1
| | | | | | | | Primary goal, make the front page of the Qt GUI module a bit more clarifying and avoid downstream references inside the Qt GUI docs. Change-Id: Icbcfbb64b93963add889bf83711daa9575885c02 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* QFontMetrics/QRawFont: Optimize SMP code points handling a bitKonstantin Ritt2012-06-141-6/+4
| | | | | | | | | Calling QString::fromUcs4() for the single UCS-4 -encoded character is quite suboptimal since the BOM detections and the resulting QString aren't really used; all we need is to split the UCS-4 code point into the UCS-2 surrogate pair. Change-Id: Ia5b68312909bf551cf2493d9e2752a7d7d837fb9 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Deprecate qMemCopy/qMemSet in favour of their stdlib equivilents.Robin Burchell2012-04-111-1/+1
| | | | | | | | | | | | | | | | | | Just like qMalloc/qRealloc/qFree, there is absolutely no reason to wrap these functions just to avoid an include, except to pay for it with worse runtime performance. On OS X, on byte sizes from 50 up to 1000, calling memset directly is 28-15% faster(!) than adding an additional call to qMemSet. The advantage on sizes above that is unmeasurable. For qMemCopy, the benefits are a little more modest: 16-7%. Change-Id: I98aa92bb765aea0448e3f20af42a039b369af0b3 Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com> Reviewed-by: John Brooks <john.brooks@dereferenced.net> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Return early in QRawFont::setPixelSize.Pierre Rossi2012-04-031-1/+1
| | | | | | | | We would otherwise end up cloning the font engine for absolutely no reason when the pixel size is already right. Change-Id: I8c34d2b53b596ad49d00031a3fb8e79f3b30d591 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Remove the usage of deprecated qdoc macros.Casper van Donderen2012-03-021-3/+3
| | | | | | | | | | | QDoc now has support for Doxygen style commands for italics, bold and list items. This change applies that change in QDoc to the actual documentation. Task-number: QTBUG-24578 Change-Id: I519bf9c29b14092e3ab6067612f42bf749eeedf5 Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* replace 'const QChar &' with 'QChar ' where appropriateKonstantin Ritt2012-02-211-1/+1
| | | | | | | | | as QChar is actually an ushort and there is no point in taking its address. Merge-request: 69 Change-Id: Idcc9d621e5627514ade006aa12a789a88929d48b Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | 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: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Move glyphMargin() to QFontEngineJiang Jiang2012-01-241-1/+1
| | | | | | | | | | | | | glyphMargin() support for QTextureGlyphCache is implemented in respective font engines, thus this function is platform dependent. Before Qt 5 the code is guarded in macros like #ifdef Q_WS_MAC, now we should move them into QFontEngine and its subclasses. So far only Windows font engines support it. FreeType and Core Text based font engines all ignore it. Change-Id: Ia14016533d8fbfaacf848a7d3bc928f8197318f5 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Remove Symbian specific code from QtGui.Xizhi Zhu2012-01-241-1/+1
| | | | | Change-Id: I103abb545d1a5deed7d40c0b50fc3eff0c89d622 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Replace implicit QAtomic* casts with explicit load()/store()Bradley T. Hughes2011-10-271-2/+2
| | | | | Change-Id: Ia7ef1a8e01001f203e409c710c977d6f4686342e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove Q_WS_ and Q_OS_SYMBIAN from QtGui.Friedemann Kleint2011-10-131-18/+0
| | | | | | Change-Id: I2ac3376513c3fbfc81a2e695a73a0d948d2696bc Reviewed-on: http://codereview.qt-project.org/6607 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* doc: Fix incorrect enum name in QRawFont::alphaMapForGlyph docsEskil Abrahamsen Blomfeldt2011-09-151-1/+2
| | | | | | | | | | | | | There's no QImage::Format_A8 format. This is a term used in the corresponding QFontEngineGlyphCache enum. Reviewed-by: Jiang Jiang (cherry picked from commit e453fce2731069dce993a94b0c2291307cc7806c) Change-Id: I68a190abdf4446d05231af89ac861380ac79b188 Reviewed-on: http://codereview.qt-project.org/4773 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
* micro optimizationsKonstantin Ritt2011-09-021-89/+32
| | | | | | | | | | | use an inlined version of isValid() everywhere; don't detach where is non required; get rid of extra checks where possible Change-Id: I6815c1f7d7c03677d9c57dda2731ed2868ea92aa Merge-request: 1343 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> Reviewed-on: http://codereview.qt.nokia.com/4144
* fix typo in the docsKonstantin Ritt2011-09-021-1/+1
| | | | | | | | | | Merge-request: 1343 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> (cherry picked from commit 3926aa4b69caa9037d610b4e212d99dae86d500c) Change-Id: I5d0464651ec72d606e009cc43d0214fe179b02dd Reviewed-on: http://codereview.qt.nokia.com/4143 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* QRawFont: add missed operator !=Konstantin Ritt2011-09-021-0/+6
| | | | | | | | | | Merge-request: 1343 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> (cherry picked from commit 32603c5e40948491f0644d0d17a7e8bbff8d3e0c) Change-Id: I76bc558a30a61c6eabec960eb206076eb443344f Reviewed-on: http://codereview.qt.nokia.com/4142 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Switch to use floating point pixelSize in QRawFont completelyJiang Jiang2011-07-291-4/+4
| | | | | | | | | | Reviewed-by: Eskil (cherry picked from commit 500f8a4368be85a0ae8b7c46012deb0ab0c844ad) Change-Id: I6cfebcbb68697c9bf7a5634e98a09a26928467d7 Reviewed-on: http://codereview.qt.nokia.com/2386 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Add missing APIs to QRawFont and some additional notes to fromFontJiang Jiang2011-06-271-0/+27
| | | | | | | Change-Id: I8487a2e32f5b71a1eb51dcb8540cb5de2def09f6 Reviewed-on: http://codereview.qt.nokia.com/769 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Allow selecting fonts with irregular style namesJiang Jiang2011-06-091-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fonts like "Helvetica Neue UltraLight" or "Skia Regular Black Condensed" can't be selected in Qt because either they don't report correct numeric values for weight/stretch/etc. or these values are not mapped from QFont enums in a linear way. Thus we provide a shortcut to select these fonts with PostScript name or full name without resorting to family name matching in QFontDatabase (these fonts are not registered in font database anyway). After this, we can simply use: QFont font("Helvetica Neue"); font.setStyleName("UltraLight"); to select these fonts. QCoreTextFontEngineMulti matched like this can be created directly from the CTFontRef instance instead of creating from the font name, making this process faster. The commit also cleaned up the font loading process in Mac font database a bit, moving the code for family matching into a separate function. Add QFontInfo::styleName() and QRawFont::styleName() to access the resolved style name for a font. Task-number: QTBUG-19366 Change-Id: Iad07768c02ed06cc8d6b7395dec554384f410506 Reviewed-on: http://codereview.qt.nokia.com/333 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 qtbase Qt moduleJyri Tahtela2011-05-241-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Doc: Fixed qdoc warnings.David Boddie2011-05-231-22/+34
|
* Enablers for TextInputEskil Abrahamsen Blomfeldt2011-05-231-0/+14
| | | | | | | In order to use the scene graph text node in TextInput, we need enablers. Most of this is to enable selections, which in turn means we need to be able to extract a certain set of glyphs from a QTextLine.
* Add some QRawFont related low level functions to avoid extra copyingJiang Jiang2011-05-111-5/+53
| | | | | | | | | | | | Added functions: - QRawFont::glyphIndexesForChars(const QChar *chars, int numChars, quint32 *glyphIndexes, int *numGlyphs) const - QRawFont::advancesForGlyphIndexes(const quint32 *glyphIndexes, QPointF *advances, int numGlyphs) const Reviewed-by: Eskil (cherry picked from commit 965af9eb2932efae5d736df54c3859460017b6a5)
* Compile on MacEskil Abrahamsen Blomfeldt2011-05-101-2/+2
| | | | | | | Missing API update in Q_WS_MAC block Reviewed-by: Jiang Jiang (cherry picked from commit 4b95d9939db75d7bd55db4bbbf2d67af459f7eb5)
* Rename QGlyphs -> QGlyphRunEskil Abrahamsen Blomfeldt2011-05-101-9/+9
| | | | | | | | | | | API clean-up for QGlyphRun: 1. QGlyphs -> QGlyphRun 2. QGlyphRun's font()/setFont() -> rawFont()/setRawFont() 3. QPainter::drawGlyphs() -> drawGlyphRun() 4. QTextLayout and QTextFragment's glyphs() -> glyphRuns() Reviewed-by: Jiang Jiang (cherry picked from commit 84ef364302728b68d2d29ea9c4ccbec32c7bb115)
* Add required font metrics functions to QRawFontJiang Jiang2011-05-041-0/+52
| | | | | Reviewed-by: Eskil (cherry picked from commit 2c8df8bfb679885c3cbd2ee02f5e4053fdd554c2)