Commit Graph

195 Commits

Author SHA1 Message Date
Behdad Esfahbod 0d160d5ff5 [subset] Implement subsetting of SingleSubst 2018-09-04 14:20:35 -07:00
Behdad Esfahbod dc50493a8d [subset] Towards subsetting SingleSubstFormat1
Why does subset plan not have a hb_set_t of glyphs?
2018-09-03 18:23:23 -07:00
Behdad Esfahbod 339d3603b9 [subset] Wire up subset() call down to subtables 2018-09-03 17:40:16 -07:00
Behdad Esfahbod 7b2ef551da Templatize Lookup::sanitize() 2018-09-03 17:16:09 -07:00
Behdad Esfahbod 9c3747c5e5 [subset] More 2018-09-03 16:53:03 -07:00
Behdad Esfahbod 6d618522d6 Templatize GSUBGPOS::sanitize() 2018-09-03 16:41:28 -07:00
Behdad Esfahbod 49c44b58f6 [subset] Fix serialize_subset() calls
Ouch.
2018-09-03 16:37:17 -07:00
Behdad Esfahbod 7c9cfa2b40 Add intersects() method to GSUB/GPOS lookups 2018-09-02 19:47:50 -07:00
Behdad Esfahbod bfa72a9a72 [subset] Towards GSUB/GPOS subsetting
Add subset() call for GSUBGPOS struct and its dependencies.
Not hooked up anywhere.
2018-09-01 18:34:50 -07:00
Behdad Esfahbod e58b190292 [subset] De-templatize hb_subset_context_t
We're going to (finally) use virtual methods for hb_serialize_context_t
customization, so don't need to carry a Serializer template variable
around...  Simplifies code.
2018-08-31 16:46:35 -07:00
Behdad Esfahbod 22acd424ca [serialize] Add a couple small methods 2018-08-31 16:41:18 -07:00
Behdad Esfahbod d1f29908c2 [subset] Add hb_subset_context_t<> 2018-08-31 16:31:00 -07:00
Behdad Esfahbod 3a0b3a29cc Free up hb-ot-face.hh from includes
There might be a better way to do this, but I couldn't find...
2018-08-26 15:11:24 -07:00
Behdad Esfahbod c624e18a24 [OT] Move code around 2018-08-26 09:19:20 -07:00
Behdad Esfahbod 3999094682 [OT] Use relaxed ops for recursing into GSUB/GPOS lookups again 2018-08-26 09:12:25 -07:00
Behdad Esfahbod b929100f87 [ot-face] Unify GSUB/GPOS accelerators in the table accelerator framework 2018-08-26 01:15:47 -07:00
Behdad Esfahbod 963413fc54 WIP 2018-08-26 00:47:55 -07:00
Behdad Esfahbod c77ae40852 Rename hb-*private.hh to hb-*.hh
Sorry for the noise, downstream custom builders.  Please adjust.
2018-08-25 22:36:36 -07:00
Behdad Esfahbod acce1fa3ea Use new hb_auto_t<> constructor with Coverage::Iter 2018-08-25 21:15:39 -07:00
Behdad Esfahbod 1c6b369324 [ot] Rename hb_ot_layout_t to hb_ot_face_data_t 2018-08-23 11:30:21 -07:00
Behdad Esfahbod 74b4df2cde [ot] Move GDEF into tables_t 2018-08-03 16:58:05 -07:00
Behdad Esfahbod 0271c7ab3b [ot] Move GSUB/GPOS into tables_t 2018-08-03 16:45:57 -07:00
Behdad Esfahbod c38bd4025f [closure] Separate in and out glyphs
Fixes https://github.com/harfbuzz/harfbuzz/issues/1107
2018-07-24 13:47:32 -07:00
Behdad Esfahbod bddeb2b10c Minor renamings of internal inline functions 2018-07-10 14:13:21 +02:00
Behdad Esfahbod ba0ea56efa [substitute-closure] Rename function for clarity 2018-06-12 01:17:00 -04:00
Behdad Esfahbod 7b5ce41638 Whitespace 2018-06-12 01:17:00 -04:00
Garret Rieger 45186b9b8c [subset] Add memoization of GSUB lookup closures. 2018-06-06 16:53:50 -06:00
Behdad Esfahbod 63f57f4dab Mark more unsized array's as arrayZ 2018-05-08 16:56:11 -07:00
Ebrahim Byagowi a02c3ee70f Add or update tables specifications links 2018-04-12 13:44:32 +04:30
Behdad Esfahbod 7a70c20fec [BASE] Clean up first 29% 2018-02-27 12:46:16 -08:00
Behdad Esfahbod 71130a20fa Replace Supplier.advance with Supplier::operator+= 2018-02-10 13:15:57 -06:00
Behdad Esfahbod fd03449094 Rename hb_apply_context_t to hb_ot_apply_context_t 2018-01-19 16:40:13 -08:00
Behdad Esfahbod 949f6af289 Disallow sanitize recursing into Extension subtables multiple times
Fixes https://oss-fuzz.com/v2/testcase-detail/5216838347653120
which is a stack overflow, not by way of infinite recursion, just
being deep.  That's disallowed anyway, so catch it as it happens,
not afterwards.
2018-01-15 20:44:10 -05:00
Behdad Esfahbod 6b19178ee3 Prefix int types with HB
Such a headache that Windows defines UINT8, ...; Just prefix it.
2018-01-10 03:07:30 +01:00
Behdad Esfahbod 81f27df4d9 More work towards improving collect_glyphs() against bad input
The three "XXXXX"'s should be switched to false.  Doing that separately for ease
of bisecting...
2017-12-16 06:12:06 -08:00
Behdad Esfahbod 16fba5b215 [ot] Fix Extension type recurse to disallow recursing to another Extension
Particularly hazardous if the second layer mixes forward and backward lookups.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4336
2017-11-29 16:08:11 -08:00
ebraminio 7c6937e7c7
Move all references of old url to the new address (#622) 2017-11-20 14:49:22 -05:00
Behdad Esfahbod 6f335ed1e5 Replace USHORT/SHORT/ULONG/etc with UINT16/INT16/UINT32/etc 2017-11-14 21:06:07 -08:00
Behdad Esfahbod dbdbfe3d7b Use nullptr instead of NULL 2017-10-15 12:11:08 +02:00
Behdad Esfahbod 40bd7e9a1c [unsafe-to-break] Add UNSAFE_TO_BREAK flag
Not all shapers code is updated to set this properly.
GSUB and Arabic shaper are updated.
GPOS and other shapers are NOT.

Fixes https://github.com/behdad/harfbuzz/issues/224
2017-08-10 15:02:28 -07:00
Behdad Esfahbod 1a0f4aa6df Revert "Synthesize GDEF glyph class for any glyph that does not have one in GDEF"
This reverts commit 69f9fbc420.

See https://github.com/behdad/harfbuzz/issues/347#issuecomment-268873401
Fixes https://github.com/behdad/harfbuzz/issues/347
2016-12-22 14:43:14 -06:00
Behdad Esfahbod 7ed71eb347 Protect collect_glyphs() and closure() against malicious DDOS fonts
Fixes https://github.com/behdad/harfbuzz/issues/363
2016-12-20 15:01:16 -06:00
Behdad Esfahbod 59055b5494 [GX] Implement Feature Variations
Not hooked up to shaper yet.
2016-12-16 19:06:26 -06:00
Behdad Esfahbod 359dead960 Allow MultipleSubst to delete glyph
Fixes https://github.com/behdad/harfbuzz/issues/253

Hopefully we got the logic right.
2016-05-06 16:19:19 +01:00
Behdad Esfahbod 69f9fbc420 Synthesize GDEF glyph class for any glyph that does not have one in GDEF
Previously we only synthesized GDEF glyph classes if the glyphClassDef
array in GDEF was null.  This worked well enough, and is indeed what
OpenType requires: "If the font does not include a GlyphClassDef table,
the client must define and maintain this information when using the
GSUB and GPOS tables."  That sentence does not quite make sense since
one needs Unicode properties as well, but is close enough.

However, looks like Arial Unicode as shipped on WinXP, does have GDEF
glyph class array, but defines no classes for Hebrew.  This results
in Hebrew marks not getting their widths zeroed.  So, with this change,
we synthesize glyph class for any glyph that is not specified in the
GDEF glyph class table.  Since, from our point of view, a glyph not
being listed in that table is a font bug, any unwanted consequence of
this change is a font bug :).

