3744 Commits

Author SHA1 Message Date
Behdad Esfahbod
1dc32ea4d2 Whitespace 2015-11-20 13:24:19 -08:00
Behdad Esfahbod
f94c0ecbb1 Define HB_MARK_AS_FLAG_T as a macro instead of using templates
The generic template operator overloading was causing more problems than it
solved.  Eg:

https://github.com/behdad/harfbuzz/pull/163
https://github.com/behdad/harfbuzz/issues/175

So, just use macros.

Fixes https://github.com/behdad/harfbuzz/issues/175
Fixes https://github.com/behdad/harfbuzz/pull/178
2015-11-20 13:21:29 -08:00
jfkthame
f19c6db18e Add braces for subobject initializer in _hb_font_funcs_nil
To avoid triggering -Wmissing-braces; see https://bugzilla.mozilla.org/show_bug.cgi?id=1226175#c8
2015-11-20 08:43:49 +00:00
Behdad Esfahbod
9cc1ed4fa6 Do not allow recursiving to same position and same lookup
This is just to make it harder to be extremely slow.  There definitely
are ways still, just harder.  Oh well... how do we tame this problem
without solving halting problem?!

Fixes https://github.com/behdad/harfbuzz/issues/174
2015-11-19 12:39:09 -08:00
Behdad Esfahbod
13188cba7f Revert "Fix hang in OOM situations"
This reverts commit f0599db761d7fc2d585d86e757a797f75ebc7499.

Commit abadc1717d997b69f987fdf1be9e12156d2d13d6 provides a better
fix for this.
2015-11-19 11:59:47 -08:00
Behdad Esfahbod
18e1c6b6ef Revert "Make sure we make progress in OOM situations"
This reverts commit 68b507a3c3c62c28c38e13fee733702bb703b6ca.

Commit abadc1717d997b69f987fdf1be9e12156d2d13d6 provides a better
fix for this.
2015-11-19 11:50:58 -08:00
Behdad Esfahbod
63fe05c8b1 Fix make distcheck 2015-11-18 23:52:51 -08:00
Behdad Esfahbod
37b40cd8a1 Fix another move_to assertion failure
If buf->idx is at end, don't set end past it...

Fixes https://github.com/behdad/harfbuzz/issues/173
2015-11-18 23:04:45 -08:00
Behdad Esfahbod
abadc1717d Try to better handle OOM situations
Fixes assert fail in https://github.com/behdad/harfbuzz/issues/161
with libharfbuzz-fuzzing.
2015-11-18 17:52:08 -08:00
Behdad Esfahbod
ff16ef3379 Enable building a bounded version of the library for fuzzing
test/fuzzing/hb-fuzzer links against libharfbuzz-fuzzing.so now.
2015-11-18 16:27:32 -08:00
Behdad Esfahbod
e0082ae60d Move things around 2015-11-17 18:42:13 -08:00
Chun-wei Fan
167c327177 Fix build on MSVC >= 2012
Use the DEFINE_ENUM_FLAG_OPERATORS macro in winnt.h on Visual Studio,
which defines the bitwise operators for the enumerations that we want to
mark as hb_mark_as_flags_t, which will take care of the situation on newer
Visual Studio (>= 2012), where the build breaks with C2057 errors as the
underlying types of the enumerations is not clear to the compiler when we
do a bitwise op within the declaration of the enumerations themselves.

Also disable the C4200 (nonstandard extension used : zero-sized array in
struct/union) and C4800 ('type' : forcing value to bool 'true' or 'false'
(performance warning)) warnings as the C4200 is the intended scenario and
C4800 is harmless but is so far an unavoidable side effect of using
DEFINE_ENUM_FLAG_OPERATORS.
2015-11-17 12:19:22 +08:00
Chun-wei Fan
4d27bb8746 hb-ot-shape-complex-arabic.cc: Fix build on Visual Studio
Visual Studio does not like declaring a enum variable within a for
statement, so fix the build by declaring the enum before doing the for
loop.
2015-11-16 23:04:36 +08:00
Behdad Esfahbod
d5f0d7c9fb Merge pull request #167 from KonstantinRitt/unicode_cp_opt
Micro optimizations to UTF-16 and UTF-32 codecs
2015-11-07 07:50:58 -08:00
Behdad Esfahbod
04ff23e73d [arabic] Improve stretch length calculation
Err on the side of being too short, than too wide.  Reduces chance
of overlaps with neighboring glyphs.
2015-11-06 16:29:44 -08:00
Behdad Esfahbod
59821ab8b4 [arabic] Don't stretch over cased letters
Addresses
6e6f82b6f3 (commitcomment-14248516)
2015-11-06 16:27:44 -08:00
Behdad Esfahbod
5337db29af Revert "Don't process lookups if buffer is in error"
This reverts commit f92bd86cc8c11d262d1830c631cb7c63fc9d4bc8.

