Commit Graph

9203 Commits

Author SHA1 Message Date
Garret Rieger 8f47dd5779 [subset] don't set lookup visited in closure_lookups_context_t::recurse.
- Lookup::closure_lookups also checks if the lookups visited and sets the lookup to visited. If we set visited in 'recurse' then Lookup::closure_lookups will fail to recurse into the children of the lookup.
- Also when copying ChainRule's skip LookupRecord's that point to lookups which aren't retained. This matches FontTool's behaviour.
2021-02-09 20:34:52 -05:00
josephshen d9e0244cdf remove duplicate file names 2021-02-02 09:23:41 -08:00
Behdad Esfahbod dad41c07e4 [use] Typo 2021-02-01 11:30:39 -08:00
Behdad Esfahbod 63a716c540 [indic] Use lfind() 2021-02-01 11:30:39 -08:00
Behdad Esfahbod 921b4e46b0 [algs] Add hb_equal()
Use in hb_array_t::lfind()
2021-02-01 11:30:39 -08:00
Behdad Esfahbod f4ed3bf20b [indic] Remove categorization of Khmer Ra
Khmer goes through its own shaper these days.
2021-02-01 11:30:39 -08:00
Behdad Esfahbod 676d1e6adf [indic] Spell out INDIC_TABLE_ELEMENT_TYPE 2021-02-01 11:30:39 -08:00
Behdad Esfahbod 769c2b19a3 [indic/khmer/myanmar/use] Minor shuffling of found_syllable() macros 2021-02-01 11:30:39 -08:00
Behdad Esfahbod 59721c2f37 [use] Move data table into same compilation unit 2021-02-01 11:30:39 -08:00
Behdad Esfahbod d9b167da3d [use] Remove hb-ot-shape-complex-use.hh
Inline into ragel machine.
2021-02-01 11:30:39 -08:00
Behdad Esfahbod 3bb2653a5e [use] Reuse category numbers exported from ragel machine
Part of https://github.com/harfbuzz/harfbuzz/pull/2726
2021-02-01 11:30:39 -08:00
Behdad Esfahbod c417e0d2f9 [indic/khmer/myanmar/use] Move enum category around
Such that the generated -machine.hh headers are independent.
2021-02-01 11:30:39 -08:00
Behdad Esfahbod 675b6c2994 [indic/khmer/myanmar/use] Remove unused dump-*-data programs
In prep for streamlining tables.
2021-02-01 11:30:39 -08:00
Behdad Esfahbod 0a5c631140 [use] Rename internal enum joinint_form_t members
To ease upcoming change.
2021-02-01 11:30:39 -08:00
Behdad Esfahbod 880fdb7460 [indic/khmer/myanmar/use] Export categories from Ragel source
Not hooked up yet.

Part of alternative approach to
https://github.com/harfbuzz/harfbuzz/pull/2726
2021-02-01 11:30:39 -08:00
ckitagawa b198d94489 use {} rather than {0} 2021-01-25 14:07:52 -08:00
ckitagawa 2e50b517e1 Nicer more idiomatic fix 2021-01-25 14:07:52 -08:00
ckitagawa 8f6559a373 [subet/COLR] Default initialize firstLayerIdx 2021-01-25 14:07:52 -08:00
Behdad Esfahbod a650243d39 [sanitize] Fix typo 2021-01-24 13:30:06 -07:00
Behdad Esfahbod 881ad720fe [algs] Remove passthru declaration
Let compiler figure it out.
2021-01-21 14:27:45 -07:00
Behdad Esfahbod ca0b7afee9 [set] Use hb_fill() 2021-01-21 12:22:00 -07:00
Behdad Esfahbod 5fce8898e0 [iter] Allow passing rvalue iters to hb_fill() 2021-01-21 12:15:10 -07:00
Behdad Esfahbod 6463ee02d6 Speed up ClassDef/Coverage intersect methods
Just avoiding overhead as measured by Garret.
Should rewrite as dagger in the future and confirm that it has the
same benefits. Later on, rewrite as lfind() maybe.

Fixes https://github.com/harfbuzz/harfbuzz/issues/2826
2021-01-21 11:16:04 -08:00
Garret Rieger 33368a12b7 uint32_t to unsigned in hb-set.hh 2021-01-21 12:12:05 -07:00
Garret Rieger 2a0d0b901f Make set clear work even when set is in failed state. 2021-01-21 12:12:05 -07:00
Garret Rieger 0ba73e980c [ENOMEM] handle allocation failures during page compaction. 2021-01-21 12:12:05 -07:00
Garret Rieger a4c3732f59 [ENOMEM] fix set clear() causing corruption if the set is in_error(). 2021-01-21 12:12:05 -07:00
Khaled Hosny 9b8be9643c [docs] Ignore hb-gobject headers
Fixes https://github.com/harfbuzz/harfbuzz/issues/2797
2021-01-20 14:23:37 -08:00
Khaled Hosny 051a3c7b9a [docs] Fix typo 2021-01-20 14:22:15 -08:00
Khaled Hosny a44dd339f9 [docs] Missing param docs 2021-01-20 14:22:15 -08:00
Khaled Hosny 478d169c0f [docs] Document more deprecated symbols 2021-01-20 14:22:15 -08:00
Khaled Hosny ca0a7a8384 [docs] Document hb_ot_math_constant_t somehow 2021-01-20 14:22:15 -08:00
Khaled Hosny 3ba1e7e783 [docs] Document HB_OT_TAG_DEFAULT_LANGUAGE/SCRIPT 2021-01-20 14:22:15 -08:00
Khaled Hosny 4bfa0b3c02 [docs] Fix hb_color_get_* docs 2021-01-20 14:22:15 -08:00
David Corbett 2cdc92c0c2 [use] Move most joining scripts to USE 2021-01-18 12:06:23 -08:00
Behdad Esfahbod 5c73c9082b [syllabic] Fix signed/unsigned comparision errors 2021-01-18 12:00:58 -08:00
Behdad Esfahbod e3d4c29727 [indic/khmer/myanmar] Minor: Fix mask
Seems like a typo. No behavior change.
2021-01-18 12:00:58 -08:00
Behdad Esfahbod 0ddade44cf [syllabic] Merge various insert_dotted_circles implementations
Fixes https://github.com/harfbuzz/harfbuzz/issues/1810
2021-01-18 12:00:58 -08:00
Behdad Esfahbod e8e9fd9556 [syllabic] Add hb-ot-shape-complex-syllabic.cc/hh
Empty for now.

