Commit Graph

9064 Commits

Author SHA1 Message Date
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
Garret Rieger 4cbc7d61bc [ENOMEM] check for unset current in serializer->length(). 2020-07-31 02:04:06 +04:30
Garret Rieger 15644ee60e [ENOMEM] fix memory leak if allocation fails during pop_pack(). 2020-07-30 04:15:35 +04:30
Garret Rieger 42237adffc [ENOMEM] make serializer modification operations no-ops if it's in an error state. 2020-07-30 03:59:49 +04:30
Ebrahim Byagowi d1f1301490
[icu] Remove support for versions older than 49
It just doesn't make sense anymore, c9e5da8ded (r41018112)
2020-07-30 02:01:43 +04:30
Ebrahim Byagowi 0b74aaece7
[icu] Remove useless HB_UNUSED tags
As c9e5da8ded (r41018040)
2020-07-30 01:47:30 +04:30
Ebrahim Byagowi c9e5da8ded [icu] Remove support of ICU versions before 42
ICU 42 is released in 2012, see also 44a3136ae6 (commitcomment-41016353)
2020-07-30 01:03:07 +04:30
Garret Rieger 4ba8e3c6fd [ENOMEM] Fix failure to check calloc return.
Fixes https://oss-fuzz.com/testcase-detail/6246465148813312.
2020-07-30 00:08:08 +04:30
Garret Rieger d307c24abf [ENOMEM] check resize() return.
Fixes https://oss-fuzz.com/testcase-detail/5641892164009984.
2020-07-30 00:08:08 +04:30
Ebrahim Byagowi 58a5961ca1 minor spacing tweak 2020-07-29 08:44:23 +04:30
Ebrahim Byagowi 07c43b8cf6 minor spacing tweak 2020-07-29 08:42:52 +04:30
Ebrahim Byagowi 5a7cc7fd8b minor spacing tweak 2020-07-29 08:33:38 +04:30
Ebrahim Byagowi 48ad745996 [ENOMEM] Fix buffer's content check logic
So now rest of shape fuzzer also can be enabled.

Fixes #2571
2020-07-29 08:09:10 +04:30
Ebrahim Byagowi c33e8006fd [fuzz] Implement failing allocator 2020-07-29 07:35:34 +04:30
Ebrahim Byagowi 44a3136ae6 [glib] Default to glib's script type handling
2.29.14 is almost released a decade ago, no need to support archaic glib versions.
2020-07-29 07:05:31 +04:30
Garret Rieger dae32b4f12 [subset] bail out of subsetting if plan allocation fails. 2020-07-29 06:37:25 +04:30
Ebrahim Byagowi a01c7a380b 2.7.0 2020-07-25 12:40:57 +04:30
Evgeniy Reizner b32f2e8b49 Remove unused code from the Khmer shaper. 2020-07-24 20:38:05 +04:30
Ebrahim Byagowi 46ec6db965 minor 2020-07-22 17:30:48 +04:30
insilications 83c44f69d3 [tests] fix PGO build testing
Adds 'mangle_path' to IGNORED_SYMBOLS
2020-07-21 03:05:28 +04:30
Ebrahim Byagowi d0e2addd43 minor 2020-07-18 22:16:02 +04:30
Ebrahim Byagowi 7e3edfa454
minor 2020-07-18 19:03:36 +04:30
Qunxin Liu 8e5bc535d1 [subset] call collect_mapping only when --gids option is used.
collect_mapping is time consuming as it iterates all codepoints in all
cmap subtables, only trigger it when necessary
2020-07-16 11:25:53 -07:00
Ebrahim Byagowi 7c433ffde2
Add HB_CUSTOM_MALLOC definition
So one can use just HB_CUSTOM_MALLOC instead need for define each of hb_*alloc_impl
2020-07-15 09:38:12 +04:30
Ebrahim Byagowi 60959b08e5
[meson] execute find_program('gen-ragel-artifacts.py') only once
should rename the script also
2020-07-14 20:28:06 +04:30
Ebrahim Byagowi 5c8e1bd237 [meson] Don't allow introspection on static library 2020-07-14 18:02:40 +04:30
Ebrahim Byagowi 9566904cb3
[morx] minor, mark with unlikely
at least just to show this is the unusual path
2020-07-14 15:17:17 +04:30
Ebrahim Byagowi 11d583a9ea
[aat] Consume glyph insertion from buffer's max_ops (#2223)
Glyph insertion is an expensive operation and we like to have it limited
based on buffer's input size which is handled by buffer's max_ops.

