Commit Graph

6747 Commits

Author SHA1 Message Date
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
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
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
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