Part of https://github.com/harfbuzz/harfbuzz/issues/1810
2021-01-18 12:00:58 -08:00
Behdad Esfahbod 8af85c4e86 Remove hb-ot-shape-complex-machine-index.hh file
Inline code into USE header.
2021-01-18 12:00:58 -08:00
Behdad Esfahbod 9dd61c5b78 Rename internal buffer var use
Part of https://github.com/harfbuzz/harfbuzz/issues/1810
2021-01-18 12:00:58 -08:00
Behdad Esfahbod 3c5b7886eb Revert "Avoid category duplication between C++ and Ragel"
This reverts commit 67ea8133d3.

Merged accidentally on https://github.com/harfbuzz/harfbuzz/pull/2726
2021-01-15 19:26:04 -07:00
David Corbett 67ea8133d3 Avoid category duplication between C++ and Ragel 2021-01-15 18:24:52 -08:00
David Corbett c8c5e52aba [use] Update overrides to 2021-01-04
This uses the data files from
<ed7b825ddb/USE>.
2021-01-06 05:45:01 +02:00
Khaled Hosny 1fb7f3bda6 [docs] Document various HB_SCRIPT_*
Need to have something for all of them to keep GTK-Doc happy.
2020-12-30 19:21:49 -08:00
Khaled Hosny ea0907abf9 [docs] Document version macros 2020-12-30 19:21:49 -08:00
Khaled Hosny 5e9f05ff3f [docs] Expand memory modes docs
Per Behdad suggestions.
2020-12-30 19:21:49 -08:00
Khaled Hosny 5151c2b668 [introspection] Replace deprecated allow-none
Use optional or nullable as appropriate.
2020-12-30 19:21:49 -08:00
Khaled Hosny a64d56a3e5 [introspection] nullable is for pointers 2020-12-30 19:21:49 -08:00
Khaled Hosny 9936490c04 [docs] Invalid use of "optional" annotation
It is valid only for out and inout parameters.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1787
2020-12-30 19:21:49 -08:00
Khaled Hosny bf5b4b71c5 [docs] Duplicated documentation 2020-12-30 19:21:49 -08:00
Khaled Hosny 3d7a361648 [docs] Miscellaneous missing docs 2020-12-30 19:21:49 -08:00
Khaled Hosny a31a51cdec [docs] Complete hb-ft docs a bit 2020-12-30 19:21:49 -08:00
Khaled Hosny 8c492d5c32 [docs] Complete hb-ot-math docs a bit 2020-12-30 19:21:49 -08:00
Khaled Hosny 3f7ffd1b3d [docs] Complete hb-unicode docs a bit 2020-12-30 19:21:49 -08:00
Khaled Hosny 2fdab788ad [docs] Complete hb-buffer docs a bit 2020-12-30 19:21:49 -08:00
Khaled Hosny 492a5a9096 [docs] Complete hb-aat docs a bit 2020-12-30 19:21:49 -08:00
Khaled Hosny 3a012cc469 [docs] Complete hb-metrics docs a bit 2020-12-30 19:21:49 -08:00
Khaled Hosny 5a55b31a38 [docs] Complete hb-shape-plan docs a bit 2020-12-30 19:21:49 -08:00
Khaled Hosny 8e8c3e5878 [docs] Complete hb-ot-layout docs a bit 2020-12-30 19:21:49 -08:00
Khaled Hosny 5b7b730d4b [docs] Complete hb-color docs a bit 2020-12-30 19:21:49 -08:00
Khaled Hosny aa107e657b [docs] Complete hb-font docs a bit 2020-12-30 19:21:49 -08:00
Khaled Hosny 9b602e8e22 [docs] Complete hb-common docs a bit 2020-12-30 19:21:49 -08:00
Khaled Hosny c9c3b3c94c [docs] Use correct syntax 2020-12-30 23:28:26 +02:00
Khaled Hosny a8e72ee784 [docs] Use %true and %false consistently 2020-12-30 23:28:26 +02:00
Khaled Hosny a3fe43a410 [docs] Hide private enum values
"/*< skip >*/" does not seem to hide them.
2020-12-30 23:06:18 +02:00
Khaled Hosny e93de6362b [docs] Document unused language in get_baseline
Document that language_tag in hb_ot_layout_get_baseline() is currently
unused.

