Commit Graph

6402 Commits

Author SHA1 Message Date
Behdad Esfahbod 3d2b98ef14 Minor 2018-11-23 10:58:43 -05:00
Behdad Esfahbod 22798e93c4 [use] Minor clarification 2018-11-22 22:47:51 -05:00
Behdad Esfahbod a2d6c1075a Minor tweak to FLAG64 2018-11-22 22:40:57 -05:00
Behdad Esfahbod 8280459e74
Merge pull request #1291 from harfbuzz/use-reordering
[use] Fix reordering
2018-11-22 22:39:12 -05:00
Behdad Esfahbod e4a4555d1e [cmap] Move code around 2018-11-22 22:17:49 -05:00
Behdad Esfahbod 758c9d68e2 [morx/kerx] Limit range to subtable when sanitizing 2018-11-22 22:16:12 -05:00
Behdad Esfahbod a9fe787a11 [sanitizer] Add reset_object(), make set_object() do bounds-check
Affects morx/kerx run-time only currently.  Will adjust their sanitize next.
2018-11-22 22:12:36 -05:00
Behdad Esfahbod 2c8188bf59 [kerx] Make sure subtables are non-zero-length
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11400
2018-11-22 22:02:19 -05:00
Behdad Esfahbod a9e0bdc35d [GSUB] Don't flush glyphset during recursion in closure()
See comment.

Supercedes https://github.com/harfbuzz/harfbuzz/pull/1401
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11366
2018-11-22 21:30:04 -05:00
Behdad Esfahbod d0e81b2cc8 [set] Rename 2018-11-22 21:20:39 -05:00
Behdad Esfahbod e866910579 Enforce requiring null_size even if min_size is 0
This concludes null-size enforcement changes
2018-11-22 18:07:59 -05:00
Behdad Esfahbod 4d4fd64ff4 Allow non-nullable OffsetTo<> to non-Null'able objects 2018-11-22 18:07:36 -05:00
Behdad Esfahbod fa9f585ec5 [glyf] Don't mark structs UNBOUNDED
See comments.
2018-11-22 17:56:51 -05:00
Behdad Esfahbod f47a60a754 Mark UnsizedArrayOf<> as UNBOUNDED
Since min_size is 0, Null() still accepts this type.
2018-11-22 17:53:29 -05:00
Behdad Esfahbod 199a0f7b41 [ot-shape] Simplify logic 2018-11-22 17:31:07 -05:00
Behdad Esfahbod 014e4980ed Move 2018-11-22 16:21:49 -05:00
Behdad Esfahbod 62890dee18 [aat] Zero mark advances if decided so even if there's cross-kerning
Cross-kerning can only take care of positioning vertically.  It doesn't
adjust mark advance...
2018-11-22 16:20:29 -05:00
Behdad Esfahbod a201fa74cd [aat] Tweak fallback positioning logic when applying morx
Such that for Indic-like scripts (eg. Khmer), we don't do any fallback mark
advance-zeroing / positioning, but we do for Latin, etc.  Reuses preferences
of our script-specific OpenType shapers for those.

Fixes regression: https://github.com/harfbuzz/harfbuzz/issues/1393
Which means, fixes again: https://github.com/harfbuzz/harfbuzz/issues/1264
While not regressing: https://github.com/harfbuzz/harfbuzz/issues/1357
2018-11-22 15:52:29 -05:00
Behdad Esfahbod fa0bd8964d [myanmar] Minor move 2018-11-22 14:46:39 -05:00
Behdad Esfahbod 7dc561984b [myanmar] If there's no GSUB table, pick myanmar shaper
Needed for morx+kern mark-zeroing interaction.  All other scripts
work this way.
2018-11-22 14:45:46 -05:00
Behdad Esfahbod 25f52f58c2 [myanmar] Remove myanmar_old shaper
Over time it has become the same as default shaper.  So, remove.
2018-11-22 14:41:01 -05:00
Behdad Esfahbod eeed802b1d Fix spurious gcc warnings
../../src/hb-null.hh:53:39: warning: enum constant in boolean context [-Wint-in-bool-context]
2018-11-22 01:53:36 -05:00
Behdad Esfahbod b96ecb9971 More
This makes more of the gcc spurious warning:

../../src/hb-null.hh:53:39: warning: enum constant in boolean context [-Wint-in-bool-context]

But not going to let that defeat correct code.  Type to switch to clang
as my main compiler...
2018-11-22 01:49:12 -05:00
Behdad Esfahbod 2737aa81e5 Fix up recent change
Fixes https://github.com/harfbuzz/harfbuzz/issues/1300
2018-11-22 01:44:27 -05:00
Behdad Esfahbod fffea5aff7 Minor 2018-11-22 01:25:34 -05:00
Behdad Esfahbod 209b58ef73 Minor 2018-11-22 01:22:33 -05:00
Behdad Esfahbod 3b9fd176e8 Disallow taking Null() of unbounded structs
Not sure I've marked all such structs.  To be done as we discover.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1300
2018-11-22 01:18:55 -05:00
Behdad Esfahbod f2b91d6510 Use Type::null_size for our structs in Null(), sizeof() for other types 2018-11-22 01:10:22 -05:00
Behdad Esfahbod 7dd945a876 One more time.. 2018-11-22 01:05:17 -05:00
Behdad Esfahbod d062ad10de Fix bots happy again, hopefully
So, our fallback static_assert cannot be had more than once per line
of source.
2018-11-22 00:39:14 -05:00
Behdad Esfahbod fb10c021c8 Revert alignof() == 1 check
Bots not happy with using "this" inside assertion...

