Commit Graph

7738 Commits

Author SHA1 Message Date
Behdad Esfahbod 1558a43342 [test] Minor 2019-02-14 20:46:13 -08:00
Behdad Esfahbod fa373584de [algs] Test pair more 2019-02-14 20:15:07 -08:00
Behdad Esfahbod 0d7af5fb02 [algs] Use universal references for hb_pair()
Such that it carries lvalues inside.
2019-02-14 19:37:57 -08:00
Behdad Esfahbod 5b99c92d4c [iter] Use more 2019-02-14 17:10:04 -08:00
Behdad Esfahbod 72c1b59588 [iter] Use in more places 2019-02-14 15:43:20 -08:00
Behdad Esfahbod 40cce41eae [iter] Use in a couple more intersects() calls 2019-02-14 15:14:37 -08:00
Behdad Esfahbod bafdf1829d [iter] Use in a couple more closure() calls 2019-02-14 15:13:16 -08:00
Behdad Esfahbod fa35d3fd81 [iter] Add hb_drain 2019-02-14 14:04:05 -08:00
Behdad Esfahbod f4cfd6b6ad [iter] A couple more hb_apply() + lambda uses 2019-02-14 13:45:52 -08:00
Behdad Esfahbod 7514a49f21 [iter] Use hb_apply() with lambda functions in a few places 2019-02-14 13:16:33 -08:00
Behdad Esfahbod 0670e1a6f5 [iter] Remove excess use of universal references
Every time I have to study these to understand why a change is right..
2019-02-14 11:53:40 -08:00
Behdad Esfahbod 773d75637c [iter] Add hb_apply() 2019-02-14 11:40:22 -08:00
Behdad Esfahbod 00db94095d [iter] Make hb_filter() a function-object 2019-02-14 11:10:13 -08:00
Behdad Esfahbod aa4c321262 [iter] Make hb_zip() a function-object 2019-02-14 11:07:12 -08:00
Behdad Esfahbod f8fcfb263e [iter] Accept pointers to hb_sink() 2019-02-14 11:03:29 -08:00
Behdad Esfahbod b530573ad9 [iter] Make hb_sink function-object 2019-02-14 11:00:10 -08:00
Behdad Esfahbod bb139cb8d0 [iter] Back to dagger formatting for pipelines 2019-02-14 10:52:02 -08:00
Behdad Esfahbod 5fa52e62b1 [iter] Accept iterator, not iterable, in hb_sink()() 2019-02-14 10:51:02 -08:00
Behdad Esfahbod 0f292ea85f [iter] Accept iterator, not iterable, in hb_filter()() 2019-02-14 10:49:31 -08:00
Behdad Esfahbod 345bfbb207 [iter] Accept iterator, not iterable, in hb_map()() 2019-02-14 10:48:20 -08:00
Behdad Esfahbod 16cc313dcd [iter] Use hb_sink() 2019-02-14 10:40:05 -08:00
Behdad Esfahbod b702a0cbf8 [iter] Add hb_sink() 2019-02-14 10:39:58 -08:00
Michiharu Ariza 1cb1d5d7fb Merge branch 'master' into cff-more-arrayof-fixes 2019-02-14 10:09:19 -08:00
Michiharu Ariza 6f1dfd082c Merge branch 'master' into cff-retain-gids 2019-02-14 10:08:16 -08:00
Behdad Esfahbod 7d2376de33 Merge branch 'master' into iter 2019-02-13 22:13:37 -08:00
Ebrahim Byagowi 890d0ee77f
Minor, use a meaningful naming in template parameter (#1582) 2019-02-14 00:27:01 +03:30
Michiharu Ariza 8a568a8858 Merge branch 'master' into cff-more-arrayof-fixes 2019-02-13 11:25:00 -08:00
Michiharu Ariza b1dbc77fa6 Merge branch 'master' into cff-retain-gids 2019-02-13 11:24:38 -08:00
Ebrahim Byagowi 1e1d0e63df
Fix djgpp complains by tweaking templates (#1579)
For some reasons djgpp doesn't understand "unsigned int" can be same
with one of uint*_t anyway so lets do that for it explicitly.

Just to note, our CI's djgpp is based GCC 7.2.0 and isn't old.
2019-02-13 12:58:01 +03:30
Michiharu Ariza bc33c617b8 Merge branch 'master' into cff-retain-gids 2019-02-12 15:10:50 -08:00
Michiharu Ariza c6af846178 tweaked --desubroutinize to remove hintmask only subrs 2019-02-12 15:10:43 -08:00
Michiharu Ariza c83412e4ce Merge branch 'master' into cff-more-arrayof-fixes 2019-02-11 14:16:25 -08:00
Ken fdfa3d29b7 hb-coretext.cc: remove TARGET_OS_MAC from test (#1578)
it is always true when building on APPLE systems
and this file only builds on APPLE systems
2019-02-11 11:16:05 +03:30
Michiharu Ariza e2856c2d85 retain FDSelect & FDArray with --retain-gids
so in sync with fonttools behavior
2019-02-07 15:32:32 -08:00
Michiharu Ariza 1239b6b2b4 Merge branch 'master' into cff-more-arrayof-fixes 2019-02-07 10:29:40 -08:00
Michiharu Ariza a5fa76977b Merge branch 'master' into cff-retain-gids 2019-02-07 10:28:13 -08:00
Michiharu Ariza 214d0b024b minor change 2019-02-07 10:27:43 -08:00
Ken Cunningham 7859decdd0 hb-coretext.cc: clean up macosx test
TARGET_OS_OSX was introduced only in late OS versions
so always returns as "0" on older systems.

if !TARGET_OS_IPHONE can work, as it returns as !0 on older
systems where TARGET_OS_IPHONE is not defined, but is not
specific

if TARGET_OS_MAC && !(defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE)
is both specific and accurate on all systems.
2019-02-05 20:26:49 -08:00
Michiharu Ariza 30b781f20a Merge branch 'master' into cff-retain-gids 2019-02-01 14:50:34 -08:00
Michiharu Ariza c12862657f added desubroutinize & retain-gids full test cases with CFF fonts
and CFF retain-gids fixes
2019-02-01 14:50:01 -08:00
Michiharu Ariza f2908b4d8f Implement subset --regain-gids option with CFF1/2
along with api tests & expected results
2019-01-31 14:16:37 -08:00
Behdad Esfahbod 1e06282105 Adjust hb_is_signed<>
Fixes https://github.com/harfbuzz/harfbuzz/issues/1535
2019-01-31 13:57:17 -08:00
Behdad Esfahbod 21ea1c9152 Remove stale comment 2019-01-31 13:57:17 -08:00
Michiharu Ariza 9f80eb0177 Merge branch 'master' into cff-more-arrayof-fixes 2019-01-31 12:54:36 -08:00
Behdad Esfahbod 2d940946d5 [iter] Fix mystery crash
Fuzzer caught it:

==14==ERROR: AddressSanitizer: stack-use-after-return on address 0x7fca2ed7a3e0 at pc 0x0000006057aa bp 0x7ffc3290f1d0 sp 0x7ffc3290f1c8
READ of size 4 at 0x7fca2ed7a3e0 thread T0
SCARINESS: 55 (4-byte-read-stack-use-after-return)
    #0 0x6057a9 in OT::SingleSubstFormat2::subset(hb_subset_context_t*) const /src/harfbuzz/src/./hb-ot-layout-gsub-table.hh:194:40
    #1 0x5ff921 in hb_subset_context_t::return_t OT::SingleSubst::dispatch<hb_subset_context_t>(hb_subset_context_t*) const /src/harfbuzz/src/./hb-ot-layout-gsub-table.hh:256:13

I can't reproduce locally, but many of the bots are failing because of this
as well.

It's a pity that operator-> must return pointer.  Ugh.  Why?!
2019-01-30 16:03:16 -08:00
Behdad Esfahbod cbe2118c58 Merge branch 'master' into iter 2019-01-30 15:07:09 -08:00
Behdad Esfahbod 7c292c0853 [iter] Warning fix
Not sure why I don't get it, but this warning:

warning: base class ‘struct hb_iter_fallback_mixin_t<hb_array_t<const OT::UVSMapping>, const OT::UVSMapping&>’ should be explicitly initialized in the copy constructor [-Wextra]
2019-01-30 14:54:23 -08:00
Behdad Esfahbod d983c529b6
Merge pull request #1564 from googlefonts/retain_gids
[subset] Add --retain-gids option to the subsetter.
2019-01-30 17:17:59 -05:00
Behdad Esfahbod 55d1d7c8bc 2.3.1 2019-01-30 13:54:15 -08:00
Behdad Esfahbod e799004e9f [iter] Whitespace 2019-01-29 17:15:12 -08:00
Behdad Esfahbod 849a0f1758 [iter] Add hb_iter_with_fallback_t instead 2019-01-29 17:10:19 -08:00
Behdad Esfahbod 4d40ed9d1a [iter] Add hb_iter_with_mixin_t<> 2019-01-29 13:55:23 -08:00
Behdad Esfahbod 6521d5b201 [iter] Export operator << / >> 2019-01-29 13:44:39 -08:00
Behdad Esfahbod 84a25d79c6 [iter] Rename 2019-01-29 13:39:19 -08:00
Garret Rieger 198859bb37 [subset] For retain gids don't truncate glyphs past the highest requested subset glyph. 2019-01-29 13:19:21 -08:00
Garret Rieger 05e99c86ba [subset] A few small fixes for the new subset plan api. 2019-01-29 13:19:21 -08:00
Garret Rieger bdbe047d6c [subset] Update hb-subset-plan.cc to match hb-subset-plan.hh. 2019-01-29 13:19:21 -08:00
Garret Rieger 74c44ffeba [subset] Update hb-subset-glyf.cc to use new hb-subset-plan API. 2019-01-29 13:19:21 -08:00
Garret Rieger 4842294b86 [subset] Update gsub to use glyphset() method of subset plan. 2019-01-29 13:19:21 -08:00
Garret Rieger 853b1f1aa5 [subset] Correct maxp num glyph's to use new subset plan method. 2019-01-29 13:19:21 -08:00
Garret Rieger 846e05a298 [subset] Re-add glyphs array to subset plan, with new name 'glyphs_deprecated'. Switch CFF subsetting to use it. 2019-01-29 13:19:21 -08:00
Garret Rieger 03e88eab5c Re-implement HMTX/VMTX subsetting. Update it to support glyph renumbering and simplify the implementation. 2019-01-29 13:19:21 -08:00
Garret Rieger 925be29223 Update hb-ot-vorg-table and hb-ot-layout-common to use the updated subset plan api. 2019-01-29 13:19:21 -08:00
Garret Rieger 4af3be6ef8 Remove glyph array from subset plan, make num_glyphs and glyphset private. 2019-01-29 13:19:21 -08:00
Garret Rieger 23f364429d [subset] Fix hdmx subsetting when retain gids is enabled. 2019-01-29 13:19:21 -08:00
Garret Rieger 2da1654aef [subset] Compute num_glyphs during subset plan construction.
Update maxp to use the correct num glyphs.
2019-01-29 13:19:21 -08:00
Garret Rieger 96b038f375 [subset] fix failure to init instruction ranges values for an invalid glyph. 2019-01-29 13:19:21 -08:00
Garret Rieger 4b1ac3a2fa [subset] Do some refactoring in hb-subset-glyf.cc.
- Extract code out into helper methods in several places.
- Bundle loca address, size and is short into a struct.
2019-01-29 13:19:21 -08:00
Garret Rieger b7f971884e Add retain_gids option to subset input. Update glyf and loca handling to respect retain_gids. 2019-01-29 13:19:21 -08:00
Michiharu Ariza b379900755 Merge branch 'master' into cff-more-arrayof-fixes 2019-01-29 12:19:57 -08:00
Behdad Esfahbod e75b22039f Move hb_addressof() to hb-meta.hh 2019-01-28 21:26:23 -05:00
Behdad Esfahbod 71157a4520 [meta] Remove _ft struct names
Using decltype() instead.
2019-01-28 21:20:12 -05:00
Behdad Esfahbod 9103bd056f [pair] Use decltype 2019-01-28 21:16:51 -05:00
Behdad Esfahbod a30e13469e [iter] Add operator << to set / vector 2019-01-28 16:39:01 -05:00
Behdad Esfahbod d438e61042 [iter] Fix operator() impls 2019-01-28 16:34:04 -05:00
Behdad Esfahbod 57795bc8dd [iter] Add operator>> and operator<< 2019-01-28 16:23:12 -05:00
Behdad Esfahbod 8bd96be994 [iter] Use auto c = C.iter() internally 2019-01-28 16:17:36 -05:00
Behdad Esfahbod 073fa4ac5a Merge branch 'master' into iter 2019-01-28 14:35:41 -05:00
Behdad Esfahbod 9a1df82e3f [uniscribe] Whitelist function type cast 2019-01-28 14:15:18 -05:00
Behdad Esfahbod 6e1c3eaf70 Fix sign comparison error 2019-01-28 14:12:41 -05:00
Behdad Esfahbod 9db7a7da63 Fix warning
c:\projects\harfbuzz\src\hb-ot-color-cbdt-table.hh(59): warning C4146: unary minus operator applied to unsigned type, result still unsigned [C:\projects\harfbuzz\build\harfbuzz.vcxproj]
2019-01-28 14:09:59 -05:00
Behdad Esfahbod 51b584880e [pragma] Silence MSVC unknown-pragma warning 2019-01-28 14:09:45 -05:00
Behdad Esfahbod d592bd16cd Try fixing MSVC build 2019-01-28 13:41:40 -05:00
Behdad Esfahbod 0363ce650b [iter] Accept C arrays in hb_iter() 2019-01-27 01:06:32 +01:00
Behdad Esfahbod b62e7f9223 [test] Test unary operator+
"Test" as in compiles..
2019-01-27 00:51:57 +01:00
Behdad Esfahbod 778c96b8d7 [iter] Fix hb_iter() 2019-01-27 00:50:54 +01:00
Behdad Esfahbod 2f5b1a9104 [iter] Add unary operator+ that returns a copy 2019-01-27 00:49:37 +01:00
Behdad Esfahbod fbab07f9b3 [iter] Add hb_bool() and make hb_filter default to it for predicate 2019-01-27 00:44:45 +01:00
Behdad Esfahbod 313d63e240 [meta] Back to using _ft suffix for function-object types
Seprate namespace, cleaner, more clear.
2019-01-26 22:58:26 +01:00
Behdad Esfahbod 2aff6d9625 [iter] Test that default-constructed iterators are empty 2019-01-26 22:54:25 +01:00
Behdad Esfahbod f35e7eabf1 pragma GCC diagnostic error "-Winjected-class-name"
See 6b6783e158
2019-01-26 22:50:00 +01:00
Behdad Esfahbod 509353357c [iter] Use hb_declval() instead of Null() to get instance
I had used Null to make one of the bots happy before.  Not going
to bend to such demands anymore..
2019-01-26 22:47:35 +01:00
Behdad Esfahbod 6b6783e158 [iter/meta] Fix build on newer clang
The mystery failure had to do with SFINAE failure because the template
function involved was accessing ::iter_t of a type that was also named iter_t.
In this context, apparently:

warning: ISO C++ specifies that qualified reference to 'iter_t' is a
constructor name rather than a type in this context, despite preceding 'typename' keyword
[-Winjected-class-name]

We use a new macro, also called hb_iter_t(), to get iterator type of
a type.  This uses declval/hb_decltype, and has the added benefit
that it returns correct type for const vs non-const objects, if they
have different iterators.
2019-01-26 22:44:09 +01:00
Behdad Esfahbod 5adb113baf [meta] Mark function-objects as const 2019-01-26 22:15:59 +01:00
Behdad Esfahbod ac90f17c55 Merge branch 'master' into iter 2019-01-26 14:05:39 +01:00
Behdad Esfahbod 60022ecced Fix -Wcast-function-type warnings in util/ with gcc 4.8 2019-01-26 14:04:51 +01:00
Behdad Esfahbod f398097529 More static constexpr 2019-01-25 16:08:25 +01:00
Behdad Esfahbod 090fe56dc6 Merge branch 'master' into iter 2019-01-25 16:06:52 +01:00
Michiharu Ariza c685644386 Merge branch 'master' into cff-more-arrayof-fixes 2019-01-24 13:19:18 -08:00
Behdad Esfahbod e970de48bc [AAT] Minor sign 2019-01-24 18:16:17 +01:00
Behdad Esfahbod a371a28cda [AAT] Use a ring buffer for ligature stack
I think Apple does very similarly, but probably with a stack size of 16.
We do it with a stack size that is currently set to 64.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1531
2019-01-24 18:12:25 +01:00
Behdad Esfahbod 7886b1578f Whitespace 2019-01-24 18:06:17 +01:00
Behdad Esfahbod b976940243 [AAT] Handle transition errors during machine operation
Before we used to give up.  Now, just ignore error and continue processing.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1531
2019-01-24 18:01:07 +01:00
Michiharu Ariza 0bd0a3311c Merge branch 'master' into cff-more-arrayof-fixes 2019-01-24 08:53:28 -08:00
Behdad Esfahbod e234bb6a42 [AAT] Ignore machine errors and continue 2019-01-24 17:23:11 +01:00
Behdad Esfahbod 1ec90514f6 [AAT] Minor 2019-01-24 17:21:41 +01:00
Behdad Esfahbod 299eca0c3b [AAT] Handle out-of-bounds classes 2019-01-24 17:17:00 +01:00
Behdad Esfahbod c4623db4a3 [AAT] Minor 2019-01-24 17:10:12 +01:00
Behdad Esfahbod c4e36f97b6 [AAT] Minor 2019-01-24 17:06:16 +01:00
Behdad Esfahbod f60282c5bf More pragma control
Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=924848
2019-01-24 16:29:09 +01:00
Behdad Esfahbod fd0889f903 Comment 2019-01-24 16:12:52 +01:00
Behdad Esfahbod 9f31417733 Form cluster for Emoji sub-region tag sequences
Fixes https://github.com/harfbuzz/harfbuzz/issues/1556
2019-01-24 16:08:33 +01:00
Behdad Esfahbod 3ecda71041 Adjust mark offsets when zeroing from fallback mark positioning code
Adjust tests.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1532
2019-01-24 12:28:24 +01:00
Michiharu Ariza 12cd3171ba Merge branch 'master' into cff-more-arrayof-fixes 2019-01-23 14:05:42 -08:00
Michiharu Ariza 261a742181 more rewriting with ArrayOf<>
CFF1 Encoding0, Encoding1, CFF1SuppEncData
2019-01-23 14:04:29 -08:00
Behdad Esfahbod 36fb2b4da9 [AAT] In InsertionChain, set mark to previous-position if inserting
Fixes MORX-31
2019-01-23 20:53:57 +01:00
Behdad Esfahbod baf4d6a68a [AAT] Remove mark_set from InsertionChain 2019-01-23 20:36:07 +01:00
Behdad Esfahbod 0b2fa342de More of previous 2019-01-22 16:36:00 +01:00
Behdad Esfahbod a5e5dd8b42 Fix sign-compare error resulted from promoting unsigned integers to signed larger ints
Clang and gcc know not to warn in these cases, but not nonmainstream compilers
2019-01-22 16:30:07 +01:00
Behdad Esfahbod 32379bbf10 Cast HB_UNTAG results to uint8_t 2019-01-22 12:55:29 +01:00
Behdad Esfahbod 83d4aa5ca9 More -Wcast-error fix 2019-01-22 12:52:23 +01:00
Behdad Esfahbod 447323b85a Better fix for -Wcast-align errors 2019-01-22 12:50:12 +01:00
Behdad Esfahbod 81ec543d80 More -Wcast-error fixes 2019-01-22 12:43:12 +01:00
Behdad Esfahbod 9077272549 pragma GCC diagnostic error "-Wsign-compare" 2019-01-22 12:40:18 +01:00
Behdad Esfahbod 8d05bf7dc0 Fix cast-align error
If compiler doesn't inline StructAtOffset, this was an error since we
only disable cast-align at call-site.  So, move the cast out.

../src/hb-machinery.hh: In instantiation of 'const Type& StructAtOffset(const void*, unsigned int) [with Type = unsigned int]':
../src/hb-font.cc:146:85:   required from here
../src/hb-machinery.hh:63:12: error: cast from 'const char*' to 'const unsigned int*' increases required alignment of target type [-Werror=cast-align]
 { return * reinterpret_cast<const Type*> ((const char *) P + offset); }
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/hb-machinery.hh: In instantiation of 'Type& StructAtOffset(void*, unsigned int) [with Type = unsigned int]':
../src/hb-font.cc:147:79:   required from here
../src/hb-machinery.hh:66:12: error: cast from 'char*' to 'unsigned int*' increases required alignment of target type [-Werror=cast-align]
 { return * reinterpret_cast<Type*> ((char *) P + offset); }
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2019-01-22 12:34:05 +01:00
Behdad Esfahbod 70a52d6bd8 Convert all other enum class consts to static constexpr
Fixes https://github.com/harfbuzz/harfbuzz/issues/1553
2019-01-22 12:17:26 +01:00
Behdad Esfahbod 5d4b0377b9 Convert unsigned enum class consts to static constexpr
Part of https://github.com/harfbuzz/harfbuzz/issues/1553
2019-01-22 12:17:26 +01:00
Behdad Esfahbod ef00654962 Convert tag enum class consts to static constexpr
Part of https://github.com/harfbuzz/harfbuzz/issues/1553
2019-01-22 12:17:26 +01:00
Behdad Esfahbod 39e1b6d03f Convert boolean enum class consts to static constexpr
Part of https://github.com/harfbuzz/harfbuzz/issues/1553
2019-01-22 12:17:26 +01:00
Behdad Esfahbod 271cb7c1c0 Make some enum constants unsigned 2019-01-22 12:17:26 +01:00
Behdad Esfahbod 3d9a6e6266 Whitespace 2019-01-22 12:17:26 +01:00
Behdad Esfahbod c81f02fd06 pragma GCC diagnostic error "-Wvla" 2019-01-22 12:17:26 +01:00
Behdad Esfahbod 380c3cffb9 Use enum for class constant 2019-01-22 10:51:20 +01:00
Behdad Esfahbod 6d042a18e7 [CFF] Use enum for tableTag 2019-01-22 10:51:20 +01:00
Behdad Esfahbod c1cbbb9459 Use static constexpr for large class constants 2019-01-22 10:51:20 +01:00
Behdad Esfahbod 21c0713a1c Whitespace 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 934d3fa2a7 Use more iter pipelines 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 420d8ac350 [algs] Add hb_iter()
Makes it nicer in pipelines.
2019-01-20 20:12:12 -05:00
Behdad Esfahbod 54ec48ea20 Use iter pipelines more 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 83cecd80d9 [iter] Default projection to identity 2019-01-20 20:12:12 -05:00
Behdad Esfahbod a699c6b17c [algs] Add hb_identity 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 463cfb426f Fix unused-variable warnings
inline variables are not C++11, so mark them unused...
2019-01-20 20:12:12 -05:00
Behdad Esfahbod f4cbb1ee0c WIP 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 471e96e55d [iter] Use forwarding references 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 528ea66f24 [algs] Fix hb_first() / hb_second() 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 343f5a4bfc [iter] Misc fixes to get piping almost work 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 7cedf7f64c Change hb_first() and hb_second() to function objects 2019-01-20 20:12:12 -05:00
Behdad Esfahbod f35568d603 [iter] Add hb_filter()
Untested.
2019-01-20 20:12:12 -05:00
Behdad Esfahbod 1733e4702c [iter] Add hb_map()
Untested.
2019-01-20 20:12:12 -05:00
Behdad Esfahbod f7fcc47641 [iter] Make hb_zip() take const references 2019-01-20 20:12:12 -05:00
Behdad Esfahbod ede1a71b31 Minor rename 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 93551669c5 Remove unused Coverage::iter_t::get_coverage() 2019-01-20 20:12:12 -05:00
Behdad Esfahbod af2067e87b Use hb_zip() moooore 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 0d1fdf939d Use hb_zip() some mooore 2019-01-20 20:12:12 -05:00
Behdad Esfahbod af6c190235 Use hb_zip() some moore 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 83ad0b6d0f Use hb_zip() some more 2019-01-20 20:12:12 -05:00
Behdad Esfahbod f0dd0656b8 Use hb_zip() some 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 200cdb721b [iter] Rename hb_zip_t to hb_zip_iter_t 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 3290c181c1 [algs] Whitespace 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 014c50292b [iter] Move code 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 6e3ad650d1 Rename hb-dsalgs to hb-algs 2019-01-20 20:12:12 -05:00
Behdad Esfahbod f27607580e [algs] Add hb_first() and hb_second() 2019-01-20 20:12:12 -05:00
Behdad Esfahbod a7de144df3 Implement uniform map interface
Coverage, ClassDef, hb_set_t, and hb_map_t implement.
2019-01-20 20:12:12 -05:00
Behdad Esfahbod 7987095e64 [meta] Remove hb_enable_if_t
It was only used for C++<11 which does not allow default parameters
in function templates.  Looks like we cannot support <11 anyway, so,
start cleaning up.
2019-01-20 20:12:12 -05:00
Behdad Esfahbod 15a6928436 [iter] Implement operator-> unconditionally
The right condition to check for would have been "is_struct", which
we don't have.
2019-01-20 20:12:12 -05:00
Behdad Esfahbod 8f52a827e7 Allow rvalues in hb_addressof() 2019-01-20 20:12:12 -05:00
Behdad Esfahbod a4ea0d3680 [iter] Change from const_iter_t/iter_t to iter_t/writer_t 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 7798e4fcc3 [iter] Change Coverage iterator to only return glyph-id 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 84e5d00229 [iter] Add hb_zip() 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 636786ecaf [iter] Rename __item_type__ to __item_t__ 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 6caf76f4a8 Tighten Coverage iteration 2019-01-20 20:12:12 -05:00
Behdad Esfahbod ff3a7ce1e7 [subset] Minor 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 42bf80e578 [iter] More semicolon 2019-01-20 20:12:12 -05:00
Behdad Esfahbod f78f837ef1 [iter] Use aliasing using for types
Fix ambiguity of hb_sorted_array_t::item_t with gcc.  No idea if that's a gcc bug
or what spec requires, but using aliasing using seems to fix it.  It probably breaks
our non-C++11 bots, in which case I have to condition the change.  Testing.
2019-01-20 20:12:12 -05:00
Behdad Esfahbod 3fc03e42ce [iter] Use static_assert with hb_is_random_access_iterator()
Both, checks constexpr'ness, and fixes build with cra**y implementations
of assert() macro:

test-iter.cc:108:11: error: too many arguments provided to function-like macro invocation
  assert (hb_is_random_access_iterator (array_iter_t<int>));
          ^
./hb-iter.hh:186:42: note: expanded from macro 'hb_is_random_access_iterator'
  hb_is_random_access_iterator_of (Iter, typename Iter::item_t)
                                         ^
/usr/include/x86_64-linux-gnu/sys/cdefs.h:89:9: note: macro '__STRING' defined here
\#define __STRING(x)     #x
        ^
test-iter.cc:108:3: error: use of undeclared identifier '__STRING'
  assert (hb_is_random_access_iterator (array_iter_t<int>));
  ^
/usr/include/assert.h:91:21: note: expanded from macro 'assert'
   : __assert_fail (__STRING(expr), __FILE__, __LINE__, __ASSERT_FUNCTION))
                    ^
2019-01-20 20:12:12 -05:00
Behdad Esfahbod 6af9c5f18e [iter] Remove stray semicolons 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 74ca7b580c [OT] Implement operator[] for Coverage and ClassDef 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 6c548b6657 [iter] Add TODO 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 362d4e7cc3 [iter] Implement for OT::ArrayOf / OT::SortedArrayOf 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 2f837a365c [SortedArrayOf] Fix sub_array() return type 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 54c30e949e [iter] Constrain hb_fill() and hb_copy() 2019-01-20 20:12:12 -05:00
Behdad Esfahbod dc0a98cbe7 [iter] Add TODO 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 2658e40ffb [iter] Add hb_is_random_access_iterator() 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 445364d80a [iter] Rename hb_is_[sorted_]iterator() -> hb_is_[sorted_]iterator_of() 2019-01-20 20:12:12 -05:00
Behdad Esfahbod a6c013b1bf [meta] Add hb_declval() macro 2019-01-20 20:12:12 -05:00
Behdad Esfahbod adc5910a63 [iter] Syntax 2019-01-20 20:12:12 -05:00
Behdad Esfahbod ca6adcd1ad [iter] Test hb_is_iterable / hb_is_iterator 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 8237809f06 [serialize] Make SortedArrayOf:;serialize() take sorted-iterator 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 47333c8a30 [iter] Fix operator-> 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 177a8af380 [array] SFINAE fun 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 8414f16787 [meta] Rename 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 8e0a58e1b3 [array] Remove construction that was removing constness 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 85969e357a [iter] Fix test 2019-01-20 20:12:12 -05:00
Behdad Esfahbod da49961836 [iter] Remove comment 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 815cde9fa3 [iter] Use is_sorted_iterator 2019-01-20 20:12:12 -05:00
Behdad Esfahbod ed4336680d [iter] Handhold hb_is_iterator() type deduction
by partial-instantiating on Iter.
2019-01-20 20:12:12 -05:00
Behdad Esfahbod cb5011d364 Revert "[iter] Add hb_iter_of_t<>"
This reverts commit d6cbe96e2fc7bc8f1c10e631b52b1ef31ff9a6f5.

Isn't useful, as duplicate inheritance of same type results in ambiguity
errors...
2019-01-20 20:12:12 -05:00
Behdad Esfahbod c132cda9d9 [iter] Fix warnings 2019-01-20 20:12:12 -05:00
Behdad Esfahbod c9d8a07e30 [iter] Add hb_iter_of_t<> 2019-01-20 20:12:12 -05:00
Behdad Esfahbod b5d6fe1a45 [iter] Remove hb_sorted_iter_t
Not enforcing it using type hierarchy.
2019-01-20 20:12:12 -05:00
Behdad Esfahbod 255085bd59 [iter] Const correctness 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 415f3f4320 Add operator= to IntType, commented out
https://github.com/harfbuzz/harfbuzz/pull/1510
2019-01-20 20:12:12 -05:00
Behdad Esfahbod 183be8f452 [iter] Minor 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 6cd96ba1ac [iter] Make is_random_access_iterator a constant
We cannot rely on constexpr functions...
2019-01-20 20:12:12 -05:00
Behdad Esfahbod a685bfe8fc Separate GlyphID from HBUINT16
For stricter enforcement.
2019-01-20 20:12:12 -05:00
Behdad Esfahbod 8ac64d0090 [iter] Fix sorted_iter iter class 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 93615b9598 [iter/meta] Add hb_is_sorted_iterator() 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 92f25db1e8 [iter] Remove stale comment 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 40c24fd4a6 [iter] Port Coverage towards iter_t instead of array_t specifics 2019-01-20 20:12:12 -05:00
Behdad Esfahbod d552b6818c [meta] Move typename around
We'll see if bots like.
2019-01-20 20:12:12 -05:00
Behdad Esfahbod f64ea8fc65 [meta] Move code around 2019-01-20 20:12:12 -05:00
Behdad Esfahbod aa2ab4f061 [iter] WHitespace 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 851fbb23ea [iter] Port Coverage::serialize to hb_is_iterator 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 06a44e2e53 [iter/meta] Match hb_is_iterator<> using SFINAE
By specifying Item type, which is desirable.
2019-01-20 20:12:12 -05:00
Behdad Esfahbod bcb913efb4 Minor 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 859a880b08 [iter] Add back operator +
Too ugly to remove..
2019-01-20 20:12:12 -05:00
Behdad Esfahbod 076faf7c18 [iter] Disable operator +
To see if it makes bots happy... This is frustrating.
2019-01-20 20:12:12 -05:00
Behdad Esfahbod a46874f1ab [iter] Revert back uses of C++11 auto type deduction 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 0828db8444 [iter] Rename 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 037f735efd [iter] Remove friend operator +, hoping to fix some bots 2019-01-20 20:12:12 -05:00
Behdad Esfahbod cb27918d0a Use Null() instead of declval(), hoping to fix some bots 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 3d22900f62 [meta] Don't use template default arguments for functions
That's a C++11 extension apparently...
2019-01-20 20:12:12 -05:00
Behdad Esfahbod b89d20dd9f [meta] Fix unused-function-template warning 2019-01-20 20:12:12 -05:00
Behdad Esfahbod df138da2e6 [iter/meta] Implement is_iterator
Removes use of auto type deduction again, which was not supported on many bots.
2019-01-20 20:12:12 -05:00
Behdad Esfahbod 8570da1d74 [meta] Minor 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 442f4a5891 [meta] Move more code here 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 8c6cbbdfa3 [iter/meta] Add hb_is_iterable 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 576d5e2420 Don't use delegating constructors
Not all C++11 features are created equal when it comes to support...
2019-01-20 20:12:12 -05:00
Behdad Esfahbod e32bf39766 [meta] Add enable_if 2019-01-20 20:12:12 -05:00
Behdad Esfahbod e76a3cae0f Add hb-meta.hh for meta-programming 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 5ec11ce13a [iter] Clarify readonly vs lvalue iterators
lvalue iterators must declare __item_type__ as a reference.
2019-01-20 20:12:12 -05:00
Behdad Esfahbod 2cbf5bf3a9 [iter] Test OT::Coverage iter 2019-01-20 20:12:12 -05:00
Behdad Esfahbod fd75d29f0f [iter] Streamline vector iterators 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 570473a345 [iter] Make hb_sorted_array_t work as iter
Ugly, but does the job.
2019-01-20 20:12:12 -05:00
Behdad Esfahbod d6024794fb Change hb_void_t implementation 2019-01-20 20:12:12 -05:00
Behdad Esfahbod cde31988c2 [iter] Mark Coverage iterator sorted 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 49161d411f [subset] Take iterator in ArrayOf serialize
Still not satisfied with how I can enforce iterators only, but
seems to work for now.
2019-01-20 20:12:12 -05:00
Behdad Esfahbod e16884248f [iter] Port Coverage iterator to hb_iter_t 2019-01-20 20:12:12 -05:00
Behdad Esfahbod c68bca0f95 Add hb_pair_t<> and hb_pair() 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 8303a9b011 [Coverage] Ensure increasing coverage in iteration 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 50cd26d394 [Coverage] Mark iterator methods const 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 9df1a6eba7 [iter] Use operator bool in a few places 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 7788ac14a4 [iter] Remove redundant methods 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 3dea9affda [iter] Test default-constructability 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 743ff09368 [iter] Implement friend opeator + (int, iter) 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 6dc4a1c9b1 [iter] Remove const_iter 2019-01-20 20:12:12 -05:00
Behdad Esfahbod f2b56af3ef [iter] Remove hack for older compilers 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 2ea79e0340 [iter] Minor 2019-01-20 20:12:12 -05:00
Behdad Esfahbod fb053b6333 [iter] Rename random_access() to constexpr is_random_access() 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 2790aad28c [iter] Add operator -> 2019-01-20 20:12:12 -05:00
Behdad Esfahbod d3976b7e63 [iter] Make them work, mostly 2019-01-20 20:12:12 -05:00
Behdad Esfahbod 959bb58bdd [vector] Add iterator 2019-01-20 20:12:12 -05:00
Behdad Esfahbod dd7c628ed1 Use enum for class constant 2019-01-20 19:51:08 -05:00
Behdad Esfahbod cf7edf52c3 [CFF] Use enum for tableTag 2019-01-20 19:49:59 -05:00
Behdad Esfahbod bd1318b8cc Use static constexpr for large class constants 2019-01-20 19:47:52 -05:00
Behdad Esfahbod 043b610fa6 Fix sign compare warnings
../../third_party/harfbuzz-ng/src/src/hb-map.hh(56,45):  warning: comparison of integers of different signs: 'const hb_codepoint_t' (aka 'const unsigned int') and 'hb_map_t::(anonymous enum at ../../third_party/harfbuzz-ng/src/src/hb-map.hh:169:3)' [-Wsign-compare]
    bool is_unused () const    { return key == INVALID; }
2019-01-19 09:21:33 -05:00
Behdad Esfahbod ce317d0320 Fix warning
warning: '_WIN64' is not defined, evaluates to 0 [-Wundef]
2019-01-19 09:21:33 -05:00
Ebrahim Byagowi 0c2bd1b160
[dwrite] Fix delete-non-virtual-dtor warning (#1550) 2019-01-19 16:30:07 +03:30
Behdad Esfahbod 89bcfb204c Remove TRACE_COLLECT_GLYPHS 2019-01-18 14:59:18 -05:00
Behdad Esfahbod f13b6786f0 [pragma] Only add if GCC or clang 2019-01-18 14:53:54 -05:00
Behdad Esfahbod c2ea7a9da4 [directwrite] More fix 2019-01-18 14:20:45 -05:00
Ebrahim Byagowi 9714d3ec5c
[dwrite] Try to fix delete-non-virtual-dtor warnings
Fixes #1548 hopefully
2019-01-18 21:55:21 +03:30
Behdad Esfahbod 0772c06f96 Remove tracing from closure 2019-01-18 12:53:47 -05:00
Behdad Esfahbod d9f6be3a61 Fix -Wundef errors with __GNUC__
Fixes https://github.com/harfbuzz/harfbuzz/issues/1549
2019-01-18 12:53:47 -05:00
Michiharu Ariza 28917e58f9 init interp_env_t::hintmask_size
fixes issue #1547
2019-01-18 09:43:51 -08:00
Behdad Esfahbod 9b4e51b2e4 [pragma] Enable error -Wdelete-non-virtual-dtor
Currently fails directwrite backend.
2019-01-18 12:23:02 -05:00
Behdad Esfahbod e65272281c [directwrite] Fix error
hb-directwrite.cc: In constructor 'TextAnalysis::TextAnalysis(const wchar_t*, uint32_t, const wchar_t*, DWRITE_READING_DIRECTION)':
hb-directwrite.cc:489:18: error: 'TextAnalysis::mText' will be initialized after [-Werror=reorder]
   const wchar_t* mText;
                  ^~~~~
hb-directwrite.cc:488:12: error:   'uint32_t TextAnalysis::mTextLength' [-Werror=reorder]
   uint32_t mTextLength;
            ^~~~~~~~~~~
hb-directwrite.cc:282:3: error:   when initialized here [-Werror=reorder]
   TextAnalysis (const wchar_t* text, uint32_t textLength,
   ^~~~~~~~~~~~
hb-directwrite.cc: In function 'hb_bool_t _hb_directwrite_shape_full(hb_shape_plan_t*, hb_font_t*, hb_buffer_t*, const hb_feature_t*, unsigned int, float)':
2019-01-18 12:22:07 -05:00
Behdad Esfahbod b900f78088 [pragma] More cast-align whitelist 2019-01-18 10:08:23 -05:00
Behdad Esfahbod 0d8b931bbe [pragma] Allow cast-align in hb-font.cc
../src/hb-machinery.hh: In instantiation of 'const Type& StructAtOffset(const void*, unsigned int) [with Type = unsigned int]':
../src/hb-font.cc:144:85:   required from here
../src/hb-machinery.hh:63:12: error: cast from 'const char*' to 'const unsigned int*' increases required alignment of target type [-Werror=cast-align]
 { return * reinterpret_cast<const Type*> ((const char *) P + offset); }
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/hb-machinery.hh: In instantiation of 'Type& StructAtOffset(void*, unsigned int) [with Type = unsigned int]':
../src/hb-font.cc:145:79:   required from here
../src/hb-machinery.hh:66:12: error: cast from 'char*' to 'unsigned int*' increases required alignment of target type [-Werror=cast-align]
 { return * reinterpret_cast<Type*> ((char *) P + offset); }
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/hb-machinery.hh: In instantiation of 'Type& StructAtOffset(void*, unsigned int) [with Type = int]':
2019-01-18 10:03:43 -05:00
Behdad Esfahbod a25174a56b [pragma] GCC diagnostic error "-Wreorder" 2019-01-18 09:59:36 -05:00
Behdad Esfahbod 4660090569 [pragma] GCC diagnostic warning "-Wmaybe-uninitialized" 2019-01-18 09:53:16 -05:00
Behdad Esfahbod 7a634d7d5b [pragma] Massage more 2019-01-18 09:49:14 -05:00
Behdad Esfahbod 16e5ba85b1 [pragma] More 2019-01-18 09:46:17 -05:00
Behdad Esfahbod 2bd530d598 [pragma] Reorg again
https://github.com/harfbuzz/harfbuzz/issues/1546
2019-01-18 09:28:22 -05:00
Behdad Esfahbod c04272fac8 [pragma] GCC diagnostic ignored "-Wunknown-warning-option"
Try at fixing https://github.com/harfbuzz/harfbuzz/issues/1546
2019-01-18 08:49:45 -05:00
Behdad Esfahbod 4d3c8f9685 [uniscribe] More warnings 2019-01-17 19:58:54 -05:00
Behdad Esfahbod 6a5d2b21d8 [uniscribe] Fix warnings 2019-01-17 19:57:17 -05:00
Behdad Esfahbod 5b13e458c3 Fix build 2019-01-17 19:52:32 -05:00
Behdad Esfahbod a77bd6bb89 [pragma] GCC diagnostic ignored "-Wclass-memaccess" 2019-01-17 19:33:41 -05:00
Behdad Esfahbod 436c7b294a [pragma] ignored -Wunsafe-loop-optimizations // TODO fix 2019-01-17 19:03:33 -05:00
Behdad Esfahbod e3b3181e9d [pragma] error -Wclass-memaccess 2019-01-17 19:02:06 -05:00
Behdad Esfahbod 1a6b97a491 [pragma] More 2019-01-17 18:55:03 -05:00
Behdad Esfahbod 06e8091661 [pragma] More 2019-01-17 18:47:32 -05:00
Behdad Esfahbod 1077e40bf1 [pragma] Flesh out more 2019-01-17 18:36:10 -05:00
Behdad Esfahbod 7e6bd510fc Use NNOffsetTo<> in rest of places 2019-01-17 18:24:18 -05:00
Behdad Esfahbod b1152d5e66 Use NNOffsetTo<> 2019-01-17 18:17:04 -05:00
Behdad Esfahbod 205d72a198 Add NNOffsetTo<> 2019-01-17 18:10:38 -05:00
Behdad Esfahbod c99d13d860 [AAT] Comment 2019-01-17 17:56:27 -05:00
Behdad Esfahbod f39b5603ff Comment 2019-01-17 17:50:01 -05:00
Behdad Esfahbod 347ad454b8 [AAT] Remove unused code 2019-01-17 17:47:29 -05:00
Behdad Esfahbod b344d4385a [AAT] Allow null in ankr lookupTable offset 2019-01-17 17:44:39 -05:00
Behdad Esfahbod 14a560a245 [pragma GCC] Ignore -Wtype-limits 2019-01-17 17:42:44 -05:00
Behdad Esfahbod 3f2daae630 More GCC pragmas 2019-01-17 15:27:31 -05:00
Behdad Esfahbod d6c5473e1f Rename macro 2019-01-17 15:22:46 -05:00
Behdad Esfahbod a9946b7cfe Add more GCC warning pragmas 2019-01-17 15:22:28 -05:00
Behdad Esfahbod 868b0c0c2e Move -Wcast-align to hb.hh 2019-01-17 15:18:18 -05:00
Behdad Esfahbod 8874eef8ff Add pragram GCC diagnostic ignored "-Wunused-macros" 2019-01-17 15:04:44 -05:00
Behdad Esfahbod cc8e9a436f [AAT] Fully sanitize ankr table at sanitize time
Third try to fix access. Followup 6879efc2c1

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12532
Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=922303
2019-01-17 14:55:05 -05:00
Behdad Esfahbod 6879efc2c1 [AAT] Fix anchor bound checking, again
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12532
Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=922303
2019-01-17 14:08:02 -05:00
Behdad Esfahbod a262eb3d0b [aat] Minor 2019-01-17 14:06:32 -05:00
Behdad Esfahbod c986ca15a6 Improve overflow avoidance
Better fix for 480406cd3e
This way we behave the same on 32bit and 64bit archs.
2019-01-15 13:58:19 -05:00
Behdad Esfahbod 0d2727f4fe
fix FDSelect fuzzing bug (#1539)
Rewrote struct FDSelect3_4.ranges as ArrayOf
Updated FDSelect3_4::sanitize () to call ranges.sanitize ()
nRanges now a function to return a reference to ranges.len
2019-01-14 18:23:17 -08:00
Behdad Esfahbod 9f6172d669 Move _POSIX_SOURCE definition
Fixes https://github.com/harfbuzz/harfbuzz/issues/1308
2019-01-14 20:45:31 -05:00
Behdad Esfahbod 480406cd3e Fix assertion on address overflow
Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=917031
2019-01-14 15:27:34 -05:00
Behdad Esfahbod 7a6686a589 [AAT] Fix mort ContextualSubtable offset access
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12312
2019-01-14 15:09:14 -05:00
Behdad Esfahbod a3fa7d3336 [AAT] Fix ankr table access
Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=918340
2019-01-14 14:37:36 -05:00
Michiharu Ariza 760303d411 deleted a duplicate fontdicts_mod.fini() call (#1538) 2019-01-11 15:27:35 -08:00
Michiharu Ariza 7b48641aa8 fix leak in subset_enc_supp_codes (#1537)
oss-fuzz issue 12310
2019-01-08 15:37:48 -05:00
Ebrahim Byagowi 97f67a3c3d
[ci] Enable more of GCC compile warnings (#1533) 2019-01-04 23:10:39 +03:30
cclauss 26c5b54fb0 CircleCI: Test for Python 3 syntax errors and undefined names (#1522)
Catch missing imports and errors like #1520 and #1521

__E901,E999,F821,F822,F823__ are the "_showstopper_" [flake8](http://flake8.pycqa.org) issues that can halt the runtime with a SyntaxError, NameError, etc. Most other flake8 issues are merely "style violations" -- useful for readability but they do not effect runtime safety.
* F821: undefined name `name`
* F822: undefined name `name` in `__all__`
* F823: local variable name referenced before assignment
* E901: SyntaxError or IndentationError
* E999: SyntaxError -- failed to compile a file into an Abstract Syntax Tree
2018-12-31 07:00:43 +03:30
cclauss f4da28b1f1 Python 3 fixes to gen-os2-unicode-ranges.py (#1521)
In Python 3, __reload()__ was moved and __sys.setdefaultencoding()__ because the default is already utf-8.  Also __Error()__ is an _undefined name_ and __Exception()__ creates a generic exception.
2018-12-30 15:28:34 +03:30
Behdad Esfahbod d092fb2719 Ouch! Fix build on C++<11 2018-12-30 01:53:03 -05:00
Behdad Esfahbod 89949ed28d Fix ubsan with passing nullptr to qsort() 2018-12-30 01:52:19 -05:00
Behdad Esfahbod 357a0a7ad3 Fix build on C++ < 11 2018-12-27 18:29:23 -05:00
Behdad Esfahbod 54c0a17310 [vector] Fix warning 2018-12-27 18:28:07 -05:00
Behdad Esfahbod 1043ddbee8 [aat] Minor 2018-12-27 18:27:11 -05:00
Behdad Esfahbod 71da9ca62f [vector] Remove use of arrayZ() by using casts 2018-12-27 18:01:06 -05:00
Behdad Esfahbod fa333e34d6 [vector] Remove static_array
Was good idea, but with C++ types with constructor/destructor, was getting in
the way as compiler was destructing those items where it was not desired.
Since C++ does not allow zero-sized arrays, just remove it...
2018-12-27 17:56:22 -05:00
Behdad Esfahbod ab2258a419 [vector] Use allocated = -1 to signify failure 2018-12-27 17:45:05 -05:00
Michiharu Ariza 09fa536d89 fix lealk with cff2::accelerator_templ_t::topDict (#1517) 2018-12-27 11:33:09 -05:00
Behdad Esfahbod 3b81442cd5 [vector] Change pre-alloced count from 8 to 2
I'm thinking about dropping it to zero, but that needs slight code changes.
2018-12-24 11:31:04 -05:00
Behdad Esfahbod d25a2f1496 Fix a few warnings 2018-12-23 20:34:24 -05:00
Behdad Esfahbod 85003b594b [iter] Fix warning 2018-12-23 20:34:24 -05:00
Behdad Esfahbod e4355b1ca1 [set] Add iter_t as alias to const_iter_t 2018-12-23 20:34:24 -05:00
Behdad Esfahbod 33f8de6186 [set] Change to const_iter 2018-12-23 20:34:24 -05:00
Behdad Esfahbod f88fed5cd8 [set] Cache length in iterator 2018-12-23 20:34:24 -05:00
Ebrahim Byagowi d0a706c7fd Minor, remove redundant inline 2018-12-22 20:07:57 +03:30
Ebrahim Byagowi ae6e348d64 Minor, tweak spaces 2018-12-22 20:07:57 +03:30
Michiharu Ariza 29f0b6bce7 CFF renaming (#1507)
* reimplement ByteStr as byte_str_t based on hb_ubytes_t

Unuse start_embed<ByteStr>
Also renamed SubByteStr to byte_str_ref_t
More renaming to come

* substr renamed to str_ref in line with its type byte_str_ref_t

* uncamelize non-table struct names

* uncamelized non-struct types OpCode etc

* add byte_str_t copy ctor

* test

* test2

* undo tests

* fix bot failure

* undo the previous change

* fixed tabs, added inline

* Revert "fixed tabs, added inline"

This reverts commit 21163c30e9.

* fix tabs
2018-12-22 10:47:04 -05:00
Behdad Esfahbod 89d04129e2 [set] Actually derive iterator from hb_sorted_iter_t<> 2018-12-21 20:07:52 -05:00
Behdad Esfahbod fc35919d01 [set] Implement unified iterator 2018-12-21 20:06:17 -05:00
Behdad Esfahbod 4911e67d2d [set] Mark some internals protected 2018-12-21 20:00:52 -05:00
Behdad Esfahbod 954b985422 [iter] Add hb_sorted_iter_t<> 2018-12-21 19:55:02 -05:00
Behdad Esfahbod b205105c9e [iter] Change operator[] operand to be signed
To fix older compilers again (this was the case in hb_array_t).

hb-ot-layout-common.hh:1353: note: candidate 2: operator[](T*, int) <built-in>
hb-ot-layout-common.hh:1354: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
hb-iter.hh:63: note: candidate 1: Item& hb_iter_t<Iter, Item>::operator[](unsigned int) const [with Iter = hb_array_t<const OT::IntType<short unsigned int, 2u> >, Item = const OT::IntType<short unsigned int, 2u>]
hb-ot-layout-common.hh:1354: note: candidate 2: operator[](T*, int) <built-in>
hb-ot-layout-common.hh: In member function 'bool OT::ClassDef::serialize(hb_serialize_context_t*, hb_array_t<const OT::IntType<short unsigned int, 2u> >, hb_array_t<const OT::IntType<short unsigned int, 2u> >)':
hb-ot-layout-common.hh:1490: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
hb-iter.hh:63: note: candidate 1: Item& hb_iter_t<Iter, Item>::operator[](unsigned int) const [with Iter = hb_array_t<const OT::IntType<short unsigned int, 2u> >, Item = const OT::IntType<short unsigned int, 2u>]
hb-ot-layout-common.hh:1490: note: candidate 2: operator[](T*, int) <built-in>
2018-12-21 19:48:21 -05:00
Behdad Esfahbod 25786f49c1 [array] Port to hb_iter_t<>
hb_array_t is its own iterator...
2018-12-21 19:29:00 -05:00
Behdad Esfahbod 2a33ab0560 [iter] Change __more__ to fallback to __len__ 2018-12-21 18:53:01 -05:00
Behdad Esfahbod 474a12058d [array/vector] Rename len to length 2018-12-21 18:53:01 -05:00
Behdad Esfahbod 2fc1860a5b [iter] Split hb_iter_t<> into hb_iter_t<> and hb_iter_mixin_t<> 2018-12-21 18:09:45 -05:00
Behdad Esfahbod 865deeb3be Adjust internal header dependencies 2018-12-21 17:46:10 -05:00
Behdad Esfahbod 8e5c2bc60b [Makefile.am] Minor 2018-12-21 17:29:11 -05:00
Behdad Esfahbod f419cef417 [iter] Include from hb.hh 2018-12-21 17:22:09 -05:00
Behdad Esfahbod 7557e34872 [iter] Move hb_fill() and hb_copy() to hb-iter.hh 2018-12-21 17:21:19 -05:00
Behdad Esfahbod 5e1840e031 [iter] Disallow copy-construction or assignment of hb_iter_t<>
Should only be done by subclass.
2018-12-21 16:39:57 -05:00
Behdad Esfahbod 65e8bd56ad [iter] Fix hb_copy() return value 2018-12-21 16:20:30 -05:00
Behdad Esfahbod 40d71211a8 [iter] Add const_iter_t / const_iter() 2018-12-21 16:19:44 -05:00
Behdad Esfahbod aaddfaa57a [iter] Make hb_fill() take collection type, not iter
Starting to get the hang of when take which.
2018-12-21 16:04:38 -05:00
Behdad Esfahbod 7b4eea853c [array] Add more hb_array() / hb_sorted_array() variants 2018-12-21 16:02:16 -05:00
Behdad Esfahbod 09740148e3 [serialize] Use component_list by reference, as a supplier 2018-12-21 15:56:01 -05:00
Behdad Esfahbod 3dbe1e364c [iter] Add .random_access() 2018-12-21 15:53:09 -05:00
Behdad Esfahbod 20f14b4aa6 [iter] Fix __end__() 2018-12-21 15:19:22 -05:00
Behdad Esfahbod 95265aeab7 [array] Remove copy constructor
Fixes https://github.com/harfbuzz/harfbuzz/issues/1502
2018-12-21 15:12:55 -05:00
Behdad Esfahbod 69d232eaea Fix bot
C:\projects\harfbuzz\src\hb-uniscribe.cc(709): error C2666: 'hb_vector_t<OPENTYPE_FEATURE_RECORD,8>::operator +': 3 overloads have similar conversions [C:\projects\harfbuzz\build\harfbuzz.vcxproj]
2018-12-21 15:08:06 -05:00
Behdad Esfahbod b9a51f5310 Minor 2018-12-21 15:05:00 -05:00
Behdad Esfahbod bdb6da7226 [iter] Fix test again 2018-12-21 11:20:27 -05:00
Behdad Esfahbod e952075248 Minor 2018-12-21 11:15:16 -05:00
Behdad Esfahbod 35503d7d73 [iter] More prototyping 2018-12-21 03:03:46 -05:00
Behdad Esfahbod 73c7a896d1 [iter] Make hb_fill() and hb_copy() take iterators
I'm still going back and force...
2018-12-21 02:48:28 -05:00
Behdad Esfahbod 12e506fda4 [iter] Add hb_fill() 2018-12-21 02:47:04 -05:00
Behdad Esfahbod ad3ed58de5 [iter] Start prototyping hb_copy() 2018-12-21 02:25:58 -05:00
Behdad Esfahbod 44af738d19 [iter] Showcase implicit casts 2018-12-21 01:59:37 -05:00
Behdad Esfahbod 879faa2aee Rename 2018-12-21 01:57:40 -05:00
Behdad Esfahbod aeb696a91c [iter] Rename 2018-12-21 01:57:02 -05:00
Behdad Esfahbod 8001e00a47 [iter] First sample use 2018-12-21 01:53:27 -05:00
Behdad Esfahbod 19d2b5013d [iter] Add bidirectionality 2018-12-21 01:20:04 -05:00
Behdad Esfahbod 314d8698d0 [iter] Sketch new iterator design 2018-12-21 01:15:49 -05:00
Behdad Esfahbod f6d5f1e91c [iter] Add empty test 2018-12-21 00:23:46 -05:00
Behdad Esfahbod b80b97b549 Revert "Remove unused hb-iter.hh"
This reverts commit 969ff3c7aa.
2018-12-21 00:08:05 -05:00
Behdad Esfahbod a728c63a98 [vector] Add operator bool 2018-12-20 23:15:49 -05:00
Behdad Esfahbod bd36977392 Rename 2018-12-20 23:14:24 -05:00
Behdad Esfahbod e6ebc9b6f8 Remove unused typedef 2018-12-20 23:13:36 -05:00
Behdad Esfahbod 4941e95f10 2.3.0 2018-12-20 21:48:57 -05:00
Behdad Esfahbod 87f7c83fff [serializer] Add operator <<
Not sure if we are going to use it.  But might incentivize us to.
2018-12-20 15:54:17 -05:00
Behdad Esfahbod 5b70074edf Add hb_assign(obj, value) 2018-12-20 15:38:59 -05:00
Behdad Esfahbod 6124123393 [serialize] Adjust ClassDef
[skip ci]
2018-12-20 12:26:44 -05:00
Behdad Esfahbod 4220b7bdd7 Fix code on big-endian gcc / clang
Ouch!  We need a bigendian bot...

Fixes https://github.com/harfbuzz/harfbuzz/issues/1498
2018-12-20 11:48:45 -05:00
Behdad Esfahbod c87ee72232 Minor [skip ci] 2018-12-19 22:28:16 -05:00
Behdad Esfahbod 5000a59a63 [saitnize] Minor 2018-12-19 22:27:09 -05:00
fanc999 3ee4ea9456 Fix build on older Visual Studio versions (#1499)
* src/hb-cff-interp-dict-common.hh: Use ull for unsigned int64_t

The llu suffix does not work for older Visual Studio versions
(pre-2013), but ull works for all the compilers that we attempt to
support.

* test/api: Fix build on pre-C99 compilers

Ensure variables are declared at the top of the block.

* src/hb-dsalgs.hh: Add specialization for hb_is_signed<> for __int8

Pre-Visual Studio 2010 does not consider __int8 (which is typedef'ed to
int8_t) to be equivilant to signed char, so the compiler cannot find the
corresponding hb_is_signed<> specialization that is needed.

The interesting thing is unsigned __int8 is considered to be equivilant
to unsigned char, so as the other types (short, int, long) that we look
for here, so only the specialization for __int8 is added here.

This will fix builds on Visual Studio 2008 at least.
2018-12-19 22:26:54 -05:00
Behdad Esfahbod a62870506d [sanitize] Use hb_static_size instead of ::static_size
https://github.com/harfbuzz/harfbuzz/issues/1496#issuecomment-448818112
2018-12-19 21:05:00 -05:00
Ebrahim Byagowi 0c9cd5d5f4
[test] Fix test-name-table.cc leak issue
Spotted it accidentally but wanted to see if is anything serious so went for fixing it
2018-12-19 21:18:30 +03:30
Behdad Esfahbod 3d9d7dc4dd [arrays] Add hb_ubytes_t for unsigned char 2018-12-18 22:11:23 -05:00
Behdad Esfahbod f1e95e40ed [arrays] Remove hb_supplier_t<> 2018-12-18 16:49:08 -05:00
Behdad Esfahbod f9417af29b [serialize] Propagate error from hb-face 2018-12-18 13:23:32 -05:00
Behdad Esfahbod 9aebfb4182 [serialize] Streamline error propagation 2018-12-18 13:22:17 -05:00
Behdad Esfahbod 969ff3c7aa Remove unused hb-iter.hh
The ideas there are all part of hb-array.hh now.  To be determined how we
want to use generic iterator patterns.
2018-12-17 22:43:00 -05:00
Behdad Esfahbod b1094fc2d2 [arrays] Minor tweaks to hb_supplier_t
I think I like to keep this hb_supplier_t thing separately from hb_array_t.
2018-12-17 22:41:04 -05:00
Behdad Esfahbod cf39c24205 [arrays] Rename Supplier to hb_supplier_t 2018-12-17 22:36:23 -05:00
Behdad Esfahbod 6b5eaa7530 Hide hb_addressof() 2018-12-17 21:55:33 -05:00
Behdad Esfahbod 6befa75cdf Enable __builtin_* on clang
We'll see which old clang versions this breaks...
2018-12-17 20:35:45 -05:00
Behdad Esfahbod 8d2d410256 Add hb_addressof() and use it to fix bug after hb_bytes_t merge
We cannot take address hb_bytes_t direction.  We need to use the
newly added hb_addressof(), ala std::addressof().
2018-12-17 20:23:26 -05:00
Behdad Esfahbod 49334f9b50 Enable system extensions in hb.hh
Fixes https://github.com/harfbuzz/harfbuzz/issues/1491
2018-12-17 18:27:36 -05:00
prrace 37c14bc745 Fix Solaris use after free (#1495) 2018-12-17 17:59:37 -05:00
Behdad Esfahbod 483f2491e4 Remove define GNU_SOURCE
Not needed.  We get it in our config.h automatically thanks to
AC_USE_SYSTEM_EXTENSIONS.  Let's see whose build it breaks...
If we end up putting it back, we should add other things from
that macro and remove the macro.
2018-12-17 17:56:10 -05:00
Behdad Esfahbod 87ff65aea1 Fix more warnings 2018-12-17 17:19:54 -05:00
prrace f9d219a174 Fix Solaris Trailing comma in enum warnings (#1490) 2018-12-17 17:18:47 -05:00
Ebrahim Byagowi 244a8627f7 Lower coretext_aat shaper priority (#1488)
Related to https://github.com/harfbuzz/harfbuzz/issues/1478
2018-12-17 13:01:43 -05:00
Ebrahim Byagowi e412008599 Remove redundant void from C++ sources (#1486) 2018-12-17 13:01:01 -05:00
Ebrahim Byagowi 7ace10078c
Minor, fix two more ArrayOf incorrect operator logic 2018-12-17 20:07:04 +03:30
Behdad Esfahbod a1240383aa [arrays] Minor fix 2018-12-17 10:44:14 -05:00
Behdad Esfahbod 381c3548e9 [array] Add cast operator to add const to Type
In lieu of constructor removed in previous commit.
2018-12-17 00:39:30 -05:00
Behdad Esfahbod 15acf33c22 [array] Remove problematic constructor 2018-12-17 00:38:13 -05:00
Behdad Esfahbod 470369a871 [array] Add arithmetic operators 2018-12-17 00:21:38 -05:00
Behdad Esfahbod 6cd60c2f2a [array] Return Crap instead of Null if Type is not const
Ouch!
2018-12-17 00:09:06 -05:00
Behdad Esfahbod 94e72cf1c9 [array] Add operator * 2018-12-17 00:06:40 -05:00
Behdad Esfahbod 68d4a5eee0 [array] Add constructor from fixed-size array 2018-12-17 00:02:42 -05:00
Behdad Esfahbod a4354d2fd3 [array] Organize 2018-12-16 23:57:27 -05:00
Behdad Esfahbod 84c1865821 [arrays] Reduce Supplier<> even further 2018-12-16 23:52:17 -05:00
Behdad Esfahbod 1bcc4fc9f3 Whitespace 2018-12-16 23:47:56 -05:00
Behdad Esfahbod f85f6e815f [array] Add operator += 2018-12-16 23:45:07 -05:00
Behdad Esfahbod 7c0e3e9b2b [array] Add constructor from hb_array_t<const Type> 2018-12-16 23:43:17 -05:00
Behdad Esfahbod 92680361ec [arrays] Move Supplier<> to hb-array.hh 2018-12-16 23:38:51 -05:00
Behdad Esfahbod 2a3fa3f82f [arrays] Remove unnecessary constructor from Supplier<>
Looks like operator hb_array_t<> from vector works here. :)
2018-12-16 23:33:03 -05:00
Behdad Esfahbod 507cac4943 [arrays] Start moving Supplier<> to hb_array_t<> 2018-12-16 23:31:19 -05:00
Behdad Esfahbod 1e2c98126e [arrays] Remove unused stride from Supplier 2018-12-16 22:31:16 -05:00
Behdad Esfahbod 0d0fe9df46 [arrays] Remove need of stride in Supplier<> 2018-12-16 22:31:13 -05:00
Behdad Esfahbod dcfa4a8d71 [array] Remove custom hb_bytes_t implementation 2018-12-16 22:31:13 -05:00
Behdad Esfahbod 3656f56d47 [arrays] Minor 2018-12-16 22:31:13 -05:00
Behdad Esfahbod aa8f94714e [array] Minor 2018-12-16 22:31:13 -05:00
Behdad Esfahbod 5a552f7546 [array] Move hb_array_t and related types to hb-array.hh 2018-12-16 22:31:10 -05:00
Behdad Esfahbod 01d06e34ff Minor change to explicit_operator aesthetics 2018-12-16 14:27:43 -05:00
Ebrahim Byagowi b2ebaa9afa Remove redundant 'inline' from methods (#1483) 2018-12-16 14:08:10 -05:00
Behdad Esfahbod 7251c77290 Whitespace 2018-12-15 21:00:55 -05:00
Behdad Esfahbod 829b56b1a2 Whitespace 2018-12-15 16:20:13 -05:00
Behdad Esfahbod 42a1012562 [subset] Actually subset GDEF 2018-12-13 19:39:59 -05:00
Behdad Esfahbod c9c746c7f6 [subset] Fix up ClassDef some more 2018-12-13 18:39:30 -05:00
Behdad Esfahbod 7ee6128902 [subset] Fix ClassDefFormat1 subsetting 2018-12-13 18:32:04 -05:00
Behdad Esfahbod 1b6d0c44b3 [subset] Sketch GDEF subsetting 2018-12-13 18:10:48 -05:00
Behdad Esfahbod 705e2f5056 [subset] Implement for ClassDef 2018-12-13 17:48:42 -05:00
Behdad Esfahbod 6e33a3955d Minor 2018-12-13 16:40:01 -05:00
Behdad Esfahbod cc65901ca7 [serialize] Implement for ClassDef 2018-12-13 16:01:45 -05:00
Behdad Esfahbod e5309e4fd8 [serialize] Implement for ClassDefFormat2 2018-12-13 15:57:12 -05:00
Behdad Esfahbod c8b43cbe31 [serialize] Implement for ClassDefFormat1 2018-12-13 15:53:00 -05:00
Behdad Esfahbod 5761031329 [subset] Minor 2018-12-12 21:21:26 -05:00
Michiharu Ariza 798e98c47b [CFF] bad offset in Index (#1476)
* Update hb-ot-cff-common.hh

* fix bug

* bummer fix wasn't hit. refix

* additional sanity check

* Added test cases for oss-fuzz issues 11805, 11806
2018-12-12 21:08:15 -05:00
Michiharu Ariza bcb4ecaf68 [CFF] check out of range FD index (#1477)
* add fd index checks to subr subsetter

also added oss-fuzz test case

* undid SubrSubsetParam::is_valid

because already validated by SubrClosures.valid
2018-12-12 20:36:01 -05:00
Behdad Esfahbod 2cc993e035 [dispatch] Minor 2018-12-12 10:07:38 -05:00
Behdad Esfahbod 602fbfe3c9 [sanitize] Fix sanitizing sublookup array 2018-12-12 09:56:47 -05:00
Behdad Esfahbod c78e4784fb [dispatch] Minor 2018-12-12 09:50:18 -05:00
Behdad Esfahbod f9d211af1d Revert "Minor fix re sanitize of Lookup subtables"
This reverts commit 7146718bef.

Fixing differently.
2018-12-12 09:44:30 -05:00
Ebrahim Byagowi 7ee5c52345
minor style fix, use void in methods on no argument 2018-12-12 15:14:37 +03:30
Behdad Esfahbod 7146718bef Minor fix re sanitize of Lookup subtables
We were dereferencing Null pointers and trying to sanitize them,
which is not necessary...
2018-12-11 23:44:29 -05:00
Behdad Esfahbod ce069d1932 Minor 2018-12-11 23:07:48 -05:00
Behdad Esfahbod 1aea869446 [subset] Map glyphs during SingleSubst subsetting
Ha!
2018-12-11 22:53:58 -05:00
Behdad Esfahbod 41d1a1c10f [subset] Minor 2018-12-11 22:48:27 -05:00
Behdad Esfahbod 2aba2c6c73 [serialize] Break down assert 2018-12-11 21:21:13 -05:00
Michiharu Ariza 2941208f1e [CFF] oss-fuzz issue 11690 ASSERT: substr.offset >= opStart (#1461)
* fix oss-fuzz 11690: substr.offset >= opStart

detect recursive subroutine call & handle as error

* fix build failure

* add minimized test case for oss-fuzz 11690

* removed asserts
2018-12-11 15:21:24 -05:00
Michiharu Ariza 333586245c minimize use of assert: removed or changed to error handling (#1467) 2018-12-11 15:20:20 -05:00
👻 9f3a51ddb9 [ucdn] Fix header
Fixes https://github.com/harfbuzz/harfbuzz/issues/1470
2018-12-11 13:38:05 -05:00
Ebrahim Byagowi 1683bb2c93
[glyf] minor 2018-12-08 13:57:39 +03:30
Ebrahim Byagowi f7cfe99815
[os2] Move typometrics detection logic to the table (#1465) 2018-12-08 13:40:44 +03:30
Ebrahim Byagowi 47cf9a9633
Apply non-controversial parts of ot-style (#1464)
Things to be used in https://github.com/harfbuzz/harfbuzz/pull/1459
2018-12-08 10:20:25 +03:30
Michiharu Ariza 4d809696ef fix for issue #1447 (#1462)
Added case for OpCode_BaseFontName. This opcode in spec but practically unused.
Added a comment for default case which can't be hit
2018-12-07 20:49:39 -08:00
Ebrahim Byagowi 1abd4fcaec
[fdsc] minor 2018-12-07 22:34:12 +03:30
Michiharu Ariza 59345cdef3 [CFF] Refix oss-fuzz 11714: set_blends (PR #1458) (#1460)
* pass subarray of stack to set_blends

* get_subarray to return a value, not ref

* restored error check (with tweak)
2018-12-06 13:36:26 -08:00
Behdad Esfahbod 20245f0000 Fix likely check
Ouch!
2018-12-06 10:27:37 -08:00
Behdad Esfahbod d866e905fd Add default value to first argument of sub_array() 2018-12-06 10:26:32 -08:00
Behdad Esfahbod f1352f7486 Add sub_array to hb_vector_t 2018-12-06 10:21:17 -08:00
Behdad Esfahbod ca23b71935 Add default-value for second arg of sub_array() 2018-12-06 10:21:17 -08:00
Michiharu Ariza 1ccbdcf73b Merge branch 'master' into cff-check-blends 2018-12-05 21:37:38 -08:00
Michiharu Ariza 14d29a1043 check number of blends against args on stack 2018-12-05 21:33:29 -08:00
Ebrahim Byagowi f95324a335
Merge pull request #1457 from harfbuzz/cff-varstore-sanitize
[CFF] oss-fuzz issue 11713 (CFF2VariationStore::serialize)
2018-12-06 08:33:44 +03:30
Michiharu Ariza c31092ab34 sanitize variationStore in CFF2 against its size 2018-12-05 17:04:55 -08:00
Michiharu Ariza 34e3ef8ff3 Merge branch 'master' into cff-subr-sanitize 2018-12-05 15:50:05 -08:00
Behdad Esfahbod d9dabc00e9
Merge pull request #1454 from harfbuzz/cff-fixbcd
[CFF] fix oss-fuzz issue 11674: parse_bcd
2018-12-05 15:39:34 -08:00
Michiharu Ariza 6dcfda92c1 sanitize CFF1 & CFF2 global subrs 2018-12-05 15:07:46 -08:00
Michiharu Ariza 6708c5595f fix oss-fuzz issue 11675 (ASSERT: count <= str.len)
Also added an additional error check to avail ()
2018-12-05 12:51:18 -08:00
Michiharu Ariza 2cb9d4c183 Merge branch 'master' into cff-fixbcd 2018-12-05 11:25:29 -08:00
Michiharu Ariza a5fa843c74 fixed a bug with fractional part in a negative value 2018-12-05 11:18:16 -08:00
Ebrahim Byagowi 8394a6cb25
[os2] Make newer table fields accessible (#1452) 2018-12-05 15:23:41 +03:30
Ebrahim Byagowi 5ab086ebb1 [fdsc] Implement the table parsing
Related to https://github.com/harfbuzz/harfbuzz/issues/1337

May used in addition to an API related to STAT.

Lots of Apple fonts have it.
2018-12-05 14:48:31 +03:30
Ebrahim Byagowi 8f80e53341 [gasp] Implement the table parsing
May or may not be used in https://github.com/harfbuzz/harfbuzz/pull/1432
2018-12-05 14:48:31 +03:30
Ebrahim Byagowi 79e7e3445e
Merge pull request #1449 from harfbuzz/cff-fixcharset
[CFF] fix for oss-fuzz 11657: Charset overrun
2018-12-05 13:25:18 +03:30
Ebrahim Byagowi cf4b7db6b1
Merge pull request #1448 from harfbuzz/cff-leak
[CFF] fix leak: oss-fuzz 11662
2018-12-05 13:23:23 +03:30
Michiharu Ariza 620d1ef588 fix unsigned long const 2018-12-05 00:36:11 -08:00
Michiharu Ariza 28dfb4c142 fix signed/unsigned comparison 2018-12-05 00:26:03 -08:00
Michiharu Ariza f9cee08edd use sized int types in parse_bcd 2018-12-04 23:58:26 -08:00
Michiharu Ariza c01a5f32a3 refix 2018-12-04 23:23:23 -08:00
Michiharu Ariza 755fefc921 fix bug 2018-12-04 23:18:28 -08:00
Michiharu Ariza 0e81b153af fix typo 2018-12-04 22:40:07 -08:00
Michiharu Ariza 85d4b15cd8 include float.h 2018-12-04 22:30:33 -08:00
Michiharu Ariza 5a7c371e4c check overflow & clamp 2018-12-04 22:24:38 -08:00
Michiharu Ariza 32cc46c75a [CFF] fix oss-fuzz issue 11670: NULL dereference (#1450)
* guard against no subr access

* code tweak

* add minimized testcase for oss-fuzz 11670 (Null deference)
2018-12-05 09:02:34 +03:30
Michiharu Ariza d3d2f32c6e fix oss-fuzz 11657: buffer overrun
Check overrun in Charset1_2::get_glyph
2018-12-04 13:51:26 -08:00
Ebrahim Byagowi d0a250a7b1
Reuse hb_aat_layout_has_* logic in coretext-aat detection logic (#1442) 2018-12-04 23:42:13 +03:30
Michiharu Ariza 803d2f92dc Merge branch 'master' into cff-leak 2018-12-04 11:01:26 -08:00
Michiharu Ariza 6ce8d10b45 add unlikely to error handling 2018-12-04 10:39:17 -08:00
Michiharu Ariza 0b952e6026 more leak fixes 2018-12-04 10:22:35 -08:00
Michiharu Ariza 9473463f5c fix attempt for oss-fuzz 11662 leak 2018-12-04 09:58:48 -08:00
Michiharu Ariza 04f2ca9421 removed assert 2018-12-04 09:24:07 -08:00
Behdad Esfahbod c968869f21
Merge pull request #1441 from harfbuzz/cff-doublenum
use double as CFF Number implementation
2018-12-04 04:14:13 -05:00
Michiharu Ariza c48f53d309 more double changes 2018-12-03 16:59:41 -08:00
Michiharu Ariza 5fff6ab002 additional precision made a difference in extents test 2018-12-03 16:06:58 -08:00
Michiharu Ariza 9e5180cd44 more double changes 2018-12-03 15:32:42 -08:00
Michiharu Ariza 9af33d7a2a Number to use double for all types 2018-12-03 14:48:46 -08:00
Ebrahim Byagowi 01f628cf55 [aat] Expose hb_aat_layout_has_tracking API 2018-12-03 22:27:26 +03:30
Behdad Esfahbod d19b1680b5 [aat] Expose a couple APIs
New API:
+hb_aat_layout_has_substitution()
+hb_aat_layout_has_positioning()
2018-12-03 10:41:37 -05:00
Behdad Esfahbod 84efe0438e [aat] Fix division sign fallout
Happened after 11d2f49af8
since now nClasses is unsigned int...
2018-12-02 12:39:14 -05:00
Behdad Esfahbod 2087f5a2a7 Add casts to hb_array_t<> 2018-12-01 20:04:45 -05:00
Behdad Esfahbod 58d4d19947 Simplify build source list 2018-12-01 19:34:18 -05:00
Behdad Esfahbod 11d2f49af8 New approach to change BigEndian casts to be int-sized
Fixes spurious warnings like:
Fixes https://github.com/harfbuzz/harfbuzz/issues/1436
2018-12-01 13:12:21 -05:00
Behdad Esfahbod 50e0273ab1 Change hb_assert_unsigned_t<> to hb_is_signed<> 2018-12-01 13:07:49 -05:00
Behdad Esfahbod c3a8b047aa Revert "Change BigEndian casts to be int-sized"
This reverts commit eb5ddd32bf.

Broke tests, badly.  To be investigated and reenabled.
2018-12-01 00:26:39 -05:00
Behdad Esfahbod be45677ab6 Minor 2018-12-01 00:04:29 -05:00
Behdad Esfahbod eb5ddd32bf Change BigEndian casts to be int-sized
Fixes spurious warnings like:
Fixes https://github.com/harfbuzz/harfbuzz/issues/1436
2018-12-01 00:03:01 -05:00
Behdad Esfahbod e8860fdcaa Fix more warning 2018-11-30 23:38:24 -05:00
Behdad Esfahbod af349ee348 Fix warning 2018-11-30 23:20:50 -05:00
Behdad Esfahbod 825df6dbc7 [CFF] Change spaces to tabs 2018-11-30 23:04:59 -05:00
Behdad Esfahbod 592f39b3c4 [CFF] Whitespace 2018-11-30 22:54:57 -05:00
Behdad Esfahbod a2e8d1d455 Minor 2018-11-30 22:54:20 -05:00
Behdad Esfahbod 5e64e0f532
Merge pull request #1113 from harfbuzz/cff-subset
CFF/CFF2 subsetter
2018-11-30 22:40:54 -05:00
Bruce Mitchener 09096aa89f Use nullptr instead of 0/NULL. (#1435)
* Use nullptr instead of 0/NULL.

* Update test-name-table.cc
2018-11-30 22:22:49 -05:00
Michiharu Ariza d8c6913765 undo 0u 2018-11-30 18:58:14 -08:00
Michiharu Ariza 2c859b3880 Merge branch 'master' into cff-subset 2018-11-30 18:47:34 -08:00
Behdad Esfahbod fb05908213 Revert ugly fixes
Now that we have 6daf45e0, revert cryptic hacks...

This reverts commit abd81ed4f5.
This reverts commit 9c6921c08c.
This reverts commit d39760cabf.
This reverts commit fedd8e6c17.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1374
2018-11-30 20:56:15 -05:00
Behdad Esfahbod dfad19ad5a Make operator [] take signed int
The built-in operator takes signed int.  So, match it, such that
the built-in is never a better or equally-good match to our operator.
Fixes "ambiguous overload" errors from gcc 4.2 and VS 2008.

See https://github.com/harfbuzz/harfbuzz/issues/1374
2018-11-30 20:56:14 -05:00
Michiharu Ariza 9483da145d redo fixes 2018-11-30 16:59:41 -08:00
Michiharu Ariza 291da44823 yet another 2018-11-30 16:50:46 -08:00
Michiharu Ariza b1821b9d09 some more 2018-11-30 16:31:01 -08:00
Michiharu Ariza 9784cff556 fix another pesky gcc error 2018-11-30 16:07:08 -08:00
Michiharu Ariza 23a797b443 silence picky gcc errors 2018-11-30 15:15:31 -08:00
Michiharu Ariza 9ae954f43a Merge branch 'master' into cff-subset 2018-11-30 15:00:52 -08:00
Behdad Esfahbod fedd8e6c17 One more.........
I wonder if there's something better to do about these :(.

In file included from hb-ot-color.cc:31:
hb-ot-color-cpal-table.hh: In member function 'unsigned int OT::CPAL::get_size() const':
hb-ot-color-cpal-table.hh:118: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
2018-11-30 16:50:30 -05:00
Behdad Esfahbod bc5db9b080 One more....
hb-ot-vorg-table.hh:96: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
hb-vector.hh:87: note: candidate 1: const Type& hb_vector_t<Type, PreallocedCount>::operator[](unsigned int) const [with Type = OT::VertOriginMetric, unsigned int PreallocedCount = 8u]
hb-ot-vorg-table.hh:96: note: candidate 2: operator[](const T*, int) <built-in>
2018-11-30 16:04:52 -05:00
Behdad Esfahbod d39760cabf One more...
Sigh.

hb-ot-kern-table.hh: In member function 'int OT::KernSubTableFormat3<KernSubTableHeader>::get_kerning(hb_codepoint_t, hb_codepoint_t) const':
hb-ot-kern-table.hh:59: error: ambiguous overload for 'operator[]' in 'kernValue[kernIndex[i]]'
hb-ot-kern-table.hh:59: note: candidates are: operator[](T*, int) <built-in>
hb-dsalgs.hh:574: note:                 Type& hb_array_t<Type>::operator[](unsigned int) const [with Type = const OT::IntType<short int, 2u>]
2018-11-30 15:55:30 -05:00
Behdad Esfahbod 9c6921c08c More...
hb-ot-layout-gsubgpos.hh:1707: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
...
2018-11-30 15:16:57 -05:00
Behdad Esfahbod f998bb2086 More weird fixes
In file included from hb-ot-name.cc:29:
hb-ot-name-table.hh: In member function 'unsigned int OT::name::get_size() const':
hb-ot-name-table.hh:157: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
hb-open-type.hh:354: note: candidate 1: const Type& OT::UnsizedArrayOf<Type>::operator[](unsigned int) const [with Type = OT::NameRecord]
hb-ot-name-table.hh:157: note: candidate 2: operator[](const T*, int) <built-in>
hb-ot-name-table.hh: In member function 'void OT::name::accelerator_t::init(hb_face_t*)':
hb-ot-name-table.hh:196: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
hb-dsalgs.hh:574: note: candidate 1: Type& hb_array_t<Type>::operator[](unsigned int) const [with Type = const OT::NameRecord]
hb-ot-name-table.hh:196: note: candidate 2: operator[](T*, int) <built-in>
hb-ot-name-table.hh:197: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
hb-dsalgs.hh:574: note: candidate 1: Type& hb_array_t<Type>::operator[](unsigned int) const [with Type = const OT::NameRecord]
hb-ot-name-table.hh:197: note: candidate 2: operator[](T*, int) <built-in>
hb-ot-name-table.hh:198: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
hb-dsalgs.hh:574: note: candidate 1: Type& hb_array_t<Type>::operator[](unsigned int) const [with Type = const OT::NameRecord]
hb-ot-name-table.hh:198: note: candidate 2: operator[](T*, int) <built-in>
make[4]: *** [libharfbuzz_la-hb-ot-name.lo] Error 1
make[3]: *** [all-recursive] Error 1
2018-11-30 12:52:21 -05:00
Behdad Esfahbod abd81ed4f5 Umm. Cryptic, yes
In file included from hb-face.cc:35:
hb-ot-cmap-table.hh: In member function 'void OT::CmapSubtableFormat4::_compiles_assertion_on_line_388() const':
hb-ot-cmap-table.hh:388: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
hb-open-type.hh:354: note: candidate 1: const Type& OT::UnsizedArrayOf<Type>::operator[](unsigned int) const [with Type = OT::IntType<short unsigned int, 2u>]
hb-ot-cmap-table.hh:388: note: candidate 2: operator[](const T*, int) <built-in>
hb-ot-cmap-table.hh: In member function 'void OT::CmapSubtableFormat4::_instance_assertion_on_line_388() const':
hb-ot-cmap-table.hh:388: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
hb-open-type.hh:354: note: candidate 1: const Type& OT::UnsizedArrayOf<Type>::operator[](unsigned int) const [with Type = OT::IntType<short unsigned int, 2u>]
hb-ot-cmap-table.hh:388: note: candidate 2: operator[](const T*, int) <built-in>
hb-face.cc: In function 'hb_blob_t* _hb_face_builder_data_reference_blob(hb_face_builder_data_t*)':
hb-face.cc:650: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
hb-vector.hh:81: note: candidate 1: Type& hb_vector_t<Type, PreallocedCount>::operator[](unsigned int) [with Type = hb_face_builder_data_t::table_entry_t, unsigned int PreallocedCount = 32u]
hb-face.cc:650: note: candidate 2: operator[](T*, int) <built-in>
hb-face.cc:650: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
hb-vector.hh:81: note: candidate 1: Type& hb_vector_t<Type, PreallocedCount>::operator[](unsigned int) [with Type = hb_face_builder_data_t::table_entry_t, unsigned int PreallocedCount = 32u]
hb-face.cc:650: note: candidate 2: operator[](const T*, int) <built-in>
hb-face.cc:651: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
hb-vector.hh:81: note: candidate 1: Type& hb_vector_t<Type, PreallocedCount>::operator[](unsigned int) [with Type = hb_face_builder_data_t::table_entry_t, unsigned int PreallocedCount = 32u]
hb-face.cc:651: note: candidate 2: operator[](T*, int) <built-in>
hb-face.cc:651: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
hb-vector.hh:81: note: candidate 1: Type& hb_vector_t<Type, PreallocedCount>::operator[](unsigned int) [with Type = hb_face_builder_data_t::table_entry_t, unsigned int PreallocedCount = 32u]
hb-face.cc:651: note: candidate 2: operator[](const T*, int) <built-in>
2018-11-30 11:52:41 -05:00
Behdad Esfahbod 0f32c95e14 Fix a few more sizeof(vector[0]) errors with weird compilers 2018-11-30 11:31:39 -05:00
Behdad Esfahbod 88630a458b Fix build for realz 2018-11-30 01:11:04 -05:00
Behdad Esfahbod 346286d04e Fix build 2018-11-30 00:44:40 -05:00
Behdad Esfahbod 31f39cb41e [post] Rename v2 to v2X 2018-11-30 00:38:08 -05:00
Behdad Esfahbod e3dd47e602 Move things 2018-11-30 00:32:12 -05:00
Behdad Esfahbod 27a6b0a2f7 Fix build for realz 2018-11-29 16:29:30 -05:00
Behdad Esfahbod e2af4dd1ec [uniscribe] Fix build 2018-11-29 16:03:24 -05:00
Ebrahim Byagowi e7bd29ea11
Limit __builtin_bswap16 to GCC >= 5 as it was implemented on 4.8 2018-11-29 23:47:20 +03:30
Behdad Esfahbod ac0264717b [coretext] Fix compile
Fingers crossed.
2018-11-29 15:07:44 -05:00
Behdad Esfahbod 5c4fead734 Convert "static const hb_tag_t" constants to enum 2018-11-29 15:05:47 -05:00
Behdad Esfahbod 9e4138c825 Convert misc "static const" constants to enum 2018-11-29 15:01:10 -05:00
Behdad Esfahbod 44cbd2ea3d Convert "static const bool" constants to anonymous enum 2018-11-29 14:56:27 -05:00
Behdad Esfahbod 861bc75349 [vector] Make pointer cast explicit
Too bad this doesn't help MSVC 2008 build, as explicit operators are
C++11.
2018-11-29 14:34:44 -05:00
Behdad Esfahbod 72955e6825 Hand-hold older compilers 2018-11-29 14:28:44 -05:00
Behdad Esfahbod 000d4b128e Make shaper's override_features() override user features as well
The override_features is used to override features that are normally
discretionary features, but in a specific shaper are for various
reasons desired to be bolted on or off, because they've been used
for inherent shaping.  As such, it makes sense that they also
override user features.  Ie. if user turned 'liga' on, we don't
want Khmer shaping to become broken...  Or turn 'clig' off...

Fixes https://github.com/harfbuzz/harfbuzz/issues/1310
2018-11-29 12:32:47 -05:00
Behdad Esfahbod a95d9d8c84 [khmer] Move 'clig' to overrides
Prerequisite for https://github.com/harfbuzz/harfbuzz/issues/1310
2018-11-29 12:32:04 -05:00
Behdad Esfahbod 282ce7230b Fix "typename outside template" issues
Nothing an extra template class wouldn't fix...

Fixes https://github.com/harfbuzz/harfbuzz/issues/1419
2018-11-29 12:18:14 -05:00
Behdad Esfahbod dc41ecef85 2.2.0 2018-11-29 11:53:53 -05:00
Behdad Esfahbod 7b85081be4 [icu] Minor 2018-11-29 11:34:22 -05:00
Behdad Esfahbod 0bcb1de126
Merge pull request #1418 from gvictor/replace_icu_deprecated
Replace @Deprecated ICU API - USCRIPT_CODE_LIMIT
2018-11-29 10:39:18 -05:00
Michiharu Ariza 471db3aa6f workaround for issue #1417 2018-11-28 17:06:11 -08:00
Michiharu Ariza 32d291ae89 Merge branch 'master' into cff-subset 2018-11-28 16:27:45 -08:00
Behdad Esfahbod 42a2b496e4 [kerx] Fix Format2 index calc again 2018-11-28 15:24:30 -05:00
Behdad Esfahbod a3267cf803 [kern] Fix kern table Format2 offsetToIndex
Fixes https://github.com/harfbuzz/harfbuzz/issues/1421
2018-11-28 15:06:01 -05:00
Behdad Esfahbod f9a9c0fd1e [kerx] Fix ClassTable implementation for 'kern' table Format 2 2018-11-28 14:51:56 -05:00
Behdad Esfahbod 5b4a789ca8 [aat] Towards adding two ClassTable's 2018-11-28 14:49:45 -05:00
Behdad Esfahbod 987f418772
Merge pull request #1398 from Adenilson/bigInt01
Optimize harfbuzz big integer conversions
2018-11-27 17:40:32 -05:00
Behdad Esfahbod 4e2a03b6b6
Comment 2018-11-27 17:40:09 -05:00
Adenilson Cavalcanti 4a719a7f4c Optimize harfbuzz big integer conversions
Profiling showed that type conversions were adding considerable cycles in time
spent doing text shaping.

The idea is to optimize it using native processor instructions to help Blink
layout performance.

Doing further investigation revelead that compilers may not use the
proper instruction on ARM 32bits builds (i.e. REV16).

One way to insure that the generated ASM was ideal for both gcc/clang
was using __builtin_bswap16.

Added bonus is that we no longer need to test for CPU architecture.
2018-11-27 13:43:05 -08:00
Victor Chang a85886fc77 Replace @Deprecated ICU API - USCRIPT_CODE_LIMIT
Use of the deprecated API USCRIPT_CODE_LIMIT prevents harfbuzz
using the ICU4C as a shared library.

The API has been replaced by u_getIntPropertyMaxValue(UCHAR_SCRIPT)
2018-11-27 11:51:45 +00:00
Behdad Esfahbod 574d888c8a [aat] Ignore GSUB table of Muthu Foundry if they have morx table
Fixes https://github.com/harfbuzz/harfbuzz/issues/1410
2018-11-25 16:51:22 -05:00
Behdad Esfahbod 4151c2848d [GDEF] Move more code 2018-11-25 16:38:36 -05:00
Behdad Esfahbod 4f21703f22 [GDEF] Move code around 2018-11-25 15:59:18 -05:00
Behdad Esfahbod 4ed9fb1a00 [GDEF] Minor 2018-11-25 15:53:20 -05:00
Behdad Esfahbod 926f512f35 [aat.feat] Rework API and implementation
Fixes https://github.com/harfbuzz/harfbuzz/pull/1346
2018-11-25 01:16:02 -05:00
Behdad Esfahbod 84dacbca7e [aat.feat] Add _MAX_VALUE to enums 2018-11-25 01:16:02 -05:00
Behdad Esfahbod 3922aae162 [aat.feat] Minor 2018-11-25 01:16:02 -05:00
Behdad Esfahbod 0f8e98eca2 [aat.feat] Whitespace 2018-11-25 01:16:02 -05:00
Behdad Esfahbod c225606833 [aat.feat] Port to SortedUnsizedArrayOf.bsearch() 2018-11-25 01:16:02 -05:00
Behdad Esfahbod 52ae9867ef [AAT.feat] Use lsearch for looking up SettingName's
They are not sorted.
2018-11-25 01:16:02 -05:00
Behdad Esfahbod 44b9331f66 [aat] Fix include issues 2018-11-25 01:16:02 -05:00
Behdad Esfahbod b206133d1f [aat] Move contents of hb-aat.h to hb-aat-layout.h
Since it was pages and pages...
2018-11-25 01:16:02 -05:00
Behdad Esfahbod 2cb235d021 [aat.feat] Fix enum namespace 2018-11-25 01:16:02 -05:00
Behdad Esfahbod 712762cabb Minor 2018-11-25 01:16:02 -05:00
Behdad Esfahbod e20f81f4fa [aat] Rename feat API a bit more 2018-11-25 01:16:02 -05:00
Ebrahim Byagowi 54f4c17f0a [feat] Rename API uses of setting to selector 2018-11-25 01:16:02 -05:00
Ebrahim Byagowi 9c64b216ec [feat] Apply renamings and add documentation 2018-11-25 01:16:02 -05:00
Ebrahim Byagowi a8726cb483 [feat] Use bsearch 2018-11-25 01:16:02 -05:00
Ebrahim Byagowi 4009a05ca7 [feat] Address Behdad comments 2018-11-25 01:16:02 -05:00
Ebrahim Byagowi 19b6025534 [feat] Address @behdad comments 2018-11-25 01:16:02 -05:00
Ebrahim Byagowi 9212ec203c [feat] Complete feature types list 2018-11-25 01:16:02 -05:00
Ebrahim Byagowi fbad794bd2 [feat] Add feature iteration API 2018-11-25 01:16:02 -05:00
Ebrahim Byagowi 7a0471aa35 [feat] Turn AAT feature id into enum 2018-11-25 01:16:02 -05:00
Ebrahim Byagowi b233fa4bc9 [feat] Rename records to selectors as @drott 2018-11-25 01:16:02 -05:00
Ebrahim Byagowi a157b3e4eb [feat] Apply @behdad comments 2018-11-25 01:16:02 -05:00
Ebrahim Byagowi 3aff3f822f [feat] Apply @drott and @jfkthame comments 2018-11-25 01:16:02 -05:00
Ebrahim Byagowi b791bbbae4 [feat] Apply @jfkthame reviews 2018-11-25 01:16:01 -05:00
Ebrahim Byagowi 95abd53758 [feat] Expose public API
* hb_aat_get_feature_settings
2018-11-25 01:16:01 -05:00
Behdad Esfahbod 9326912941 [kerx] Fix crash 2018-11-25 00:27:23 -05:00
Behdad Esfahbod 6ee401049d Simplify sanitize set_object() / fix bots 2018-11-25 00:21:13 -05:00
Behdad Esfahbod c5a6b355e1 [kerx] Port to hb_sanitize_with_object_t 2018-11-24 23:49:23 -05:00
Behdad Esfahbod c405ed0509 [morx] Port to hb_sanitize_with_object_t 2018-11-24 23:46:15 -05:00
Behdad Esfahbod 1e8994221f Add hb_sanitize_with_object_t
Context manager.
2018-11-24 23:38:06 -05:00
Behdad Esfahbod b3c5affc05 Simplify sanitize set_object() 2018-11-24 23:34:34 -05:00
Behdad Esfahbod 3d30972699 [aat] Skip terminator in VarSizedBinSearchArray<>
Fixes shaping with Apple Chancery on 10.13 again.  In that font,
there was a terminator segment, that was tripping off sanitize().
2018-11-24 23:12:28 -05:00
Behdad Esfahbod 4202a3cde3 Minor 2018-11-24 22:49:50 -05:00
Behdad Esfahbod 1c2302bbf1 [debug] Print function in return_trace() 2018-11-24 22:32:17 -05:00
Behdad Esfahbod 748198a671 Revert "[aat.morx] Remove set_object() business"
This reverts commit ae8ed58a6e.

Apparently this broke Apple Chancery from OS X 10.12 :(.
Investigating...
2018-11-24 22:16:59 -05:00
Behdad Esfahbod c8a2dc820e Revert "[aat.kerx] Remove kerx subtable boundary enforcement"
This reverts commit 15905a2a29.
2018-11-24 22:16:53 -05:00
Behdad Esfahbod 9eeebd8dde Revert "[sanitize] Remove now-unused set_object() machinery"
This reverts commit bbdb6edb3e.
2018-11-24 22:16:47 -05:00
Behdad Esfahbod f47c5da0aa [arrays] Use hb_array_t<> in all places with sub_array() 2018-11-24 21:36:57 -05:00
Behdad Esfahbod 3246a8ebbd [arrays] Merge ArrayOf's sub_array into hb_array_t's 2018-11-24 21:32:00 -05:00
Behdad Esfahbod bbdb6edb3e [sanitize] Remove now-unused set_object() machinery 2018-11-24 17:15:38 -05:00
Behdad Esfahbod 15905a2a29 [aat.kerx] Remove kerx subtable boundary enforcement
Have not encountered fonts needing this, but same reasoning as
for morx (see previos commit.)
2018-11-24 17:14:39 -05:00
Behdad Esfahbod ae8ed58a6e [aat.morx] Remove set_object() business
With OS X 10.13 Apple Chancery fails to ligate if we limit each morx
sub-chain to its declared length.  Perhaps their newer compiler does
object-sharing across sub-chains.  Anyway, since that's a valid, if
unspecified, way to compile tables, remove enforcement.

Probably do the same with kern/kerx.
2018-11-24 17:14:09 -05:00
Behdad Esfahbod 20edc70d53 [morx/kerx] Fix sanitize regression
Broke in 8dcc1913a1

If sanitizer is left with another object, it wouldn't work.

Better fix coming soon.
2018-11-24 14:53:05 -05:00
Behdad Esfahbod ae96c98dfa [color] Use SortedUnsizedArrayOf<> 2018-11-24 10:25:10 -05:00
Behdad Esfahbod 4a3b20738f [trak] Coment 2018-11-24 10:17:59 -05:00
Behdad Esfahbod 918b1ee54d [arrays] Add not_found to reference bsearch as well 2018-11-24 10:09:17 -05:00
Behdad Esfahbod d77a098b73 [arrays] Improve bfind() interface
Much more useful now. :)
2018-11-24 10:06:13 -05:00
Behdad Esfahbod 8dcc1913a1 [kerx/morx] Make sure object length is sanitized before accessing it 2018-11-24 09:48:06 -05:00
Behdad Esfahbod 70d80c90fe [arrays] Port ArrayOf.qsort() and hb_vector_t.qsort() to hb_array_t 2018-11-24 09:48:06 -05:00
Behdad Esfahbod 073d837aa2 [arrays] Port ArrayOf.qsort() to hb_array_t's 2018-11-24 09:48:06 -05:00
Behdad Esfahbod ad5c871d80 [arrays] Add copy-constructor to hb_array_t and hb_sorted_array_t 2018-11-24 09:48:06 -05:00
Behdad Esfahbod 61de55bf49 [arrays] Port hb_vector_t.qsort() to hb_array_t's 2018-11-24 09:48:06 -05:00
Behdad Esfahbod e3face8e79 [arrays] Remove one flavor of hb_vector_t.qsort() 2018-11-24 09:48:06 -05:00
Behdad Esfahbod 7c1600dcd9 [arrays] Add (unused) SortedUnsizedArrayOf<> 2018-11-24 09:48:06 -05:00
Behdad Esfahbod e700392f5c [arrays] Port SortedArrayOf.bsearch/bfind to hb_sorted_array_t's 2018-11-24 09:48:06 -05:00
Behdad Esfahbod e604306f28 [arrays] Port hb_vector_t.bsearch/bfind to (new) hb_sorted_array_t's 2018-11-24 09:48:06 -05:00
Behdad Esfahbod 268eca2492 [arrays] Port (unused) ArrayOf.lsearch() to hb_array_t's 2018-11-24 09:48:06 -05:00
Behdad Esfahbod 830856ba6b [arrays] Port hb_vector_t.lsearch() to hb_array_t's 2018-11-24 09:48:06 -05:00
Behdad Esfahbod 96cf088980 [arrays] More 2018-11-24 09:48:06 -05:00
Behdad Esfahbod 3e26c8d2b1 [arrays] Update ArrayOf.lsearch()
Currently unused apparently
2018-11-24 09:48:06 -05:00
Behdad Esfahbod 22e1857b01 [arrays] Change argument type of cmp called by hb_vector_t.bsearch()
Towards consolidating all array bsearch/...
2018-11-24 09:48:06 -05:00
Behdad Esfahbod 30cb45b3ea Change ArrayOf.bsearch() return semantics
Towards consolidating all array bsearch/...
2018-11-24 00:48:26 -05:00
Behdad Esfahbod 5cd9546ba7 Minor 2018-11-24 00:46:07 -05:00
Behdad Esfahbod fd94e729cb Whitespace 2018-11-24 00:46:07 -05:00
Behdad Esfahbod bb2a206508 Assert that item-type of arrays have static size 2018-11-24 00:31:40 -05:00
Behdad Esfahbod 690d9eb83d [vector] Rename 2018-11-24 00:29:22 -05:00
Behdad Esfahbod ba38378fd4 [aat] Minor 2018-11-24 00:27:57 -05:00
Behdad Esfahbod 39b9d63b01 Add hb_static_size(T) 2018-11-24 00:25:40 -05:00
Behdad Esfahbod f99abcc379 Add template-function convenience macros 2018-11-24 00:24:01 -05:00
Behdad Esfahbod ec83b2228e Add null bytes for CmapSubtableLongGroup 2018-11-23 19:59:31 -05:00
Behdad Esfahbod e2ffb33a53 Remove lsearch for small TableDirectorys 2018-11-23 16:24:28 -05:00
Behdad Esfahbod 04f7e55369 [arrays] Add as_array() to hb_vector_t<> 2018-11-23 16:07:43 -05:00
Behdad Esfahbod c514f65181 [arrays] Add as_array() to ArrayOf<> 2018-11-23 16:04:56 -05:00
Behdad Esfahbod 9552f4ef0d [kern] Don't enforce length of last subtable 2018-11-23 15:24:17 -05:00
David Corbett 018ba46e4d Don't canonicalize '@' to '-' in language tags
Fixes #1406.
2018-11-23 13:21:22 -05:00
Behdad Esfahbod 748962264a [aat] Disable mark advance zeroing if kern table has state-machines
Geeza Pro for example, relies on that for fancy mark positioning.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1405
2018-11-23 11:10:17 -05:00
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
Behdad Esfahbod 0123976a0c [kerx] Adjust CrossStream kern to match 'kern' table 2018-11-06 21:46:14 -05:00
Behdad Esfahbod 80a33b9ac3 [kern] More tweaks
Solves a mystery or two.  I'm fairly confident this is what CoreText does now.
2018-11-06 21:46:14 -05:00
Behdad Esfahbod 564e8ac046 [kern] Adjust some more
Getting closer.  So many open questions still...
2018-11-06 21:46:14 -05:00
Behdad Esfahbod 4d003b8503 [kern] Add TODO 2018-11-06 21:46:14 -05:00
Behdad Esfahbod 9810f0b80e [kern] Minor 2018-11-06 21:46:14 -05:00
Behdad Esfahbod 9c04b60583 [kern] In Format1, adjust how kerning is done
In a series of kerns in one action, kern all but last glyph forward,
and the last one backward.  Seems to better match what CoreText is doing.

Test cases, with GeezaPro Arabic:

$ ./hb-shape GeezaPro_10_10.ttc -u U+0631,U+0628
[u0628.beh=1+1415|u0631.reh=0@-202,0+700]

$ ./hb-shape GeezaPro_10_10.ttc -u U+0628,U+064F
[u064f.damma=0@0,-250+-250|u0628.beh=0@250,0+1665]

In a later change, I'll make kern machine avoid producing negative kerns.
2018-11-06 21:46:14 -05:00
Behdad Esfahbod e8c4772463 [kern] XXX Negate CrossKerning sign
Not sure why, but seems to better match GeezaPro Arabic w CoreText.

Quite possibly I'm doing something very wrong...
2018-11-06 21:46:14 -05:00
Behdad Esfahbod 01bf43ac01 [kern] Implement CrossStream kerning 2018-11-06 17:59:31 -05:00
Behdad Esfahbod b11830c09e [kern] Improve Format 2
Still disabled.
2018-11-06 17:59:31 -05:00
Behdad Esfahbod c0383c6bb7 Minor 2018-11-06 17:59:31 -05:00
Behdad Esfahbod 10e6f708f3 [kern] Minor 2018-11-06 17:16:23 -05:00
Behdad Esfahbod 164eedd918 [kern] Minor 2018-11-06 17:16:23 -05:00
Behdad Esfahbod 220a5991ba [kern/kerx] Fix trace numbering 2018-11-06 17:16:23 -05:00
Michiharu Ariza 7b21319edf don't reject empty Dict 2018-11-06 13:59:07 -08:00
Michiharu Ariza 43ee0e4d00 Merge branch 'master' into cff-subset 2018-11-06 09:57:17 -08:00
Behdad Esfahbod bfafe208da [kern] Switch to dispatch 2018-11-06 12:13:20 -05:00
Behdad Esfahbod 213fa3bf71 [kern] Refactor to include header in each subtable type 2018-11-06 12:13:20 -05:00
Behdad Esfahbod b0da2cd0b9 [kern] Some more 2018-11-06 12:13:20 -05:00
Behdad Esfahbod 75b00b51c8 [kern] Renames 2018-11-06 12:13:20 -05:00
Behdad Esfahbod 37f421c951 Minor 2018-11-06 10:03:38 -05:00
Ebrahim Byagowi 9139cc23ea
Fix link issue of some of the bots
e.g. https://circleci.com/gh/harfbuzz/harfbuzz/52410
2018-11-06 11:17:14 +03:30
Ebrahim Byagowi 98b37f0c10
[mort] Fix table detection logic
mort really needs some initial tests at least.
2018-11-06 09:16:28 +03:30
Behdad Esfahbod fa3ebf845f Simplify some more 2018-11-05 23:34:07 -05:00
Behdad Esfahbod 61f52231f4 [math] Shorten names a bit 2018-11-05 23:28:52 -05:00
Behdad Esfahbod 737efbe655 [ot-layout] Simplify GSUB/GPOS access
This concludes simplifying table access to face->table.XXXX.
2018-11-05 23:26:29 -05:00
Behdad Esfahbod 5e68cec179 [ot-layout] Simplify GDEF access 2018-11-05 23:23:57 -05:00
Behdad Esfahbod 33b006cc51 [ot-layout] Simplify some access 2018-11-05 23:19:04 -05:00
Behdad Esfahbod db35409f0d [ot-layout] Remove ensures 2018-11-05 23:11:46 -05:00
Behdad Esfahbod 9198de7b9b [ot-font] Remove ensure 2018-11-05 23:10:37 -05:00
Behdad Esfahbod ea6d9b661f [ot-face] Remove a few ensures 2018-11-05 23:10:21 -05:00
Behdad Esfahbod 0fe7a745c9 [ot-face] Simplify more table access 2018-11-05 23:10:18 -05:00
Behdad Esfahbod a35c92cbe7 [ot-face] Simplify table access
Yoohoo!
2018-11-05 23:10:16 -05:00
Behdad Esfahbod 914b595f25 [ot-face] Include hb-ot-face directly in hb_face_t
Simplifying access coming next.
2018-11-05 23:10:12 -05:00
Behdad Esfahbod 56ba998cdd [cmap] Push get_nominal_glyphs down into cmap accelerator 2018-11-05 19:49:54 -05:00
Behdad Esfahbod 36d85dce25 [cmap] Use hb_nonnullptr_t 2018-11-05 19:46:29 -05:00
Behdad Esfahbod 8be74d8553 2.1.1 2018-11-05 18:47:22 -05:00
Behdad Esfahbod 252632c477 [uniscribe] Fix use of deprecated API 2018-11-05 14:33:41 -05:00
Behdad Esfahbod bb380ec183 [cmap] Make null accelerator safe
Fixes https://github.com/harfbuzz/harfbuzz/issues/1146
2018-11-05 13:47:30 -05:00
Behdad Esfahbod f6fc5574d3 Add pointer magic operators to hb_atomic_ptr_t 2018-11-05 13:23:54 -05:00
Behdad Esfahbod f6e7cb51b1 Fix const-confusion in hb_array_t as well 2018-11-05 13:23:07 -05:00
Behdad Esfahbod 0da22fb0ad [null] Tweak hb_nonnull_ptr_t some more 2018-11-05 13:20:06 -05:00
Behdad Esfahbod 03348ce005 Minor 2018-11-05 12:59:32 -05:00
Michiharu Ariza b721fdae66 fixed leaks in CFF subr subset 2018-11-04 16:19:15 -08:00
Michiharu Ariza 85f5644e8e added missing switch breaks 2018-11-04 14:17:30 -08:00
Michiharu Ariza 1682d1bbec Merge branch 'master' into cff-subset 2018-11-04 13:25:41 -08:00
Behdad Esfahbod b605db2f65 [aat] Clean up ankr table include mess 2018-11-04 12:58:02 -05:00
Behdad Esfahbod 17335a8161 Clean up buffer->swap_buffers() calls
That function checks for buffer->successful already.  No need
to check at call site.
2018-11-04 02:25:07 -05:00
Michiharu Ariza 191ca0f15b CFF1 no-desubr fixes
make sure charstring/subrs not ending with endchar/return handled correctly
if no local subrs, skip serializing Subrs op in Private
misc fixes
2018-11-03 22:42:22 -07:00
Behdad Esfahbod 4eb52460c8 Fix >> 2018-11-03 21:45:39 -04:00
Behdad Esfahbod ae9ad1076e Fix "Warning: extra ";" ignored." 2018-11-03 21:41:50 -04:00
Behdad Esfahbod d0163afb7b Revert "Add operator char * to the naked array types as well"
This reverts commit db889c182e.

Was resulting in ambigious overloads...
2018-11-03 21:38:30 -04:00
Behdad Esfahbod c8f94a1ca6 Minor 2018-11-03 21:08:13 -04:00
Michiharu Ariza 1da4de7e7b fix for subset fuzzer failure
A called subr must be freshly parsed or completely parsed. otherwise the prevoius parse must have terminated prematurely
2018-11-03 15:41:29 -07:00
Behdad Esfahbod 0b0b38ec1e Fix null accelerator's
Fixes all except for cmap.  To be done separately.

Part of https://github.com/harfbuzz/harfbuzz/issues/1146
2018-11-03 16:16:31 -04:00
Behdad Esfahbod db889c182e Add operator char * to the naked array types as well 2018-11-03 16:04:19 -04:00
Behdad Esfahbod d6fdae310f Add operator char * to hb_nonnull_ptr_t 2018-11-03 16:02:03 -04:00
Behdad Esfahbod 7430ff604a Template casts in hb_nonnull_ptr_t 2018-11-03 15:59:13 -04:00
Behdad Esfahbod da408fce98 [blob] Allow null parent in create_sub_blob()
Like font and unicode.
2018-11-03 15:49:37 -04:00
Behdad Esfahbod fb0f30f55a Add hb_nonnull_ptr_t
Towards fixing https://github.com/harfbuzz/harfbuzz/issues/1146
2018-11-03 15:41:32 -04:00
Behdad Esfahbod 8d98c51d13 [kern] Third try fix access violation in Format3
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11245
2018-11-03 15:14:57 -04:00
Behdad Esfahbod f074da8c2b [kern] Really fix access violation in Format3
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11245
2018-11-03 15:07:39 -04:00
Behdad Esfahbod 93ef20a83b Replace most uses of is_inert with is_immutable 2018-11-03 15:03:06 -04:00
Behdad Esfahbod 0589787ff5 [kern] Fix access violation in Format3
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11245
2018-11-03 14:59:40 -04:00
Behdad Esfahbod 5570c87f21 Port objects to use header.writable instead of immutable
Saves 4 or 8 bytes per object on 64bit archs.
2018-11-03 14:59:40 -04:00