Fixes https://github.com/harfbuzz/harfbuzz/issues/2662
2020-12-30 11:53:46 -08:00
Khaled Hosny c7b2e64c6d [docs] make it clear that FT_Face must have size
Fixes https://github.com/harfbuzz/harfbuzz/issues/2590
2020-12-30 11:50:49 -08:00
Khaled Hosny 7236c7e29c 2.7.4 2020-12-27 01:59:00 +02:00
Khaled Hosny 010bd54040
Merge pull request #2777 from harfbuzz/docs-unicode
[docs] Improve hb-unicode docs a bit
2020-12-26 01:17:27 +02:00
Khaled Hosny 22468c8a90 [docs] Give destroy callbacks have (optional) annotation 2020-12-24 22:38:06 +02:00
Khaled Hosny 35c4a15a67 [docs] Update hb-font documentation 2020-12-24 22:34:26 +02:00
Khaled Hosny 8586f15957 [docs] Update hb-common documentation 2020-12-24 22:23:47 +02:00
Khaled Hosny e8c21e003d [docs] Remove comments the duplicate docs 2020-12-24 21:56:31 +02:00
Khaled Hosny cb319f0d80 [docs] Add some missing annotations to hb-buffer.cc 2020-12-24 21:47:05 +02:00
Khaled Hosny 9af0edd951 [docs] Document return value of hb_blob_get_data() 2020-12-24 21:41:14 +02:00
Khaled Hosny f88e845fc7 [docs] Minor fixes 2020-12-24 21:34:14 +02:00
Nathan Willis 82092d4005 [docs] Update gtk-doc comments in hb-font 2020-12-24 21:34:14 +02:00
Nathan Willis e8de26e1ef [docs] Add gtkdoc comments to hb-buffer 2020-12-24 21:34:14 +02:00
Nathan Willis d13b7eaaf1 [docs] Add gtkdoc comments to hb-blob 2020-12-24 21:34:14 +02:00
Nathan Willis 4cdb12a3fa [docs] Add gtkdoc comments to hb-common 2020-12-24 21:34:14 +02:00
Nathan Willis 922c32eb2d [docs] Add gtkdoc comments to hb-map 2020-12-24 21:30:03 +02:00
Nathan Willis 71af2c6d9b [docs] Add gtkdoc comments to hb-set 2020-12-24 21:29:56 +02:00
Nathan Willis ec98730ff6 [docs] regularize whitespace in function params 2020-12-24 21:29:47 +02:00
Khaled Hosny fdf3e448fd [docs] Improve hb-unicode docs a bit
Down to only one warning.
2020-12-24 00:52:02 +02:00
Khaled Hosny 0fd6144a5f [docs] Fix warnings about unknown annotations
Use square brackets so that gtk-doc does not consider these to be
annotations.
2020-12-24 00:20:24 +02:00
Khaled Hosny 71a3b54f3c 2.7.3 2020-12-23 15:33:15 +02:00
Behdad Esfahbod 8560c3e355
Merge pull request #2774 from harfbuzz/misc-doc
Doc fixes
2020-12-23 00:25:10 -08:00
Ryan 769a21aab6 meson: avoid regenerating hb-version.h unnecessarily
The file is a dependency for the library as a whole, so previously editing the Meson build files at all would force a full rebuild. This will only rebuild it if the version has changed.
2020-12-23 00:22:06 -08:00
Khaled Hosny c2e2c40bac [docs] Fix gtk-doc comment syntax
The documentation was not picked otherwise.
2020-12-23 00:58:49 +02:00
Khaled Hosny 0826940821 [docs] Add messing sections
Docs for these sections were not generated at all.
2020-12-23 00:58:49 +02:00
Khaled Hosny b8b13018ed [docs] Make gtk-doc find these typedef’s 2020-12-23 00:58:43 +02:00
Khaled Hosny 8c3a530fd7 [docs] Some formatting fixes 2020-12-22 23:52:46 +02:00
Behdad Esfahbod 25c0a792e3 Remove unused+wrong UnsizedArrayOf<> operators
Said compiler is wrong to err since they are unused. But yeah, they
didn't make sense and were copy/paste leftover.

Fixes https://github.com/harfbuzz/harfbuzz/issues/2763
2020-12-10 14:29:47 -07:00
Khaled Hosny 07e304b2a4
Merge pull request #2755 from Myaamori/master
meson: use meson.current_source_dir() instead of @CURRENT_SOURCE_DIR@
2020-12-01 22:32:19 +02:00
Behdad Esfahbod 7c241651ac [algs] Don't forward rvalue twice
Part of https://github.com/harfbuzz/harfbuzz/issues/2293
2020-11-30 16:38:53 -07:00
Behdad Esfahbod 53806e5b83 Tiny improvement on previous commit
Functionally the same.
2020-11-25 11:51:37 -07:00
Dominik Röttsches a5f6f869e8 Drop layout table if layout lookup accelerator allocation failed
If the table is kept, when the table is present but only the accelerator
allocation failed, then we run into nullptr dereferences downstream in
hb_ot_map_t::apply when trying to access proxy.accels[i].

To fix this, instead of only setting lookup_count of accelerator_t
itself, drop the whole table to avoid hb-ot-map construction assuming
that the lookups will work correctly despite accelerator allocation
having failed.

Fixes:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=24490
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=24490
2020-11-25 10:18:04 -08:00
Myaamori 5f32fdff11 meson: use meson.current_source_dir() instead of @CURRENT_SOURCE_DIR@
@CURRENT_SOURCE_DIR@ is not listed as a valid string substitution
for custom targets in the Meson reference, and in practice
it does not get substituted when using the vs2019 backend.
2020-11-24 01:29:24 +00:00
David Corbett b2e7bb2a7c Don’t map BCP 47 to coincidentally similar OT tag 2020-11-22 19:35:47 -08:00
David Corbett e1df2c5277 Map ISO 639 code qul to language system tag 'QUH ' 2020-11-22 11:52:23 -07:00
Khaled Hosny f579c66108 Mark variable unused
Hopefully fixes build with newer ragel.

https://github.com/adrian-thurston/ragel/issues/56