This reverts 2656644887
2018-11-22 00:21:49 -05:00
Behdad Esfahbod 8d778877b8 .. 2018-11-21 23:46:09 -05:00
Behdad Esfahbod 8cfeed9948 Minor 2018-11-21 23:42:31 -05:00
Behdad Esfahbod e5d954a2fb Minor 2018-11-21 23:30:50 -05:00
Behdad Esfahbod e987059c61 Minor 2018-11-21 23:25:06 -05:00
Behdad Esfahbod a2b6d308a4 Remove DEFINE_SIZE_ARRAY2 2018-11-21 23:23:49 -05:00
Behdad Esfahbod 2656644887 Check alignof() structs are 1 2018-11-21 23:23:21 -05:00
Behdad Esfahbod 6321fdf704 Whitespace 2018-11-21 23:19:00 -05:00
Behdad Esfahbod ecdceea861
Merge pull request #1399 from harfbuzz/sharada-sandhi-mark
Fix USE categories for U+111C9 SHARADA SANDHI MARK
2018-11-21 16:12:32 -05:00
Behdad Esfahbod b89c7fd3dc Allow defining HB_USE_ATEXIT to 0
That's better use of that value than requiring extra macro HB_NO_ATEXIT
2018-11-21 12:32:48 -05:00
David Corbett b3d5b0a5d9 Fix USE categories for U+111C9 SHARADA SANDHI MARK 2018-11-21 11:35:44 -05:00
Behdad Esfahbod f48bb9a393 [var] Deprecated axis enumeration API and add new version
New version has axis flags.

New API:
+hb_ot_var_axis_info_t
+hb_ot_var_find_axis_info()
+hb_ot_var_get_axis_infos()

Deprecated API:
-HB_OT_VAR_NO_AXIS_INDEX
-hb_ot_var_axis_t
-hb_ot_var_find_axis()
-hb_ot_var_get_axes()
2018-11-20 20:46:14 -05:00
Behdad Esfahbod b2d803cef6 Remove newly-added -hb_ot_var_axis_get_flags() 2018-11-20 20:46:14 -05:00
Behdad Esfahbod 736897d7a1 [var] Make sure hb_ot_var_axis_flags_t is int-sized 2018-11-20 20:46:14 -05:00
Behdad Esfahbod eab5d15f61 [var] Move code 2018-11-20 20:46:14 -05:00
Michiharu Ariza 1ecbf4d3e3 Merge branch 'master' into cff-subset 2018-11-20 17:19:05 -08:00
David Corbett 8295118279 Shrink the emoji table by merging adjacent ranges 2018-11-20 15:41:45 -05:00
Behdad Esfahbod be1828daaa [var] Fix type of coords returned
Ouch.  Wonder how none of the bots caught the float->int truncation.
2018-11-20 11:16:23 -05:00
Behdad Esfahbod 831ba74382 Fix Codacy "issues" 2018-11-20 01:16:08 -05:00
David Corbett 3c7792ca32 [use] Fix reordering
Fixes #1235.
2018-11-19 16:49:40 -05:00
Behdad Esfahbod 587d49fc65 [fvar] Add named-instance API
Fixes https://github.com/harfbuzz/harfbuzz/issues/1241
2018-11-19 14:51:34 -05:00
Behdad Esfahbod 46c0da820f Fix build 2018-11-19 13:32:48 -05:00
Behdad Esfahbod 56c9238d3d [fvar] Rewrite sanitize 2018-11-19 13:09:53 -05:00
Behdad Esfahbod 4a6a692e3e [fvar] Use hb_array_t for axes 2018-11-19 13:06:44 -05:00
Behdad Esfahbod e009739601 [fvar] Minor 2018-11-19 12:53:53 -05:00
Behdad Esfahbod 1a2eb108b8 [ot-var] Add hb_ot_var_axis_get_flags()
Part of https://github.com/harfbuzz/harfbuzz/issues/1241

