summaryrefslogtreecommitdiffstats
path: root/src/distancefieldgenerator
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Regenerate projects after mergewip/cmakeAlexandru Croitor2020-03-181-4/+2
| | | | | | | Plus additional adjustments. Change-Id: I0c2341ef6a5557e18df91b753f9e441c5b1a68e2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2020-03-182-1/+2
|\ | | | | | | | | | | | | Conflicts: dependencies.yaml Change-Id: Ia86822a3b64be4e17d525f6b055eadfab7215bc8
| * Add missing QPainterPath includeMitch Curtis2020-03-091-0/+1
| | | | | | | | | | | | | | | | ..\distancefieldmodel.h(197): error C2027: use of undefined type 'QPainterPath' Change-Id: I3c97811a14bb82bf5dabc86398ffcfc9cf4ff58d Reviewed-by: Andy Shaw <andy.shaw@qt.io>
| * distancefieldgenerator: Fix deprecation warningFriedemann Kleint2020-01-021-1/+1
| | | | | | | | | | | | | | | | | | Use insert() for m_glyphsPerUnicodeRange, which is a QMultiHash, fixing: distancefieldmodel.cpp:186:59: warning: 'QHash<K, V>::iterator QHash<K, V>::insertMulti(const Key&, const T&) [with Key = DistanceFieldModel::UnicodeRange; T = unsigned int]' is deprecated: Use QMultiHash for hashes storing multiple values with the same key. [-Wdeprecated-declarations] Change-Id: I58488754c67af3c31574a4b657660ac094b188ec Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Port the rest of QtToolsLeander Beernaert2019-12-121-0/+35
|/ | | | | | Change-Id: I4115bde9af38219682d0e6707bc7aa8fcb8d6bb0 Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-09-081-7/+14
|\ | | | | | | Change-Id: I0015980f763599ca60f28dd3408531d2a532cd6a
| * distancefieldgenerator: Fix performance when selecting unicode rangesEskil Abrahamsen Blomfeldt2019-09-031-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling the QItemSelectionModel::select() function that takes a single index is extremely slow, so for large ranges that span e.g. 20000 glyphs in the font, such as some of the Chinese ideographic ranges can, the application would appear to freeze for many seconds while updating the selections. Instead we use the overload that takes a QList. Metrics: For a specific CJK font, this reduces the time taken when selecting a single unicode range from 30 seconds to 70 ms. [ChangeLog][Distance Field Generator] Improved performance when selecting unicode ranges in large fonts. Task-number: QTBUG-77499 Change-Id: I7ed9bec26b3cbc7e273d305f270a4a6690a81407 Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-08-171-1/+1
|\| | | | | | | Change-Id: Ibd977a3a67db311434dc5062f23e4f7f270dbbb0
| * distancefieldgenerator: Fix garbled text with large fonts on little endianEskil Abrahamsen Blomfeldt2019-08-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When writing the texture index of each glyph into the font, we would first do toBigEndian() on an int and then truncate this to quint16, causing the texture index to be 0 for all glyphs on little endian systems. This would cause glyphs that were not located in the first texture to be garbled in the output. [ChangeLog][distancefieldgenerator] Fixed broken text rendering when generating large glyph sets. Task-number: QTBUG-77501 Change-Id: I7c2d31a6e57182f440d7f78bd6305109846ccb75 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Doc: Replace example file lists with links to code.qt.ioTopi Reinio2019-07-091-0/+1
| | | | | | | | | | | | Task-number: QTBUG-74391 Change-Id: Iced8f21af188b249a0ac59f71fa2fb7cb6a52869 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-06-272-12/+17
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I3a828f7cf61510f0bb179b760c8a335629d3c852
| * distancefieldgenerator: Fix failure reading CMAP for some fontsEskil Abrahamsen Blomfeldt2019-06-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | If all the range offsets in the type 4 subtable in CMAP is equal to 0, there is no need for a glyph ID array, so this array can actually have zero length. We did not account for this, and would fail to read those fonts. Task-number: QTBUG-76188 Change-Id: I11873fba7214d179af1fcd7ccff9a9fd1c72ce10 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * distancefieldgenerator: Fix crash with multiple texturesEskil Abrahamsen Blomfeldt2019-06-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to make sure the allocated area starts at (0,0), since we allocate a texture at [width x height], and this would be too small if it did not also account for possible gaps at the top of the cache. This happens because glyphs may sometimes end up at the edge between two textures, in which case we will reserve space for them in the second of the two even though this is not needed. So this is a deficiency in the cache logic itself, but we need to at least make sure it does not crash. [ChangeLog][distancefieldgenerator] Fixed possible crash when generating large number of glyphs with a small texture size. Task-number: QTBUG-76188 Task-number: QTBUG-76528 Change-Id: I84c87c72985f5b621d120e7526cfe071555fa7f8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * distancefieldgenerator: Remove unused variableEskil Abrahamsen Blomfeldt2019-06-201-2/+0
| | | | | | | | | | | | | | The total allocated area was never used. Change-Id: I1aad1d4349ec94e2ccc521903b304270decd1d0d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * distancefieldgenerator: Avoid exceeding max texture sizeEskil Abrahamsen Blomfeldt2019-06-201-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we use a single area allocator for all textures, a glyph on the edge between two textures, would end up spanning two textures. It would be assigned to the first, and which in turn would be expanded to account for the additional data. The result was that the texture height exceeded the maximum size set. This is actually an inherited problem from Qt Quick, but it happens more frequently with the distancefieldgenerator because you will typically generate a large number of glyphs, and also the default max size set is quite low to be on the safe side. The bandaid in this patch is to pad the texture height by the size of one glyph, which will for the most part get rid of the problem, except for fonts where a majority of glyphs exceed the em square. [ChangeLog][distancefieldgenerator] Fixed a bug where the generated textures might exceed the maximum height. Task-number: QTBUG-76528 Change-Id: I51487bbf7c46556b022bfd45cefc8776d0272de3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * distancefieldgenerator: Fix cmap error for some fontsEskil Abrahamsen Blomfeldt2019-06-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We would accidentally use the raw field from the font without converting its endianness, thus we would sanity check against the wrong length and print out error messages for some perfectly valid cmap subtables. [ChangeLog][distancefieldgenerator] Fixed bug where the tool would fail for valid fonts with the message "end of cmap table reached when parsing subtable". Task-number: QTBUG-76188 Change-Id: I7f84f4e161da705b49423ed3cc16a78cee67c607 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Doc: Clear 'moduleheader' for tool manualsTopi Reinio2019-05-031-0/+1
|/ | | | | | | | | These manuals contain no C++ API documentation, and there is no associated module headers - clearing the moduleheader variable in documentation configuration stops QDoc from warning about them. Change-Id: I71b8ec81800025d9de18b83871a9881c1246f153 Reviewed-by: Martin Smith <martin.smith@qt.io>
* Merge remote-tracking branch 'origin/5.12' into 5.12.1Liang Qi2019-01-082-0/+15
|\ | | | | | | | | | | | | Conflicts: qttools.pro Change-Id: Ibf247399306794b1d79ebbcd230b853896d0bc87
| * distancefieldgenerator: Add help actionFriedemann Kleint2018-12-102-0/+15
| | | | | | | | | | | | | | Add a help action launching the documentation page. Change-Id: I8c78ca53389faaac9e87ec116969d0002d9f1205 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Bump copyright year to 2019Kai Koehne2018-12-181-1/+1
|/ | | | | | Task-number: QTBUG-72635 Change-Id: If5acb99bff8715101ab338a694b9f2d61e066ea3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* distancefieldgenerator: Use capitalized text for actionsKai Koehne2018-11-292-6/+6
| | | | | | | | | Follow the example of other Qt tools and use capitalized text for all actions. Change-Id: I6417a098d1601a10a73232334e5f5819095187f3 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* distancefieldgenerator: Preserve window sizeKai Koehne2018-11-283-1/+11
| | | | | | | | Do not always start app as maximized; instead, save the state between runs. Change-Id: I30fb61e4b46a230ff1eb6fb93ef89df037a6afb0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* distancefieldgenerator: Add command line interfaceKai Koehne2018-11-283-18/+33
| | | | | | Fixes: QTBUG-72052 Change-Id: I52aa7081334b2515e670373c7975a9ec2bb7c00b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* distancefieldgenerator: Fix crash in select actions for empty documentKai Koehne2018-11-281-17/+12
| | | | | | Fixes: QTBUG-72051 Change-Id: Ib3862f8d592bcab54ee72cc87c4e7dbc213f1e87 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* distancefieldgenerator: Add About, About Qt dialogsKai Koehne2018-11-273-1/+39
| | | | | | | | | | This follows the pattern of all other user visible GUI tools we provide. Change-Id: I9dce96bd3b3e65bbf625177eabcc06051bcb0551 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Martin Smith <martin.smith@qt.io>
* qdistancefieldgenerator: Properly install toolv5.12.0-beta2Kai Koehne2018-10-121-0/+6
| | | | | | | | Also rename executable to qdistancefieldgenerator Change-Id: I2951c2d83fcff25d65413a548f7a692980c9b3ec Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Doc: Add an entry to the pro file to include the qdocconfVenugopal Shivashankar2018-10-012-0/+28
| | | | | | | | | | | | Without a QMAKE_DOCS entry in the project file, docs are not built for the qtdistancefieldgenerator tool. Also renamed the qdocconf file to be inline with other qdocconf files in the repo. The qdocconf file name translates to the install directory under $QT_INSTALL_DOCS. Change-Id: I6052039cbecb9dc4e447818421c588ecec675861 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Introduce distancefieldgeneratorEskil Abrahamsen Blomfeldt2018-08-2212-0/+2105
A tool that allows you to pick prepare .qdf files which are pregenerated distance fields in binary form that can be loaded by Qt to improve startup time. We currently only support cmaps subtable formats 0, 4, 6, 10 and 12, as these are either A. the most commonly used (4 and 12) or B. simple to implement. The tool writes a .ttf file which is a copy of the original file, but with the addition of a "qtdf" table that follows sfnt conventions. This way, the file will work as a normal font file, as well, which means that glyphs that are not in the pregenerated cache can easily be generated at runtime. Task-number: QTBUG-69356 Change-Id: Ib99c2d62f65e65973a60da4b1aa632b7ed3b2794 Reviewed-by: Lars Knoll <lars.knoll@qt.io>