clusterfuzz-testcase-minimized-harfbuzz_fuzzer-5754958982021120:

Before the change: 0.67s user 0.00s system 99% cpu 0.674 total
 After the change: 0.02s user 0.00s system 98% cpu 0.024 total

Which takes much longer on valgrind and tsan bots.
2020-07-13 18:53:06 -07:00
Ebrahim Byagowi 6937092a66 [py] apply lgtm.com python suggestions 2020-07-13 23:37:52 +04:30
Ebrahim Byagowi 2a182128b9
[py] minor, comment buffer_add_utf8 call
mainly to apply lgtm suggestion, looks better also however,
some minor spacing is also applied.
2020-07-13 20:41:13 +04:30
Ebrahim Byagowi cdf18e8338
[py] minor, remove unnecessary pass
discovered by lgtm
2020-07-13 20:07:51 +04:30
Ebrahim Byagowi 45d9e8d76c
[py] minor, remove unused import 2020-07-13 19:25:53 +04:30
Behdad Esfahbod 1dfa33854f [arabic] Remove stale comment 2020-07-12 09:24:03 -07:00
Behdad Esfahbod 6a45df0a54 Fix -Wambiguous-reversed-operator warning
Fixes https://github.com/harfbuzz/harfbuzz/issues/2554
2020-07-08 18:17:40 -05:00
jfkthame 1e6027e29c
[aat] Correct array indexing when looking up actions in KerxSubTableFormat4 (#2539)
* [aat] Correct array indexing when looking up actions in KerxSubTableFormat4.

- For action_type 0 and 1, there are 2 values per action record; for action_type 2, there are 4. So we need to account for these factors when indexing into the ankrData array.

Fixes https://github.com/harfbuzz/harfbuzz/issues/2531.
2020-07-05 22:44:10 +01:00
Ebrahim Byagowi 122a2897e4 [aat] Remove lcar support
Very low use, only two distinct font files, Apple Chancery.ttf and Hoefler Text.ttc
have it so it really doesn't worth the size addition and so, but one may argue that
whole ligature caret is low use but guess we better to encourage GDEF one anyway.
2020-07-06 00:05:36 +04:30
Ebrahim Byagowi a3b9b94b63
[style] Remove fdsc support (#2541)
It isn't exposed yet and low use between Apple fonts,
32 fdsc table vs 767 OS/2 tables, even Apple doesn't
support it anymore per Ned.
2020-07-06 00:05:21 +04:30
Ebrahim Byagowi a6fb8ce98a Minor, fix -Wrange-loop-analysis warnings
Fixing these complains raised by newer versions of clang,

./hb-ot-layout-common.hh:1720:53: error: loop variable 'gid_klass_pair' is always a copy because the range of type 'hb_map_iter_t<hb_sorted_array_t<OT::HBGlyphID>, (lambda at ./hb-ot-layout-common.hh:1672:29), hb_function_sortedness_t::RETAINS_SORTING, nullptr>' does not return a reference [-Werror,-Wrange-loop-analysis]
    for (const hb_pair_t<hb_codepoint_t, unsigned>& gid_klass_pair : + it)

And

./hb-ot-color-colr-table.hh:177:44: error: loop variable '_' is always a copy because the range of type 'hb_map_iter_t<hb_filter_iter_t<hb_map_iter_t<hb_range_iter_t<unsigned int, unsigned int>, (lambda at ./hb-ot-color-colr-table.hh:209:31), hb_function_sortedness_t::RETAINS_SORTING, nullptr>, (anonymous struct at ./hb-algs.hh:331:1) &, (anonymous struct at ./hb-algs.hh:51:1) &, nullptr>, (anonymous struct at ./hb-algs.hh:338:1) &, hb_function_sortedness_t::RETAINS_SORTING, nullptr>' does not return a reference [-Werror,-Wrange-loop-analysis]
    for (const hb_item_type<BaseIterator>& _ : + base_it.iter ())
2020-07-05 11:18:04 +04:30
Jan Alexander Steffens (heftig) 4444482297 meson: Pin harfbuzz in .pc files to the built version
This ensures that we link -subset, -icu and -gobject with a matching
version of the main library.
2020-07-04 23:16:09 +04:30
Jan Alexander Steffens (heftig) 3adcf398a0 meson: Make Requires in .pc files match autotools
Libreoffice tries to use only harfbuzz-icu.pc and assumes this includes
-lharfbuzz.
2020-07-04 23:16:09 +04:30