New API:
+hb_ot_var_axis_flags_t
+hb_ot_var_axis_get_flags
2018-11-19 12:36:56 -05:00
Behdad Esfahbod bd6b2ba1d3 [ot-var] Add flags
Unfortunate that we don't have room in hb_ot_var_axis_t to expose flags :(.
2018-11-19 11:34:56 -05:00
Behdad Esfahbod c076c7b85c [ot-var] Use hb_ot_name_id_t 2018-11-19 11:30:40 -05:00
Michiharu Ariza 515f1a1614 Merge branch 'master' into cff-subset 2018-11-16 17:38:47 -08:00
Michiharu Ariza a6da9b9415 fixed Charset format selection 2018-11-16 17:29:03 -08:00
Behdad Esfahbod e3a1a8350a 2.1.3 2018-11-16 16:53:25 -08:00
Behdad Esfahbod 9714e114b8 Fix recent commits 2018-11-16 16:52:42 -08:00
Behdad Esfahbod 0328a1ce41 Revert b4c6113032
Was causing more trouble than it solved.  We use unsigned for indexing,
and it's not helpful to allow that wrapping to negative integers on
32bit machines.  The only way we could work around it would have been
by accepting int64_t arg, but that's overkill.

Ignore the MSVC 2008 build issue.  We don't support that compiler.
2018-11-16 16:48:28 -08:00
Behdad Esfahbod 52f61cdb87 Detect over/under-flow in UnsizedArray::operator[]
Was causing bad substitutions in mort table because of WordOffsetToIndex()
producing negative numbers that were cast to unsigned int and returned as
large numbers (which was desirable, so they would be rejected), but then
they were cast to int when passed to this operator and acting as small
negative integers, which was bad...

Detect overflow.  Ouch, however, now I see this still fails on 32-bit.
Guess I'm going to revert an earlier change.
2018-11-16 16:41:59 -08:00
Behdad Esfahbod 6910ff03e6 [aat] Fix mort shaping
Ouch!
2018-11-16 16:11:02 -08:00
Behdad Esfahbod fdb29ab2b0 2.1.2 2018-11-16 15:38:11 -08:00
Behdad Esfahbod cff4c6087f Fix vertical fallback space sign
Ouch!

Follow-up to cf203af8a3

Fixes https://github.com/harfbuzz/harfbuzz/issues/1343
2018-11-16 15:04:41 -08:00
Behdad Esfahbod 7a97f70740 Don't apply GPOS if applying morx
That's what Apple does, and it wouldn't degrade our OpenType performance.