Fixes https://github.com/harfbuzz/harfbuzz/issues/2752
2020-11-21 08:41:06 -07:00
David Corbett f83496a910 [use] Remove workaround for reserved code points
See <https://github.com/microsoft/font-tools/issues/12>.
2020-11-20 15:37:37 -07:00
David Corbett 17da41bd06 Update language system tag registry to OT 1.8.4 2020-11-18 11:13:35 -08:00
Simon Cozens fd8f4ffcc6 Trace reorder, not normalize 2020-11-17 09:05:40 +00:00
Simon Cozens 2e0193d741 Add more cast spaces 2020-11-17 09:05:40 +00:00
Simon Cozens 4bb6d54e3b Missing cast 2020-11-17 09:05:40 +00:00
Simon Cozens 8e1bedc50b Keep phase names 2020-11-17 09:05:40 +00:00
Simon Cozens 428c111f13 Fix spacing around casts 2020-11-17 09:05:40 +00:00
Simon Cozens f19018da41 Smaller issues from review 2020-11-17 09:05:40 +00:00
Simon Cozens 8b3b835a0a Trace normalization and preprocessing stages 2020-11-17 09:05:40 +00:00
Simon Cozens b50099bff2 Trace reordering in pause functions 2020-11-17 09:05:40 +00:00
Fabrice Fontaine 0c3dcfae19 Merge remote-tracking branch 'upstream/master' 2020-11-17 07:31:07 +01:00
David Corbett 3bd43bd023 Map more ISO 15924 variants to `hb_script_t`s 2020-11-16 22:18:15 -08:00
David Corbett 27170e058d Fix names for language tag in gen-tag-table.py
A BCP 47 language tag with both a script subtag and a region subtag
would be printed as a human-readable name in hb-ot-tag-table.hh as if it
only had its language subtag.
2020-11-16 10:59:07 -08:00
David Corbett 49ebb9ebdd [use] Remove redundant O entries from the table 2020-10-17 22:07:34 +02:00
David Corbett 79fd5ce22e [use] Merge IND and Rsv classes into O 2020-10-17 22:07:34 +02:00
Behdad Esfahbod cde2cf84c0 [use] Minor clean-up of unused categories 2020-10-17 11:22:19 -04:00
David Corbett 0792690b73 [use] Skip WJ and ZWJ when clustering 2020-10-16 22:39:46 -07:00
Laurenz 3fcf466b7b [hb-shape-fallback] Use signed int for correction 2020-10-16 17:57:38 -07:00
Behdad Esfahbod 77e704d1db [buffer] Add assert_unicode()/assert_glyphs() and use internally 2020-10-15 02:02:04 -06:00
Behdad Esfahbod 5ef0613909 [buffer] Add ensure_glyphs()/ensure_unicode()
Use in deserialize. To be used more.
2020-10-15 01:54:28 -06:00
Behdad Esfahbod 3232e6f2a9 [buffer] Add hb_buffer_has_positions()
Fixes https://github.com/harfbuzz/harfbuzz/issues/2716
2020-10-15 00:20:17 -06:00
David Corbett dec52006d9 Map BCP 47 tags to all macrolanguages
The general rule is that if a BCP 47 macrolanguage maps to an OpenType
language system tag, all its individual languages map to it too.
Previously, a tag like "prs" (Dari) would not map to the language system
tag ('FAR ') of its macrolanguage ("fa") because "prs" already has its
own language system tag ('DRI '). That exception has been removed: now
"prs" maps to 'DRI ' and falls back to 'FAR '.
2020-10-11 11:38:40 -07:00
David Corbett 1d53268dfe Fix two-way mapping of "man" and 'MNK ' 2020-10-11 11:38:40 -07:00
David Corbett ab38cf6746 Map hy-arevmda to 'HYE ' instead of HYE0 2020-10-11 11:38:40 -07:00
David Corbett 916c5a9007 Consistently emit BCP 47 subtag scope suffixes 2020-10-11 11:38:40 -07:00
Behdad Esfahbod 1c05f6789b [buffer] Increase work limits
Our previous limits of 64 per input character was already hit
by David Corbett's under-development Duployan font.

Increase work limits by factor of 16, and number of glyphs by factor of 2.