Note that we still don't get the same rendering as Uniscribe, since
Uniscribe seems to do fallback positioning as well, even though the
font does have a GPOS table (which does NOT cover Hebrew!).  We are
not going to try to match that though.

Test string for Arial Unicode:

	U+05E9,U+05B8,U+05C1,U+05DC

Before:		[gid1166=3+991|gid1142=0+737|gid5798=0+1434]
After:		[gid1166=3+991|gid1142=0+0|gid5798=0+1434]
Uniscribe:	[gid1166=3+991|gid1142=0@348,0+0|gid5798=0+1434]

Note that our new output matches what we were generating until July
2014, because the Hebrew shaper used to zero mark advances based on
Unicode, NOT GDEF.  That's 9e834e29e0.

Reported by Greg Douglas.
2016-03-17 11:59:43 -07:00
Behdad Esfahbod 7d8d58ac81 [GPOS] Divide position_finish() into two phases, for advances and offsets
Right now the position_finish_advances() is empty.  To be used for
spacing attachments proposal later.
2016-02-11 16:34:28 +07:00
Behdad Esfahbod 5ba450407b Make max context-length and max nesting level configurable
...at compile time.
2015-11-02 15:43:39 -08:00
Behdad Esfahbod f396fbb000 Fix return value of sanitize when subformat is not readable
This is a fix on top of the previous issue fixed in
c917965b9e.

This was caught by "libFuzzer" testing.
2015-10-09 12:25:55 -04:00
Behdad Esfahbod b47159011c Define return_trace()
Not functional change (expected!).
2015-09-29 14:57:02 +01:00
Behdad Esfahbod c917965b9e Add missing returns
Fixes possible invalid read of two bytes.

Reported by Behzad Najjarpour Jabbari, Secunia Research.
2015-09-29 14:45:35 +01:00