Part of https://github.com/harfbuzz/harfbuzz/issues/1348
2018-11-16 14:46:40 -08:00
Behdad Esfahbod eafd515639 Prefer morx table if GSUB is empty (no scripts)
Fixes https://github.com/harfbuzz/harfbuzz/issues/1348
2018-11-16 14:45:56 -08:00
Behdad Esfahbod aa06574823 Minor 2018-11-16 14:31:05 -08:00
Michiharu Ariza b6903bd6c4 ensure fdmap initialized as identity for single-FD (non-CID) fonts 2018-11-16 13:46:58 -08:00
Michiharu Ariza b403be8ad9 Merge branch 'master' into cff-subset 2018-11-16 12:29:18 -08:00
Michiharu Ariza b67a7c731f drop dotsection as hint along with test case 2018-11-16 12:28:24 -08:00
Behdad Esfahbod 50d1a41c08 [coretext] Hopefully the last one 2018-11-16 08:52:57 -05:00
Behdad Esfahbod 0aab861f9c [coretext] Another round 2018-11-16 08:43:25 -05:00
Behdad Esfahbod 0809b76a9a [coretext] One more try.. 2018-11-16 08:29:47 -05:00
Behdad Esfahbod 78bd447594 [coretext] One more try 2018-11-16 04:10:53 -05:00
Behdad Esfahbod fd27a23c82 [coretext] Another build fix attemt 2018-11-16 03:57:12 -05:00
Behdad Esfahbod 729aedf0da [directwrite] Fix build 2018-11-16 03:26:46 -05:00
Behdad Esfahbod cfb9771a3b [coretext] Try to fix 2018-11-16 03:25:07 -05:00
Behdad Esfahbod e3e9547365 [coretext] Unbreak build 2018-11-16 02:55:29 -05:00
Behdad Esfahbod ce5da0f36a [shaper] Rewrite shaper data code to be more template-driven than macro-driven 2018-11-16 02:52:20 -05:00
Behdad Esfahbod cb4bf85b14 [hdmx] Fix bounds checking
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11351
2018-11-16 02:02:24 -05:00
Behdad Esfahbod af727b4e62 [hdmx] Minor 2018-11-16 01:55:39 -05:00
Behdad Esfahbod 9e9f16c92d [subset] Remove invalid glyphs from glypset to retain
Fixes https://github.com/harfbuzz/harfbuzz/pull/1388
2018-11-16 01:48:26 -05:00
Michiharu Ariza 072c7aba92 use 2-byte offset instead of 4-byte for local subrs
more than enough since local subrs immediately follow its corresponding private dict, as the result 2-byte redunction for each font dict with local subrs
updated api test expected subset fonts accordingly
2018-11-15 15:41:46 -08:00
Michiharu Ariza 9d0231cfe7 fixed a subset bug when no font dicts reduce 2018-11-15 15:39:43 -08:00
Ebrahim Byagowi 11aa0468ac [subset] minor, adjust spaces 2018-11-16 00:02:47 +03:30
Ebrahim Byagowi d7c50ff0d6 [math] minor, adjust spaces 2018-11-16 00:02:47 +03:30
Michiharu Ariza 13735570f0 reject nested seac 2018-11-15 12:10:23 -08:00
Michiharu Ariza c37aecd41c Merge branch 'master' into cff-subset 2018-11-15 11:03:46 -08:00
Michiharu Ariza ecdb77f0ae fixed CFF1 subset of std encoding & non-std charset combo 2018-11-15 10:54:15 -08:00
Behdad Esfahbod cabe433fbb [base] Add TODO items 2018-11-15 02:48:50 -05:00
Behdad Esfahbod 3bf1ce748f [shaper] Rename 2018-11-14 21:08:54 -05:00
Behdad Esfahbod c221dc0ba7 [ot-shape] Move code around 2018-11-14 19:57:19 -05:00
Michiharu Ariza 892ab37e7c Merge branch 'master' into cff-subset 2018-11-14 13:54:07 -08:00
Michiharu Ariza 3787c07856 Implemented seac for extents & subset along with API tests 2018-11-14 13:38:03 -08:00
Ebrahim Byagowi 7867c2bad0
[STAT] Add table parsing (#1384) 2018-11-14 22:13:50 +03:30
Behdad Esfahbod 48d16c2ab2 [hmtx] Fix signedness issue
Fixes https://github.com/harfbuzz/harfbuzz/issues/1248#issuecomment-438689499
2018-11-14 09:57:05 -05:00
Ebrahim Byagowi 29db2a44a6
[ot-color/svg] Note that it can be gzipped 2018-11-14 12:13:16 +03:30
Behdad Esfahbod 3c3eb5ea9c [aat] Disable fallback mark advance zeroing and positioning if morx applied
Fixes https://github.com/harfbuzz/harfbuzz/issues/1357
2018-11-13 21:10:10 -05:00
Behdad Esfahbod dc4225ccd1 Don't retry creating again and again in lazy_loader if create failed
Still does that if get_null() returns nullptr.  Our shaper data objects
are like that.  Shrug.
2018-11-13 20:48:46 -05:00
Behdad Esfahbod 086235f593
Merge pull request #1382 from punchcutter/master
Change USE Category for Grantha Virama
2018-11-13 19:50:25 -05:00
Behdad Esfahbod 2092f595c7
Merge pull request #1380 from kbrow1i/cygwin
Don't use Win32 API on Cygwin
2018-11-13 19:49:06 -05:00
punchcutter c565fc3fb3 Change USE Category for Grantha Virama
https://github.com/harfbuzz/harfbuzz/issues/1379
2018-11-13 12:51:10 -08:00
Behdad Esfahbod 475be9d5c6 Fix Windows build 2018-11-13 13:01:13 -05:00
Behdad Esfahbod fc44dea341 Use atomic ints for upem and num_glyphs on face 2018-11-13 11:54:33 -05:00
Behdad Esfahbod 9579ed9755 Make atomic types' internal values non-mutable
This resulted from confusion previously...
2018-11-13 11:46:20 -05:00
Behdad Esfahbod c52d5bcd94 [ot-face] Add 'head' table 2018-11-13 11:41:29 -05:00
Ken Brown eee5b5ed04 Don't use Win32 API on Cygwin
Cygwin is a Posix platform to the extent possible.  It should use the
Posix API except in special circumstances.
2018-11-12 21:07:34 -05:00
Behdad Esfahbod 56f541d000 [shape-plan] Remove unused code 2018-11-12 19:46:37 -05:00
Behdad Esfahbod 6c22f3fd95 [shape-plan] Implement fine-grained caching plans with user-features
Only tag, value, and global-ness of features are considered, not their
start/end offsets.
2018-11-12 19:26:01 -05:00
Behdad Esfahbod cc8428756a [shape-plan] Cache shape plans with variations based on variation indices 2018-11-12 18:48:10 -05:00
Behdad Esfahbod 8284cb9fb3 [shape-plan] Refactor more 2018-11-12 18:18:20 -05:00
Behdad Esfahbod 1082338525 [shape-plan] Only use shape-plan key to initialize hb_ot_shape_plan_t
Such that we don't accidentally use info not in the cache key.
2018-11-12 18:05:02 -05:00
Behdad Esfahbod 7ac03f88a2 [shape-plan] Minor 2018-11-12 17:50:30 -05:00
Behdad Esfahbod c7be933439 [shape-plan] Refactor some more 2018-11-12 17:49:15 -05:00
Behdad Esfahbod fc27777833 [shape-plan] Refactor more 2018-11-12 17:27:34 -05:00
Behdad Esfahbod 566612295b [shape-plan] Turn hb_shape_plan_proposal_t into hb_shape_plan_key_t
And include it in hb_shape_plan_t itself.
2018-11-12 17:19:45 -05:00
Behdad Esfahbod af123bd1b8 Add hb_memcmp() 2018-11-12 16:27:08 -05:00
Behdad Esfahbod 65456bff37 [shape-plan] Minor 2018-11-12 16:21:21 -05:00
Behdad Esfahbod 1db672a5e9 [shaper] Rename 2018-11-12 16:05:46 -05:00
Behdad Esfahbod 274f4c726f Rename check_array2() to check_array() 2018-11-12 14:24:36 -05:00
Behdad Esfahbod e014405a21 Rename check_array(array, a, b) to check_range() 2018-11-12 14:23:31 -05:00
Behdad Esfahbod c8f4cc4927 [kerx] Fix integer overflow in multiply
Fixes https://oss-fuzz.com/v2/testcase-detail/5754863779053568
2018-11-12 14:11:29 -05:00
Behdad Esfahbod 1300f027a9 [kerx] Minor tweak on previous commit 2018-11-12 13:56:48 -05:00
Behdad Esfahbod d6666b3866 [fuzzing] Remove limited-edition build of libraries
Use normal, production, shared libraries.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1237
2018-11-12 13:21:14 -05:00
Behdad Esfahbod a549aa14a0 [kerx] Protect against stack underflow
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11367
2018-11-12 13:02:39 -05:00
Michiharu Ariza 41a8bc7fd9 Merge branch 'master' into cff-subset 2018-11-12 08:49:00 -08:00
Michiharu Ariza 0dfa584cb4 changed Adobe company name 2018-11-12 08:47:07 -08:00
Behdad Esfahbod 3e284e02c2 [shape-plan] Minor 2018-11-11 22:51:34 -05:00
Behdad Esfahbod 420c9de644 [shape-plan] Minor rename 2018-11-11 22:50:37 -05:00
Behdad Esfahbod 77bd0a6458 Add variation coords to shape_plan proposal
This is the root cause of bug worked around in 19e77e01bc.

Still no shape plan caching for variations though.
2018-11-11 22:08:48 -05:00
Behdad Esfahbod 9c767d075d Minor 2018-11-11 22:03:15 -05:00
Behdad Esfahbod f521a28b4a Embed hb_ot_shape_plan_t into hb_shape_plan_t
No other shaper will need shape_plan_data, by definition.  So, remove
abstraction layer and always create hb_ot_shape_plan_t as part of
hb_shape_plan_t.
2018-11-11 21:54:10 -05:00
Behdad Esfahbod fabb012104 Remove wrong comment 2018-11-11 17:10:23 -05:00
Behdad Esfahbod 1fd183ee1c Finish off eecccc919c 2018-11-11 16:47:52 -05:00
Behdad Esfahbod 1beacdded9 Minor 2018-11-11 16:35:28 -05:00
Behdad Esfahbod e88d47b7f2 Minor 2018-11-11 16:25:43 -05:00
Behdad Esfahbod 55c66c7c56 Revert "Declare Null() constexpr"
This reverts commit 442a72d95a.

Doesn't make sense.  No idea how my local compilers where happy with it!
2018-11-11 16:09:38 -05:00
Behdad Esfahbod 98c6f03ccd Minor 2018-11-11 15:54:20 -05:00
Behdad Esfahbod 442a72d95a Declare Null() constexpr 2018-11-11 15:51:23 -05:00
Behdad Esfahbod eecccc919c Don't store to null object
Ouch :).
2018-11-11 15:48:47 -05:00
Behdad Esfahbod 903856ab50 Remove unused function 2018-11-11 15:45:58 -05:00
Behdad Esfahbod 0e0af11c62 [hdmx] Renames 2018-11-11 12:54:16 -05:00
Behdad Esfahbod da6aa3b033 Add hb_blob_ptr_t.destroy() 2018-11-11 11:40:57 -05:00
Behdad Esfahbod bb9abb4efd [hmtx/port] Use hb_blob_ptr_t 2018-11-11 00:42:23 -05:00
Behdad Esfahbod 0e2680a6e8 [cmap] Port to hb_blob_ptr_t
Although didn't need it...
2018-11-11 00:28:47 -05:00
Behdad Esfahbod 0b0fad3ea8 [color] Port to hb_blob_ptr_t
Fix hb_blob_ptr_t::get_length () as well.
2018-11-11 00:26:55 -05:00
Behdad Esfahbod 925b7a214f Comment 2018-11-11 00:17:30 -05:00
Behdad Esfahbod dcb6386833 [shape-plan] Remove use of custom null object 2018-11-11 00:16:17 -05:00
Behdad Esfahbod 109891d498 [shape-plan] Make null object all zeros
To remove custom null object next..
2018-11-11 00:15:08 -05:00
Behdad Esfahbod 34185ff3bc [blob] Use default null object 2018-11-11 00:12:30 -05:00
Behdad Esfahbod 2ee1d9f555 [blob] Change null object memory mode to DUPLICATE
We never rely on that being equal to readonly.  Just not being
writable.  Maybe not even that given that the object is inert.