Fixes https://github.com/harfbuzz/harfbuzz/issues/2707
2020-10-11 12:28:25 -06:00
Behdad Esfahbod b37edebfcb [buffer/deserialize] Do not clear() buffer upon content type mismatch
We return false. I don't see reason to clear buffer.
2020-10-09 22:27:56 -06:00
Behdad Esfahbod c396e1600f [buffer/deserialize] Accept arbitrary glyph names
Accepts escapes. Added TODO items for matching escaping in serialize().
2020-10-09 22:27:56 -06:00
Behdad Esfahbod 4a4eebcf86 [buffer/serialize] Minor renames in Ragel machines
As per my previous review on:
https://github.com/harfbuzz/harfbuzz/pull/2687
2020-10-09 22:27:56 -06:00
Behdad Esfahbod 78fb6a11af Whitespace 2020-10-09 22:27:55 -06:00
Behdad Esfahbod 140552cec9 [buffer/serialize] Only serialize empty buffers of CONTENT_TYPE_INVALID 2020-10-09 22:27:55 -06:00
Behdad Esfahbod 8f5d8b155c [buffer] Buffer start <= end <= len requirement in (de-)serialize 2020-10-09 22:27:55 -06:00
Behdad Esfahbod 3b64122a7f [buffer] Fix immutable case with end_ptr==nullptr 2020-10-09 22:27:55 -06:00
Simon Cozens 7c0bc0bb92 Serialize invalid buffer to !! (text) or [] (json)
There is no generic deserialize - you have to choose glyphs or unicode - so there is no way to deserialize this buffer.
2020-10-09 22:27:55 -06:00
Simon Cozens 5bb88c4f45 Oops debug print 2020-10-09 22:27:55 -06:00
Simon Cozens f56eb402f0 Immutable buffer fix 2020-10-09 22:27:55 -06:00
Simon Cozens 150f391438 Prohibit mixed glyphs/unicode buffers in deserialization 2020-10-09 22:27:55 -06:00
Simon Cozens 6b1726b6ef Typos 2020-10-09 22:27:55 -06:00
Simon Cozens 3d3c87e7e7 Put the flags back in and serialize clusters.
Note that now JSON glyph buffers and Unicode buffers look very similar, except for the g/u property difference.
2020-10-09 22:27:55 -06:00
Simon Cozens c03a2001b2 Deserialization routines for Unicode buffers 2020-10-09 22:27:55 -06:00
Simon Cozens c0716bb5dc Move delimiter addition into hb-buffer-serialize 2020-10-09 22:27:55 -06:00
Simon Cozens 36ede56962 Fix docs
Note the delimiters stuff isn’t true yet, will be working on that
2020-10-09 22:27:55 -06:00
Simon Cozens bb7b634cd0 Simplify JSON unicode serialization
It’s just an array of codepoints; no need to turn them into objects
2020-10-09 22:27:55 -06:00
Simon Cozens 57a528ab2c Convert tabs to spaces 2020-10-09 22:27:55 -06:00
Simon Cozens aff6a36266 Use auxbuffer for serialize_unicode_text 2020-10-09 22:27:55 -06:00
Simon Cozens 58bcc1cedd Serialize Unicode buffers 2020-10-09 22:27:55 -06:00
David Corbett c39ab82c90 Fix usage text of gen-use-table.py 2020-10-06 16:51:40 -04:00
Garret Rieger aace09a3ad [subset] Use glyphset gsub for layout variation indices collection. 2020-10-06 10:26:17 -07:00
Garret Rieger 1d9801e012 [subset] In AnchorMatrix::subset eliminate the use of dynamically allocated vector. 2020-10-05 14:43:29 -07:00
Garret Rieger 093909b2ff [subset] Fix wrong offset base for subsetting LigatureArray.
Offsets from LigatureArray must be relative to the beginning of the LigatureArray table. For the serialization mechanism to use the correct beginning point the LigatureArray must be created using the push()/pop() mechanism. So convert LigatureArray subsetting to use serialize_subset() instead of a manually called serialize and subset.
2020-10-05 13:14:53 -07:00
Garret Rieger 147e93b910 [subset] Fixes to get GPOS 5 subsetting code compiling. 2020-10-01 16:45:57 -07:00
Qunxin Liu 3a0b05faf1 [subset] GPOS 5 MarkToLigature subsetting support 2020-10-01 15:59:16 -07:00
Garret Rieger 718bf5aab3 [subset] only keep features reachable from script in the final subset.
Matches fontTools behaviour.
2020-09-29 13:16:01 -07:00
Garret Rieger e583505334 [subset] Use plan->glyphset_gsub instead of plan->glyphset for GSUB/GPOS
This matches fontTools behaviour. glyphset_gsub does not contain gids added from closing over composite glyphs in glyf, since these cannot particpate in GSUB/GPOS processing.
2020-09-29 11:16:15 -07:00
David Corbett a99e8721bf [use] Fix tests with MSVC 2020-09-29 09:54:33 -04:00
Garret Rieger 940e1c6f98 [subset] ChainContextFormat3 - don't subset glyph sequences.
The backtrack, input, and lookahead sequence must be matched in their entirety so these sequences should not be subset. If any of the coverage tables in a sequence subsets to empty then the whole subtable should be dropped since it's not possible for this lookup to be activated.
2020-09-28 17:22:01 -07:00
Garret Rieger e31c2690f8 [subset] remove unnecessary returns. 2020-09-28 16:51:25 -07:00
Garret Rieger ad241f9917 [subset] check that sub rules in ChainContextFormat 1 and 2 intersect the glyphs set before recursing during closure lookups. 2020-09-28 15:26:13 -07:00
Garret Rieger 9fad540245 [subset] check that sub rules in ContextFormat 1 and 2 intersect the glyphs set before recursing during closure lookups. 2020-09-28 13:24:25 -07:00
Koji Ishii 7e6070a47f Set *coord to nullptr 2020-09-28 08:36:41 -06:00
Koji Ishii 4e0bddb7fe get_baseline 2020-09-28 08:36:41 -06:00
Khaled Hosny cc7b3a1abd [Docs] Address review comments 2020-09-26 10:22:39 +02:00
n8willis 41b46a3cb2 Update hb-face.cc 2020-09-26 09:47:27 +02:00
n8willis 726e320ece Update inline doc for hb_face_create: explain index 2020-09-26 09:47:27 +02:00
Nathan Willis 70331ca485 [Docs] Minor
update GTK-Doc comments in hb-ot-layout.
2020-09-26 09:47:13 +02:00
Nathan Willis eb10ef46aa [Docs] Add GTK-Doc comments for hb-ot-font and hb-ot-shape. 2020-09-26 09:46:15 +02:00
Nathan Willis 3e72febde0 [Docs] Add GTK-Doc comments for hb-face. 2020-09-26 09:46:15 +02:00
Nathan Willis 88cdea60e0 [Docs] Add GTK-Doc comments to hb-shape-plan. 2020-09-26 09:46:10 +02:00
Nathan Willis 5b43eb5a4c [Docs] Add GTK-Dod comments to hb-unicode. 2020-09-26 09:42:22 +02:00
Garret Rieger a5c0ec7516 [subset] For [Chain]ContextFormat3 make sure the sub table intersects the retained glyphset before recursing to its lookups.
Otherwise the lookup closure will potentially pull in lookups which cannot be accessed via the retained glyph set.
2020-09-25 14:57:20 -07:00
Garret Rieger dc375559fd [subset] shrink the serialize buffer when pruning empty offsets in ChainContextFormat2.
Currently the code reduces the array length, but does not trim back the space allocated in the serializer for those empty offsets.
2020-09-25 13:08:46 -07:00
Garret Rieger 90eb1a40eb [subset] In ChainContextFormat3 don't skip subsetting if backtrack or lookahead are empty.
It's valid to have a ChainContextFormat3 with either an empty backtrack or lookahead. Only drop the lookup if the input sequence is empty.
2020-09-25 12:36:32 -07:00
Fabrice Fontaine 2604201ae0 src/meson.build: allow introspection when cross-compiling
introspection can be enabled when cross-compiling on certains conditions
(for example it is supported by buildroot) so, as suggested by
Tim-Philipp Müller, disable it by default for cross builds unless the
option was explicitly enabled by the user

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2020-09-25 18:40:43 +02:00
Khaled Hosny df00f45e26 Fix annotation in previous commits 2020-09-24 11:57:46 +02:00
Nathan Willis 5a695a79a0 Swap # for () in gtk-doc function mention. 2020-09-24 11:57:46 +02:00
n8willis 379be7b7c8 Update src/hb-ot-var.cc
Co-Authored-By: Khaled Hosny <khaledhosny@eglug.org>
2020-09-24 11:57:46 +02:00
Nathan Willis 938add712a Add GTK-Doc comments for hb-ot-var. 2020-09-24 11:55:09 +02:00
Khaled Hosny 9a1be3fed5 Fix enum documentation syntax 2020-09-22 16:46:03 +02:00
n8willis 3c9244e662 Update src/hb-aat-layout.cc
Co-Authored-By: Khaled Hosny <khaledhosny@eglug.org>
2020-09-22 15:59:42 +02:00
Nathan Willis d619ba0681 Add gtk-doc documentation to AAT layout functions and enums. 2020-09-22 15:59:14 +02:00
Nathan Willis 514e6baaf0 [gtk-doc] document AAT functions and enums. 2020-09-22 15:59:11 +02:00
Behdad Esfahbod a1f4d285e1 [buffer] Fix invalid write access in hb_buffer_deserialize_glyphs()
If buffer is immutable, we were trying to set content_type on it.
Ouch!
2020-09-21 16:50:11 -06:00
ebraminio 1f8b1e7f18
[ENOMEM] Return gracefully if stages isn't initialized correctly (#2639)
This happens if calls to 'm.lookups[table_index].push ()' has been
silently failed due to lack of memory.