We don't want to be like cairo, where as soon as there's an error,
nothing works anymore.  So, lets process lookups as long as there's
no new memory needed.  That's also a model that hides fewer bugs.
2015-11-06 16:18:09 -08:00
Konstantin Ritt
529a933128 Micro optimization to hb_utf16_t and hb_utf32_t ::prev()
Implement reverse lookup instead of re-using next()
2015-11-07 02:00:04 +04:00
Konstantin Ritt
44ae9be7a2 Nano optimization to hb_utf16_t and hb_utf32_t ::next() 2015-11-07 01:58:38 +04:00
Behdad Esfahbod
f1c4adbcd3 Fix typo 2015-11-06 09:46:05 -08:00
Behdad Esfahbod
68b507a3c3 Make sure we make progress in OOM situations 2015-11-06 00:09:26 -08:00
Behdad Esfahbod
f0599db761 Fix hang in OOM situations
Fixes https://github.com/behdad/harfbuzz/issues/161
2015-11-05 23:55:51 -08:00
Behdad Esfahbod
f92bd86cc8 Don't process lookups if buffer is in error 2015-11-05 23:52:29 -08:00
Behdad Esfahbod
4301703bdd Limit buffer max size growth
https://github.com/behdad/harfbuzz/issues/161
2015-11-05 23:44:59 -08:00
Behdad Esfahbod
6e6f82b6f3 Implement SYRIAC ABBREVIATION MARK with 'stch' feature
The feature is enabled for any character in the Arabic shaper.
We should experiment with using it for Arabic subtending marks.
Though, that has a directionality problem as well, since those
are used with digits...

Fixes https://github.com/behdad/harfbuzz/issues/141
2015-11-05 17:46:34 -08:00
Behdad Esfahbod
c743ec5886 [ft] Fix extents with negative scales
Fixes https://github.com/behdad/harfbuzz/issues/162
2015-11-05 17:38:27 -08:00
Behdad Esfahbod
73fec3992a Reserve a few scratch-flags bits for complex shapers 2015-11-05 15:22:18 -08:00
Behdad Esfahbod
136863371c Add new shaper method postprocess_glyphs()
Unused currently.  To be used for Syriac stretch implementation.

https://github.com/behdad/harfbuzz/issues/141
2015-11-05 13:24:15 -08:00
Behdad Esfahbod
e95eb23a4e Don't try zeroing marks by GDEF if there are no non-ASCII
This one is a hack, but should be ok.
2015-11-04 22:59:28 -08:00
Behdad Esfahbod
7fa54ed75a Don't try zeroing mark attachments by Unicode if there's no non-ASCII 2015-11-04 22:59:24 -08:00
Behdad Esfahbod
550bd14d2b Actually commit changes for previous commit 2015-11-04 22:58:58 -08:00
Behdad Esfahbod
ff31b3c1b8 Skip GPOS cursive / attachment adjustmnent if none happened
I'm starting to really like how free these new scratch_flags are.
2015-11-04 22:47:30 -08:00
Behdad Esfahbod
0f407325f6 Minor 2015-11-04 22:28:44 -08:00
Behdad Esfahbod
497a6c2071 Skip forming clusters if text is all ASCII 2015-11-04 22:24:19 -08:00
Behdad Esfahbod
28de104f15 Move variable-sized struct member to end
Hopefully makes clang build happy
2015-11-04 22:03:09 -08:00
Behdad Esfahbod
5bc28b5f68 Optimize positioning for when h_origin is nil 2015-11-04 21:53:16 -08:00
Behdad Esfahbod
762770c964 Add font->has_...() to check for individual nil font funcs
Hopefully this wouldn't break any compiler.  There was some magic
moments to getting this to compile...
2015-11-04 21:49:19 -08:00
Behdad Esfahbod
88e9a9bcae Minor reshaping of hb_font_funcs_t implementation
In anticipation of further changes.  No functional changes.
2015-11-04 21:16:26 -08:00
Behdad Esfahbod
a6a7715bac Comments 2015-11-04 20:51:21 -08:00
Behdad Esfahbod
6c48ec830f [ot] Remove font funcs that do nothing 2015-11-04 20:47:42 -08:00
Behdad Esfahbod
75ea2daa1d [ot] Port ot font funcs to allocated object 2015-11-04 20:43:59 -08:00
Behdad Esfahbod
44f8275080 [ft] Remove font funcs that do nothing 2015-11-04 20:43:43 -08:00
Behdad Esfahbod
7918c261ef [ft] Port ft font funcs to allocated object 2015-11-04 20:37:49 -08:00
Behdad Esfahbod
da29b43794 Separate nil font-funcs from parent-peeking font-funcs
API change: all fonts created with hb_font_create() now inherit from
(ie have parent) hb_font_get_empty().
2015-11-04 20:22:44 -08:00
Behdad Esfahbod
bee901b38e Optimize positioning direction calculations
It makes the binary smaller AND faster.  Yumm!
2015-11-04 19:28:17 -08:00
Behdad Esfahbod
e3e4bb011a Don't do fractions if buffer is ASCII-only 2015-11-04 18:58:02 -08:00
Behdad Esfahbod
6986208ba3 Optimize runs without Default_Ignorable's
Now that we have a buffer-wide scratch flags facility, use it to
optimize away a few passes.
2015-11-04 18:46:41 -08:00
Behdad Esfahbod
14c2de3218 Limit max edits during sanitize to 8
Used to be 100.  If a tabe needs more than one or two edits, it's
probably completely bogus...

Might help with speeding up fuzzing for
https://github.com/behdad/harfbuzz/issues/157
2015-11-04 18:00:57 -08:00
Behdad Esfahbod
9cbc39aef9 Minor 2015-11-04 18:00:53 -08:00
Behdad Esfahbod
52e6c4e158 If font doesn't support U+2011, fall back to U+2010
Test passes now.
2015-11-04 17:45:56 -08:00