In prep for next commit, using default null pool.
2018-11-11 00:11:28 -05:00
Behdad Esfahbod 5d0078a48b Add hb_blob_ptr_t
Use in a couple of places.  Push to bots to see how many unhappy before
I convert the rest.
2018-11-10 23:52:15 -05:00
Behdad Esfahbod e44046ec49 Minor 2018-11-10 22:41:35 -05:00
Behdad Esfahbod 752bd8a192 [kerx] Fix Format1 tupleKern sanitization
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11312
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11305
2018-11-10 21:13:32 -05:00
Behdad Esfahbod f9e0552deb [fuzzing] Make "make lib" faster and more usable 2018-11-10 21:06:56 -05:00
Behdad Esfahbod 4674655841 Minor 2018-11-10 20:11:10 -05:00
Behdad Esfahbod a953b64750 Revert parts of previous commit that made clang unhappy 2018-11-10 20:10:03 -05:00
Behdad Esfahbod 1d66cdcf77 Better fix for MSVC 2008
Follow up on b4c6113032

Fixes https://github.com/harfbuzz/harfbuzz/issues/1374
2018-11-10 19:57:51 -05:00
Michiharu Ariza fb2a037f54 Merge branch 'master' into cff-subset 2018-11-10 16:23:11 -08:00
Behdad Esfahbod b4c6113032 Try fixing MSVC 2008 build
Fixes https://github.com/harfbuzz/harfbuzz/issues/1374
2018-11-10 16:35:39 -05:00
Behdad Esfahbod f2e942f302 Fix hb_bytes_t's unused template array constructor 2018-11-10 16:11:14 -05:00
Behdad Esfahbod 6213a75b68 Add trivial casts to hb_bytes_t 2018-11-10 16:09:21 -05:00
Behdad Esfahbod 8bb97d2ce1 Revert back hb_bytes_t.cmp() to the scheme it was
But fix UBSan complaint.