This change just returns gracefully instead issuing the assert.

Fixes https://crbug.com/oss-fuzz/24494
2020-09-21 11:39:38 +03:30
Behdad Esfahbod e40c0d82e2 [ENOMEM] Handle immutable buffer in shape_full()
Move the content_type changing to shape_plan_execute() where it belongs.
Skip setting if content type is UNKNOWN, which happens with empty buffers
only, including the immutable buffer.

Alternate fix to https://github.com/harfbuzz/harfbuzz/pull/2606
and https://github.com/harfbuzz/harfbuzz/pull/2625
2020-09-16 12:48:30 -06:00
Garret Rieger bbbcad0dbb Revert "[ENOMEM] don't perform set process operations if the other set is in an error state."
This reverts commit f3929abafe.
2020-09-16 12:23:38 -06:00
Garret Rieger f3929abafe [ENOMEM] don't perform set process operations if the other set is in an error state.
Running a process while the other set is in an error state can potentially corrupt this sets map map (for example by overwritting all of the major values with 0).
2020-09-16 10:36:30 -07:00
Simon Cozens 584d3a43b2
Merge pull request #2681 from khaledhosny/myanmar-liga
[myanmar] Don’t disable liga feature
2020-09-16 15:08:50 +01:00
Khaled Hosny 7d64b09765 [myanmar] Don’t disable liga feature
This seems to have been carried over from the Indic shaper, but
Uniscribe enables it by default.

See https://github.com/harfbuzz/harfbuzz/issues/2213#issuecomment-686062915
2020-09-12 21:45:19 +02:00
Garret Rieger 8c3d4de796 [subset] Fix integer underflow in ContextFormat2. 2020-09-11 15:52:46 -07:00
David Corbett ac3f859a30 Demote unregistered vendor-specific language tags 2020-09-09 17:50:59 -04:00
Khaled Hosny ee12c078ed
Merge pull request #2668 from rossburton/meson
meson: add hb-version.h to dependencies correctly
2020-09-08 15:37:30 +02:00
Khaled Hosny 695d85ca32
Merge pull request #2674 from rossburton/reprod
src/hb-gobject-enums.cc.tmpl: write out only the filename, not the full path
2020-09-08 15:37:00 +02:00
David Corbett 91fe20f0f5 Disambiguate OT tags when primary tag is not first 2020-09-08 09:20:00 -04:00
Alexander Kanavin e876886d1e src/hb-gobject-enums.cc.tmpl: write out only the filename, not the full path
This is beneficial for reproducible builds, as build paths can vary
between builds.
2020-09-08 11:00:32 +01:00
Ross Burton 5aff83104e [build] generate hb-version.h once at configure time with Meson
Currently with Meson hb-version.h is generated during the build without
any explicit dependencies which can result in build failures due races
over the file.

