summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/harfbuzz
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Harfbuzz-shaper - fix incorrect logClusters being set in ↵Eskil Abrahamsen Blomfeldt2012-04-261-35/+13
| | | | | | | | | | | | | | HB_OpenTypePosition" This reverts commit add629d4f16a536fc56d55727195e3247b621a54. The commit caused crashes when laying out some text (e.g. ordinary Arabic text) with certain fonts (it triggered the assert in QTextLayout::addNextCluster()). The regressions will have to be weeded out before the fix can be recommitted. Change-Id: Iee457f138367d4cf8fcbd2e518271d8eaa95a62c Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Harfbuzz-thai - fix buffer overflow when setting item attributesJohn Tapsell2012-04-021-2/+7
| | | | | | | Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> Change-Id: I92de853b57e2e06211193a2b30ac7c308374c961 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Fix GPOS positioning for some fontsEskil Abrahamsen Blomfeldt2012-03-201-4/+5
| | | | | | | | | | | | We need to do ACCESS_Frame for each 2 byte frame, otherwise the position of the cursor in the input stream will not be updated by enough, and we will read twice as many pairsets. Depending on the value read for the SecondGlyph in the broken pairsets, we might get strange kerning results. Change-Id: I7fb5a850afe0364b3dd50869d5f36fd14d2f4eaf Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com> Reviewed-by: Adrian Yanes <ext-adrian.yanes@nokia.com>
* Harfbuzz-shaper - fix incorrect logClusters being set in HB_OpenTypePositionJohn Tapsell2012-03-201-13/+35
| | | | | | | | | | | | | | After shaping in HB_OpenTypePosition, when we come to calculate the new logClusters array we have to take into account that the glyphs passed in are not a 1 to 1 correspondance with the original string, because some shaping might have already been done. So we must use the old logClusters values (stored in tmpLogClusters) to map from the glyphs passed in back to the original string. This fixes visual word wrapping problems in thai Change-Id: I384dfa98f0946e9e074728f89542acb2b6b6bc27 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Optimize HB memory consumption of PairPos1 in GPOS tablesEskil Abrahamsen Blomfeldt2012-03-132-28/+101
| | | | | | | | | | | | | This is pretty much the same fix as in be0dfa34737a014e7ad060a90c4c24be9998fe13 but for PairPos format 1 instead of 2. With very simple GPOS tables we would waste a lot of memory on caching an uncompressed table, so we now compress it in memory as well. Change-Id: I601331b4b83f636dab9e1ac403b343558c15b0de Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Harfbuzz GPOS hinting- do not consider a subtable to be invalid if it is ↵John Tapsell2012-03-121-0/+3
| | | | | | | | | | | | just empty Considering a subtable to be invalid when it was empty meant that it returned an error causing all further hinting to be aborted. This means that we get no hinting in certain cases with certain fonts. Change-Id: I840c016dc85935b4f2c4373c66a79b4bd8b3a30d Reviewed-by: Adrian Yanes <ext-adrian.yanes@nokia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Make cache of opentype tables in Harfbuzz face lazyEskil Abrahamsen Blomfeldt2012-03-062-2/+32
| | | | | | | | | | | | | | | | | | | | The mechanism in fontconfig which determines if a certain character is available (FcCharSetHasChar()) may give false positives, in which case we would load and unload those fonts per every char for which FC gave us a false positive. This was a major performance regression. Specifically the false positives happened when looking at e.g. italic variants of certain multilingual fonts, since we only check the charset of the font family as a whole and not of the specific variant, which may only support a subset of the chars. To optimize this, we remove the deletion of the font engines after loading them, but also wait with loading the opentype tables until they are actually needed. This means that for the false positives, we will load the font, but the cached data for each unused font will be much smaller. Change-Id: Idfc794401a2080da5946bf65204eb947aeb635ed Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Harfbuzz-thai: Hide ZWJ and ZWNJ characters and show Inherited charactersJohn Tapsell2012-02-231-3/+8
| | | | | | | | | | | | | | | | | | | | | | | Thai is not supposed to have ZWJ and ZWNJ characters or any other of the Inherited Unicode Scripts (http://www.verisigninc.com/assets/idn-inherited-unicode-script.pdf) - they don't have a mapping to the thai encoding tis620 which libthai requires. However it is an unfortunate fact that there are many websites etc that liberally place these ZWJ and ZWNJ characters throughout thai text to force word boundaries, so we must also deal with them. We deal with all Inherited characters by mapping them to the invalid code ~0 in tis620 encoding, following what libthai does internally in its own tis620 encoding functions, and then replacing this character with the original unicode and setting dontPrint to true to hide the ZWJ and ZWNJ characters. Includes a unit test to check the behaviour. Change-Id: I1ee8388b650cb5fc61bcb265efb9843c73f327ac Reviewed-by: Adrian Yanes <ext-adrian.yanes@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Harfbuzz-thai - When calling HB_OpenTypePosition we must set doLogClusters ↵John Tapsell2012-02-231-1/+1
| | | | | | | | | | | | | to true for thai This bug resulted in word wrapping not working correctly for thai. Reviewed-by: Adrian Yanes <ext-adrian.yanes@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> (cherry picked from commit 7495f2c7c55917a98c903547858be923028b7827) Change-Id: Iedb26a10078c6cc4e90d090176ab63499293d69d Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Harfbuzz-thai - fix to_tis620 function for latin charactersJohn Tapsell2012-02-231-1/+1
| | | | | | | | | | | | This was an obvious typo - a missing "else" in a group of if statements. Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com> Reviewed-by: Adrian Yanes <ext-adrian.yanes@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> (cherry picked from commit a784bdcabe895ab927cbc28118d427c6e932b9fc) Change-Id: Icbd458034e42cf7f2af33c1ecc9b0e4f1aa8724a Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Fix height of some Thai charactersMarko Kenttala2012-02-231-0/+28
| | | | | | | | | | | | | | | | | Some Thai characters with two above glyphs were higher than fonts ascent. This caused them to be clipped in for example qtcomponents buttons. Added checking for this and calculation of new lower offset between glyphs if needed. Task-Number: ou1cimx1#898104 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Sami Merilä <sami.merila@nokia.com> Reviewed-by: Pasi Pentikäinen <ext-pasi.a.pentikainen@nokia.com> (cherry picked from commit d7c7bf721c93fe7629f725c181b52ad9ca645a7a) Change-Id: Ie4ac69de75f50b68b2ba87353d83098846f319f4 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Optimize memory consumption for simple GPOS tablesEskil Abrahamsen Blomfeldt2012-02-152-57/+170
| | | | | | | | | | | | | | | Sometimes GPOS tables are used for kerning and can grow quite large if the font is unoptimized. In that case, allocating the maximum size for each ValueRecord will have a great impact on memory consumption. For GPOS tables which do not contain device tables, we only allocate the memory actually need to store the data instead. While it would be possible to optimize memory for GPOS tables that contain device tables as well, this is not a part of this patch. Change-Id: Id665b2821675ef955c497c782f09f99af765b8a3 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix isolated Thai SARA AM handlingJiang Jiang2012-01-171-7/+26
| | | | | | | | | | | | | | Since 5e07a3ac58f93bd5e09715d43b58c20950c2befa Thai text layout is handled by libthai to special case of the SARA AM. It didn't handle isolated SARA AM. This patch fixed it and added detailed explaination on the special case. The dotted circle should be shown rather than hidden. Add an test case to verify that with Waree. Change-Id: I4967715627cbe15f5a3e9ab3e3844420ab541aed Reviewed-by: Lars Knoll <lars.knoll@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>
* Remove TESTED_CLASS/TESTED_FILES comments from tests.Jason McDonald2011-12-061-3/+0
| | | | | | | | | These comments were mostly empty or inaccurate. Appropriate naming of tests and appropriate placement of tests within the directory tree provide more reliable indicators of what is being tested. Change-Id: Ib6bf373d9e79917e4ab1417ee5c1264a2c2d7027 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix HarfBuzz Thai character SARA AM handlingJiang Jiang2011-11-243-40/+352
| | | | | | | | | | | | | | This patch is contributed by Thanomsub Noppaburana from libthai. It added a special thai shaping function to handle SARA AM character for fonts without OpenType rules to support it, like Nokia Pure Text AS. With modification to logClusters assignment to make sure that QTextLine::glyphRuns(int from, int length) returns correct glyphs. Task-number: QTBUG-21206 Change-Id: I5a78ee1ab2b4c874c7d0df17d4ee6d264ed5a790 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Harfbuzz shaper: kerning adjustment does not need to be modified by RTLJohn Tapsell2011-11-181-1/+1
| | | | | | | Merge-request: 1435 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> (cherry picked from commit 1b928f5e41888150c4d85ff4df8a9fcab9b06d90) Change-Id: I1b928f5e41888150c4d85ff4df8a9fcab9b06d90
* Remove SkipMode parameter from QSKIP calls.Jason McDonald2011-10-211-19/+19
| | | | | | | | | The previous commit removed SkipMode from the testlib APi. This commit removes the parameter from all calls to QSKIP. Task-number: QTBUG-21851, QTBUG-21652 Change-Id: I21c0ee6731c1bc6ac6d962590d9b31d7459dfbc5 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Changed QLibrary::resolve() to return a function pointer.Kim Motoyoshi Kalland2011-07-252-2/+2
| | | | | | | | | | | According to the C++ standard, there is no guarantee that you can cast between function pointers and void pointers without data loss (section 5.2.10-6). Change-Id: I27f4d835e4c8ca8ecca0d76cfea9ce34491956bd Reviewed-on: http://codereview.qt.nokia.com/1995 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* drop an obsolete QChar::NoCategory enum valueRitt Konstantin2011-07-131-2/+0
| | | | | | | | | | | | there is no such category in the Unicode specs. the QChar::NoCategory was a subject of bugs since it was introduced. int 4.6 it's meaning was limited to mention ucs4 > UNICODE_LAST_CODEPOINT only (which is useless anyways) in order to preserve the old (wrong) behavior. fix it now for qtbase Change-Id: I630534824e071090b39772881e747c1fdb758719 Reviewed-on: http://codereview.qt.nokia.com/1584 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Don't rely on uninitialized dataJoão Abecasis2011-05-101-0/+1
| | | | | | | | | | | HB_GetCharAttributes used to require a zero-initialized array for attributes, as it selectively sets relevant bits for each character. We ease that requirement by always initializing the attributes buffer explicitly with memset. Task-number: QT-4911 Reviewed-by: Ritt Konstantin (cherry picked from commit 4cb9db404224c55859713c282aa90409e375c372)
* Initial import from the monolithic Qt.Qt by Nokia2011-04-2762-0/+27137
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12