There's nothing in hb_bytes_t that guarantees lexical ordering, and
ordering by length first is much faster.
2018-11-10 16:00:51 -05:00
Behdad Esfahbod 534e1d7694 Fix hb_bytes_t.cmp() for realz this time 2018-11-10 15:45:31 -05:00
Behdad Esfahbod 929f07dbfc Fix hb_bytes_t.cmp()
Ouch!
2018-11-10 15:39:07 -05:00
Ebrahim Byagowi 1d82b4761d [colr/feat/trak] minor 2018-11-10 19:31:12 +03:30
Behdad Esfahbod 3a9fa8c026 [qsort] Fix O(N^2) behavior if all array elements are the same
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11327

Reported as https://github.com/noporpoise/sort_r/issues/7
2018-11-10 01:58:26 -05:00
Behdad Esfahbod b308aaccf0 [post] Minor 2018-11-10 01:58:26 -05:00
Behdad Esfahbod 4111c3b8cd [post] Move sanitize close to data fields 2018-11-10 01:58:26 -05:00
Behdad Esfahbod e26e6dbb33 [post] Remove unnecessary hb_nonnull_ptr_t<> 2018-11-10 01:58:26 -05:00
Ebrahim Byagowi 6b8178c649
[glyf] minor 2018-11-10 02:42:08 +03:30
Michiharu Ariza 8798416587 fixed vstem handling (lack thereof) in check_width
bug exposed by U+2261 equivalence in SourceCodePro-Regular.otf
2018-11-09 08:59:18 -08:00
Behdad Esfahbod 5f97fe9956 Fix a few MSVC 2008 warnings
https://github.com/harfbuzz/harfbuzz/issues/1374
2018-11-09 10:01:50 -05:00
Behdad Esfahbod f51bb6ee7b
Merge pull request #1358 from ebraminio/lcar
Hook AAT's lcar to _get_ligature_carets
2018-11-08 14:42:40 -05:00
Ebrahim Byagowi b986fead0a Hook AAT's lcar to _get_ligature_carets 2018-11-08 23:06:26 +03:30
Ebrahim Byagowi 2d987110c0
[aat] Minor 2018-11-08 21:46:26 +03:30
Ebrahim Byagowi b989507fa6
[aat] Minor (#1369) 2018-11-08 20:48:54 +03:30
Michiharu Ariza 26c291aaa0 Merge branch 'master' into cff-subset 2018-11-08 09:06:49 -08:00
Michiharu Ariza 417963dd9f got rid of Remap::fullset() as incorrect, redundant, inefficient 2018-11-08 09:01:20 -08:00
Ebrahim Byagowi f90423847b
[just] Initial table implementation (#1364)
A starting point, its sanitization is not tested however
2018-11-08 19:17:02 +03:30
Ebrahim Byagowi b8b00fb3c6
[aat] Support Lookup<OffsetTo<>>, needed by just and lcar (#1368) 2018-11-08 18:53:14 +03:30
Behdad Esfahbod 15326826bf [aat] Ignore cross-stream offset of deleted-glyphs
I think it makes sense to accumulate it, but Ned tells me that's
what CoreText does.
2018-11-07 21:58:04 -05:00
Michiharu Ariza 636a6833c5 fixed ends_in_hint bug
subr ends in hint itself should be regarded as hint
this flag should propagate to its caller if the call itself is at the end of the caller
2018-11-07 17:58:45 -08:00
Behdad Esfahbod 517a1bac97
Merge pull request #1362 from harfbuzz/cross-kern
Vastly improve kern/kerx tables, including cross-stream "kerning"
2018-11-07 18:40:48 -05:00
Behdad Esfahbod b18a56a290 [kerx] Comment 2018-11-07 18:13:22 -05:00
Michiharu Ariza 4d74020694 Merge branch 'master' into cff-subset 2018-11-07 15:09:30 -08:00
Michiharu Ariza e0c30b961d merge with cff-subset branch 2018-11-07 15:08:55 -08:00
Behdad Esfahbod 006386be3a [kern] Implement negative state numbers
Let the fuzzing bots rip this code apart...
2018-11-07 18:04:53 -05:00
Michiharu Ariza 0996c0ff62 implented no-desubroutinize with CFF2 along with API test
replaced AdobeVFPrototype.abc.otf with a hinted (maually) & subroutinized copy
replaced expected results as well
2018-11-07 14:48:37 -08:00
Behdad Esfahbod 29c5302376 [morx] Minor 2018-11-07 17:29:37 -05:00
Behdad Esfahbod 385f78b312 [aat] Remove deleted-glyhs after applying kerx/kern
Finally:  Fixes https://github.com/harfbuzz/harfbuzz/issues/1356

Test case:
$ ./hb-shape GeezaPro.ttc -u U+0628,U+064A,U+064E,U+0651,U+0629
[u0629.final.tehMarbuta=4+713|u064e_u0651.shaddaFatha=1@0,-200+0|u064a.medial.yeh=1+656|u0628.initial.beh=0+656]

The mark positioning (kern table CrossStream kerning) only works if deleted
glyph (as result of ligation) is still in stream and pushed through the
state machine.
2018-11-07 17:20:47 -05:00
Behdad Esfahbod 1909072235 [aat] Add debug info to state machine 2018-11-07 16:42:16 -05:00
Behdad Esfahbod ca23567f41 Disable fallback mark positioning if kern table has cross-stream kerning
Happens even if the cross-stream kerning is for cursive attachment only.  Oh well..
2018-11-07 16:19:51 -05:00
Behdad Esfahbod 5cf6f94dfd Don't apply both kerx and kern
Ouch!
2018-11-07 16:07:22 -05:00
Behdad Esfahbod 41cff7afc9 Minor 2018-11-07 16:05:36 -05:00
Behdad Esfahbod 9af983af24 [kern] Switch to dispatch 2018-11-07 16:03:09 -05:00
Behdad Esfahbod bc06e2805a [kerx/kern] Add has_cross_stream() 2018-11-07 16:02:40 -05:00
Behdad Esfahbod ea579f9ccc [kerx] Fix peculiar indexing that was needed previously
Not needed now that we use GPOS attachment for cursive kerx.
2018-11-07 15:50:23 -05:00
Behdad Esfahbod 6ee6cd93d8 [GPOS] Only mark unsafe-to-break if kerning happened
Fixes https://github.com/harfbuzz/harfbuzz/issues/1365
2018-11-07 15:40:55 -05:00
Behdad Esfahbod 501a364d9b [GPOS] Add TODO item 2018-11-07 15:02:16 -05:00
Behdad Esfahbod 7a9629f2f1 [kerx] Implement CrossStream kerning for non-state-machine subtables
Untested.
2018-11-07 14:52:57 -05:00
Behdad Esfahbod 0eb4157011 [kerx] Disable backwards-kerning for non-state-machine tables
That's what the spec says for Backwards flag, only applicable to
formats 1 and 4.
2018-11-07 14:42:15 -05:00
Behdad Esfahbod b2f687c256 [kerx] Use GPOS attachment facilities for CrossStream kerning 2018-11-07 14:38:29 -05:00
Behdad Esfahbod e10a856eb2 [kerx] Format 2018-11-07 14:11:48 -05:00
Behdad Esfahbod 649cc3ef27 [kerx] Don't disable crossKerning if kern feature is off 2018-11-07 14:07:13 -05:00
Behdad Esfahbod 0c3b061ac2 [kern] Apply erlier, where GPOS/kerx are applied 2018-11-07 13:58:41 -05:00
Behdad Esfahbod f4bad0086e [kerx] Implement tupleKerning for Format1
Untested.
2018-11-07 13:51:17 -05:00
Behdad Esfahbod 39b4ef6f18 [kerx] Better sanitize tupleKerning 2018-11-07 13:48:45 -05:00
Behdad Esfahbod 14772da06f [kern/kerx] Share KernTable, renamed to KerxTable 2018-11-07 13:40:22 -05:00
Behdad Esfahbod c038f5be6b [fallback] Minor 2018-11-07 13:35:06 -05:00
Behdad Esfahbod db6e658e8c [kern/kerx] More towards sharing KernTable 2018-11-07 13:33:23 -05:00
Behdad Esfahbod 89ec095979 [kern] Disable Format1 and Format3 for OT-style tables 2018-11-07 13:10:05 -05:00
Behdad Esfahbod ab57bcae0f [kern] Minor 2018-11-07 13:04:21 -05:00
Behdad Esfahbod 30af5b4a4c [kern] Move code 2018-11-07 12:57:10 -05:00
Behdad Esfahbod 1ff300464a [kern] Massage more 2018-11-07 12:51:49 -05:00
Behdad Esfahbod 8e9f6cd0fd [kerx] More minor 2018-11-07 12:49:20 -05:00
Behdad Esfahbod f8c3df7d4a [kern/kerx] Minor 2018-11-07 12:48:06 -05:00
Behdad Esfahbod f5e0a63a22 [kern/kerx] Towards sharing KernTable 2018-11-07 12:32:51 -05:00
Behdad Esfahbod 330508497d [kern/kerx] Minor 2018-11-07 12:27:44 -05:00
Behdad Esfahbod 1a5ef84900 [kern/kerx] Share Format2
This, enables Format2 for kern table, which was disabled before.
2018-11-07 12:19:52 -05:00
Behdad Esfahbod 8faec4e334 [kerx] Towards merging Format2 2018-11-07 12:16:38 -05:00
Michiharu Ariza ae8fd0dbfb clear stack after vsindex op 2018-11-07 09:16:12 -08:00
Michiharu Ariza 7fed7d80f7 fixed off-by-one error in CFF1 Encoding lookup 2018-11-07 09:09:13 -08:00
Behdad Esfahbod d5c0ca210f [aat] Minor 2018-11-07 12:08:44 -05:00
Behdad Esfahbod e72e041c3c [kerx] Rename 2018-11-07 11:56:36 -05:00
Behdad Esfahbod 241ba7da51 [morx/kerx] Rename types 2018-11-07 11:51:40 -05:00
Behdad Esfahbod c808e444da [kern/kerx] Share Format1 subtable 2018-11-07 11:47:12 -05:00
Behdad Esfahbod a244190afa [kerx] Minor 2018-11-07 11:47:12 -05:00
Behdad Esfahbod 2a72091196 [kerx] Minor 2018-11-07 11:26:57 -05:00
Behdad Esfahbod f5f4ca7871 [kern/kerx] Enable crossStream kerning in vertical
CoreText doesn't, but no reason we shouldn't do.
2018-11-07 11:21:09 -05:00
Behdad Esfahbod d5c88af4a2 [kerx] More towards sharing Format1 2018-11-07 11:20:14 -05:00
Behdad Esfahbod b693fd0dc6 [morx] Simplify 2018-11-07 11:10:24 -05:00
Behdad Esfahbod ce3451dc2a [kerx] Towards sharing Format1 2018-11-07 11:02:04 -05:00
Behdad Esfahbod e890753ebb [morx] Minor 2018-11-07 10:59:53 -05:00
Behdad Esfahbod 5b17853547 [kern/kerx] Share Format0 2018-11-07 10:45:25 -05:00
Behdad Esfahbod c97dde5d55 [kern/kerx] Towards merge more 2018-11-07 10:39:39 -05:00
Behdad Esfahbod 540ccc38b0 [kern/kerx] More towards sharing 2018-11-07 10:33:46 -05:00
Behdad Esfahbod d0f8f4c200 [kern] Move kern machine to hb-kern.hh 2018-11-07 10:25:25 -05:00
Behdad Esfahbod a6acff252c [kerx] Towards sharing subtables with kern 2018-11-07 10:19:57 -05:00
Behdad Esfahbod befac337ca [kern] Remove Override business
Not used in any fonts.  Not well-specified when mixing kerning with
Cross-Stream positioning.
2018-11-07 09:53:50 -05:00
Behdad Esfahbod 9d5027696e [post] Return true on truncation
Client can check that buffer was completely filled out and reallocate.
2018-11-07 09:16:53 -05:00
Behdad Esfahbod 7d91f07edf [post] Protect against huge empty tables 2018-11-07 09:14:42 -05:00
Behdad Esfahbod 5ed816ab59 [post] Minor 2018-11-07 09:13:51 -05:00
Behdad Esfahbod 64f0becd89 [post] Fix bound checking 2018-11-07 09:10:55 -05:00
HinTak 7ec694ddf2 Use non-GRID-fitted values for metrics (#1363)
* Use non-GRID-fitted values for metrics

See freetype/src/base/ftobjs.c:ft_recompute_scaled_metrics() and
the usage of GRID_FIT_METRICS inside.

Fixes https://github.com/behdad/harfbuzz/issues/1262

* Update hb-ft.cc
2018-11-07 08:19:36 -05:00
Behdad Esfahbod 59e04e4231 [kern/kerx] Fix cursive joining
Tested with Waseem TTC:

$ hb-shape Waseem.ttc جحخج
[F1Jeem_R2=3@0,180+479|M1Khah_L2_R2=2@0,682+403|M1Hah_L2_R2=1@0,1184+403|I1Jeem_L2=0@0,1184+744]
2018-11-07 00:27:20 -05:00
Behdad Esfahbod 8d0f797139 [kern/kerx] Fix "reset" magic value 2018-11-07 00:05:10 -05:00