Change this to be generated at configure time, so that the file is always
generated once before the build itself.

Closes #2667
2020-09-08 09:42:27 +01:00
Ross Burton bc1c93fbe0 [build] No need to pass source directory to gen-hb-version
The input file is by definition in the source directory, so dirname()
that instead of needing the directory to be passed.

Needed because a follow-up commit will change when this is called, and the
source directory isn't trivially available at that point.
2020-09-08 09:40:56 +01:00
David Corbett faf09f5466 [USE] Support hieroglyph clusters 2020-09-02 19:50:49 -04:00
David Corbett 06f49fc8ae [USE] Update to the 2020-08-13 USE specification
This also uses the data files from
<78b2134fdc/USE>.
2020-09-02 19:50:49 -04:00
David Corbett 6a38adeb57 [use] Skip most default ignorables when clustering 2020-09-02 15:51:15 -07:00
David Corbett 645f4e7cdd Unhide CGJ before ccc=0 characters
If a CGJ precedes a starter, then it cannot have blocked any reordering,
so it can safely be skipped.
2020-09-02 15:51:15 -07:00
Garret Rieger 9825e3dd2e [ENOMEM] fix access to unitialized memory.
If the serialize() call fails to write the object then we can't safely read varstore_prime fields. Fixes https://oss-fuzz.com/testcase-detail/5137462782066688.
2020-09-02 11:01:07 -07:00
Khaled Hosny fe6381d9f1 [build] Minor 2020-09-01 03:44:01 +02:00
ebraminio a4f3a752dd [build] hb-directwrite needs a C++ linker 2020-09-01 03:21:12 +02:00
Khaled Hosny 9c98b2b9a9 2.7.2 2020-08-29 00:39:42 +02:00
David Corbett a495a54236 Ignore T & U when determining the joining scripts 2020-08-28 14:33:25 -04:00
David Corbett 420a74f772 [USE] Fix assertion failure for joining scripts 2020-08-28 14:11:48 -04:00
ebraminio 1e48225ca3
[ENOMEM] Check whether serialize context isn't in error 2020-08-13 23:22:14 +04:30
Ebrahim Byagowi 05ef75c553 2.7.1 2020-08-13 20:54:53 +04:30
Ebrahim Byagowi 253a8f7a51 [meson] Another approach to skip tests incompatible with MSVC 2020-08-13 18:28:42 +04:30
Ebrahim Byagowi 411b426c69 [meson] minor 2020-08-13 18:28:42 +04:30
Ebrahim Byagowi 6e32145dc9 [meson] Make compatbile with 0.47.0 2020-08-13 18:28:42 +04:30
Ebrahim Byagowi 58209c86a0 [meson] Make compatbile with 0.49.0
Contains a just put together summary feature polyfill and workaround
to broken ternary operator.
2020-08-13 18:28:42 +04:30
Garret Rieger 1e4fe10b98 [ENOMEM] check for error in visited map during closure features. 2020-08-13 01:43:11 +04:30
Garret Rieger 9562239f05 [ENOMEM] check for error in lookup visited set. 2020-08-13 01:43:11 +04:30
Tom Schoonjans eea9b59fc5 [meson] fix generating introspection
Only libharfbuzz_gobject is introspectable, not libharfbuzz. Therefore,
it makes no sense to target the latter for introspection: it should
instead be listed as a dependency.
2020-08-12 16:07:30 +04:30
David Corbett 7bffb5d7ba Generate `has_arabic_joining` 2020-08-12 11:34:49 +04:30
Garret Rieger 6f754852c1 [ENOMEM] skip asserts in to_bias if serializer is in an error state. 2020-08-12 11:25:30 +04:30
Ebrahim Byagowi ef2e380342 Revert "Remove cmake-config support of HarfBuzz"
This reverts commit 75efa89343.
2020-08-12 01:00:33 +04:30
Ebrahim Byagowi 0ca3557048 Turn -Wunused-but-set-variable to warning
As #2555 turned out some glib headers are imposing that so let's turn it to warning
2020-08-12 00:38:00 +04:30
Ebrahim Byagowi 5193357832 Revert "Remove autotools build support"
This reverts commit 01ac32aab2.
2020-08-11 23:51:59 +04:30
Ebrahim Byagowi 9748ae7299 Revert "Reordering fails when GDEF table is absent #2140"
This reverts commit f4cd99f28e.

As requested in https://github.com/harfbuzz/harfbuzz/issues/2516#issuecomment-670969185
2020-08-11 22:51:48 +04:30
ebraminio d03eecb4d6
[glyf] minor
style improvement
2020-08-11 16:40:40 +04:30
ebraminio 732a9164d9
[gvar] minor 2020-08-11 16:37:55 +04:30
ebraminio 0c1561894a
[glyf] minor 2020-08-10 08:52:01 +04:30
Ebrahim Byagowi f06d7331e8 [glyf] minor 2020-08-10 08:43:54 +04:30
Ebrahim Byagowi db96c7f67a [glyf] protect CompositeGlyph fields
Introduce methods instead
2020-08-10 08:43:54 +04:30
ebraminio e5fe363aa5
[glyf] Minor, don't pass accelerator_t to points_aggregator_t
No need to pass it to aggregator itself
2020-08-10 07:39:36 +04:30
ebraminio 2b9927f7e1
[glyf] minor
No need to pass glyph_for_gid as a lambda now that we are passing the accelerator itself
2020-08-10 06:26:21 +04:30
Behdad Esfahbod fce64a407d Minor 2020-08-08 14:05:03 -06:00
Ebrahim Byagowi ffe06c8f04 [glyf] Guard all the public APIs against null pool runs
Fixes https://crbug.com/oss-fuzz/24575 and https://crbug.com/oss-fuzz/24737
2020-08-08 13:43:49 +04:30
Ebrahim Byagowi 01ac32aab2 Remove autotools build support 2020-08-07 23:28:12 +04:30
Ebrahim Byagowi 1f519c2567
[glyf] Optimize retrieval of hmtx/vmtx/gvar
This should make glyf/gvar faster as makes it to invoke less table wrapper atomic operations and things.

$ meson build -Dexperimental_api=true --buildtype=release && ninja -Cbuild && build/perf/perf "--benchmark_filter=glyf.*- ot -"

Before:
extents/glyf - ot - SourceSerifVariable         46091 ns      46036 ns      16173
extents/glyf/vf - ot - SourceSerifVariable    4160142 ns    4154913 ns        174
extents/glyf - ot - Comfortaa                   25754 ns      25726 ns      27030
extents/glyf/vf - ot - Comfortaa              2627804 ns    2624596 ns        265
extents/glyf - ot - Roboto                      33556 ns      33540 ns      18513
draw/glyf - ot - SourceSerifVariable          2716848 ns    2715438 ns        256
draw/glyf/vf - ot - SourceSerifVariable       4602379 ns    4598907 ns        151
draw/glyf - ot - Comfortaa                    1659364 ns    1658142 ns        417
draw/glyf/vf - ot - Comfortaa                 2845100 ns    2842549 ns        246
draw/glyf - ot - Roboto                       1571509 ns    1570060 ns        442

After:
extents/glyf - ot - SourceSerifVariable         34738 ns      34713 ns      21332
extents/glyf/vf - ot - SourceSerifVariable    3700510 ns    3698104 ns        187
extents/glyf - ot - Comfortaa                   21604 ns      21595 ns      31907
extents/glyf/vf - ot - Comfortaa              2324787 ns    2323440 ns        296
extents/glyf - ot - Roboto                      31259 ns      31246 ns      21814
draw/glyf - ot - SourceSerifVariable          2689230 ns    2687589 ns        260
draw/glyf/vf - ot - SourceSerifVariable       4625135 ns    4622036 ns        131
draw/glyf - ot - Comfortaa                    1690336 ns    1689454 ns        402
draw/glyf/vf - ot - Comfortaa                 2898748 ns    2897074 ns        241
draw/glyf - ot - Roboto                       1570911 ns    1570138 ns        440
2020-08-07 01:21:19 +04:30
Ebrahim Byagowi 0907c10214
[gvar] minor 2020-08-07 00:15:32 +04:30
Ebrahim Byagowi 679fac87df Skip hb_shape if buffer object is immutable 2020-08-06 23:47:35 +04:30
Ebrahim Byagowi 55c41f219f
[glyf] Clamp advance value result
Fixes a sanitizer complain https://circleci.com/gh/harfbuzz/harfbuzz/150247 revealed by 02d1ec1
2020-08-06 23:37:43 +04:30
Ebrahim Byagowi 02d1ec1658
[gvar] Don't fail on imprefect gvar
No need to fail even if gvar doesn't have that much glyphs
2020-08-06 22:18:35 +04:30
Ebrahim Byagowi ec17b62457
[var] Apply variations on empty glyphs
It was ignoring empty glyphs for no good reason, this fixes it.

Fixes #2618
2020-08-06 20:16:11 +04:30
Ebrahim Byagowi 5cab55ca90
[gvar] minor 2020-08-06 18:54:58 +04:30
Ebrahim Byagowi 75efa89343 Remove cmake-config support of HarfBuzz
Reverts d38f37b2 as discussed in #2316
2020-08-03 16:45:17 +04:30
Ebrahim Byagowi 11bb8aa83e
[meson] limit check-libstdc++ check to 0.55
library(..., link_language: 'c') is introduced in 0.55 but we were relying on this anyway
assuming b_asneeded being true on meson.

#2614
2020-08-02 00:47:21 +04:30
Ebrahim Byagowi 9d3fbe0588 [meson] Add darwin versions to library()
We now have,

$ otool -L src/libharfbuzz.dylib
src/libharfbuzz.dylib:
	@rpath/libharfbuzz.0.dylib (compatibility version 0.0.0, current version 0.0.0)

And with the change should we get

$ otool -L src/libharfbuzz.dylib
src/libharfbuzz.dylib:
	@rpath/libharfbuzz.0.dylib (compatibility version 20700.0.0, current version 20700.0.0)
2020-08-02 00:34:29 +04:30
Garret Rieger 18ab8029d5 [ENOMEM] check vector status in cmap subsetting. 2020-08-02 00:30:17 +04:30
Garret Rieger 06dbb6acbb [ENOMEM] in GSUB ChainContext subsetting check maps for allocation errors. 2020-08-01 09:21:22 +04:30
Garret Rieger fb1477795c [ENOMEM] Check result of vector resize in CBDT subsetting. 2020-08-01 09:20:52 +04:30
Ebrahim Byagowi efd716de3f [cff] Check for scalars array resize result
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=24504
2020-07-31 09:27:27 +04:30
Garret Rieger 040ed094ef [ENOMEM] popragate packed/packed_map errors to the serializer.
Will disable further modifications based on a bad state.
2020-07-31 08:39:26 +04:30
Garret Rieger 7f358a55f4 [ENOMEM] unchecked resize in CFF2. 2020-07-31 02:04:06 +04:30
Garret Rieger 32f052b033 [ENOMEM] Fix several instances of not checking resize in CFF. 2020-07-31 02:04:06 +04:30