Commit Graph

306 Commits

Author SHA1 Message Date
Behdad Esfahbod ac0efaf818 Use hb_memset instead of memset consistently 2022-11-22 12:50:36 -07:00
Behdad Esfahbod 4c14043b06 [algs] Add output argument to hb_unsigned_mul_overflows() 2022-11-21 12:56:33 -07:00
Behdad Esfahbod ed43bc5118 [buffer] Move delete_glyphs_inplace() here 2022-11-20 13:10:19 -07:00
Behdad Esfahbod 1945b400da [cpluscplus] Wrap hb-subset types as well
Also changes signature of get_user_data of hb.h types to take const
object. This is safe.
2022-07-25 10:45:55 -06:00
Behdad Esfahbod 0722b627f4 [buffer] Return delta from sync_so_far 2022-07-24 17:35:44 -06:00
Behdad Esfahbod c55c019771 [buffer] Add assertions of buffer sync status to message_impl 2022-07-24 16:30:33 -06:00
Behdad Esfahbod da9edce84c [buffer] Add sync_so_far()
This removes separate out-buffer, at the cost of possibly changing
idx.
2022-07-24 16:30:19 -06:00
Khaled Hosny 98e90cc67c [docs] Reduce warnings
Use markdown syntax for inline code blocks instead of %true, %false, and
%NULL.
2022-06-30 08:44:40 +02:00
Behdad Esfahbod 689c77530a [buffer] Actually remove TODO item
In reality, one side is smaller and one side is larger. The existing code
handles that just fine.
2022-06-10 07:37:45 -06:00
Behdad Esfahbod d09e962b9f [buffer] Update a TODO item 2022-06-10 07:36:43 -06:00
Behdad Esfahbod f78a25098a [gi] Remove Xconstructor annotations 2022-06-05 00:55:35 -06:00
Behdad Esfahbod 55b911d863 [buffer] Mark getter functions as taking const buffer
Fixes https://github.com/harfbuzz/harfbuzz/issues/2873
2022-06-01 08:13:06 -06:00
Behdad Esfahbod e246723f0c [shape] Fail shaping internally if buffer ops exceeded 2022-06-01 05:00:06 -06:00
Behdad Esfahbod 9c0c31dfaa [buffer] When deleting glyphs, check cluster backwards as well 2022-06-01 04:52:10 -06:00
Behdad Esfahbod f7f61aeb6f [buffer] Add TODO item 2022-06-01 04:48:59 -06:00
Behdad Esfahbod 9a2a857043 [ot-shape] Don't verify buffer if shaping failed
Fixes all of fuzzing verify failures, which were result of buffer failure
on super-long results, which fails unsafe-to-break because shorter strings
don't fail shaping.
2022-05-31 06:35:42 -06:00
Behdad Esfahbod 2e186d9f24 [buffer] Improve hash function of segment_properties_t 2022-05-20 13:19:48 -06:00
Behdad Esfahbod d35c73cd37 [buffer] Whitespace 2022-03-22 13:09:50 -06:00
Behdad Esfahbod 03085132ba [buffer] Fix out-buffer under memory-alloc failure
This was broken in July refactoring of the buffer, and exposed to
ReverseChainSingleSubstFormat1 in 3807061d63

Fixes:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38800
https://bugs.chromium.org/p/chromium/issues/detail?id=1303552
2022-03-21 18:09:06 -06:00
Behdad Esfahbod b263371b09
Merge pull request #3398 from harfbuzz/buffer-verify
Add HB_BUFFER_FLAG_VERIFY
2022-02-12 15:06:47 -06:00
Khaled Hosny 98da330638 3.3.0 2022-01-31 18:39:06 +02:00
Behdad Esfahbod 7c704d8982 [buffer] Make hb_buffer_append() take a const argument 2022-01-28 13:53:44 -07:00
Behdad Esfahbod d98a0fc88e [buffer] Consolidate glyph-flags implementation 2022-01-22 11:53:18 -07:00
Behdad Esfahbod f91ce56e08 [buffer] Add default cluster value in find_min_cluster 2022-01-22 11:53:18 -07:00
Behdad Esfahbod 56d081955c [buffer] Rename _unsafe_to_break_set_mask to _infos_set_glyph_flags 2022-01-22 11:53:18 -07:00
Behdad Esfahbod 3122c2cdc4 [buffer] Add HB_GLYPH_FLAG_UNSAFE_TO_CONCAT
Fixes https://github.com/harfbuzz/harfbuzz/issues/1463
2022-01-22 11:53:18 -07:00
Behdad Esfahbod bea5369c6d [buffer] Rename swap_buffers() to sync() 2022-01-04 10:52:05 -07:00
Behdad Esfahbod d1e7df5c3f [buffer] Add enter()/leave() pair around shape() 2022-01-04 07:32:04 -07:00
Behdad Esfahbod 43be5ba442 [buffer] Group shape-related members together 2022-01-04 07:26:53 -07:00
Behdad Esfahbod 52f5711ed0 [buffer] Add hb_buffer_create_similar()
Fixes https://github.com/harfbuzz/harfbuzz/issues/1555
2022-01-03 11:57:42 -07:00
Behdad Esfahbod f643b81ffc [buffer] Clean up internal state bookkeeping
hb_buffer_reset() was NOT resetting cluster_level. Ouch! Fix that.

Part of https://github.com/harfbuzz/harfbuzz/issues/1555
2022-01-03 11:45:31 -07:00
Behdad Esfahbod 36e9f467a4 [buffer] Overlay segment-properties in hb_buffer_append()
Part of https://github.com/harfbuzz/harfbuzz/issues/1555
2022-01-03 11:23:14 -07:00
Behdad Esfahbod 6a66992842 Add hb_segment_properties_overlay()
New API:
+ hb_segment_properties_overlay()
2022-01-03 11:21:29 -07:00
Behdad Esfahbod 1b78e04c78 [buffer] Add ::reverse_groups() 2021-12-10 12:45:43 -07:00
Behdad Esfahbod 4cd96e73e4 [buffer] Inline revers_range() / reverse() 2021-12-10 12:33:21 -07:00
Behdad Esfahbod 70f8c57e5c [buffer] Rename find_min_cluster 2021-12-04 19:49:23 -08:00
Khaled Hosny 77eeec53a9 3.1.0 2021-11-03 23:31:03 +02:00
Behdad Esfahbod da500568de [API] Add hb_buffer_[sg]et_not_found_glyph() and --not-found-glyph
Instead of using gid=0 when a character is not found in the font,
client can now set a custom value.  This is useful for shaper-driven
font fallback and to differentiate that from .notdef glyph.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1360
2021-10-26 08:02:29 -06:00
Behdad Esfahbod 4b5a81f13c [buffer] Fix hb_buffer_append() pre/post-context logic
Part of https://github.com/harfbuzz/harfbuzz/pull/3150
2021-08-25 15:20:54 -06:00
Khaled Hosny 430224b1a0 [buffer] Handle pre/post-context in buffer_append
Fixes https://github.com/harfbuzz/harfbuzz/issues/1843
2021-08-24 02:11:17 +02:00
Behdad Esfahbod 09c3b82f5e [buffer] When shifting forward, leave no gap
Trying to see if this fixes the fuzzer issue:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=36236
2021-08-04 11:55:53 -06:00
Behdad Esfahbod 3e266e5f64 [buffer] Update comments 2021-07-12 17:36:36 -06:00
Behdad Esfahbod 3807061d63 [ot-layout] Don't remove_output() before reverse substitution
No need anymore, because of new swap_buffers() semantics.

Just assert instead.
2021-07-12 17:36:22 -06:00
Behdad Esfahbod 10a9960f0a [buffer] Restructure swap_buffers()
Is more of a "commit" operation now. Will rename when ready.
2021-07-12 17:36:22 -06:00
Behdad Esfahbod 05c17787c4 [buffer] Rewind cursor in clear_output() 2021-07-12 16:55:08 -06:00
Behdad Esfahbod 69310f14a6 [buffer] Change nil buffer have_output to false
Seems like a historical artefact that it was true.
2021-07-09 16:45:55 -07:00
Behdad Esfahbod 2337f0d047 Internally use hb_malloc/.../hb_free instead of malloc/.../free
Redefining those stock names as macros was conflicting with gcc 10
headers.

Fixes https://github.com/harfbuzz/harfbuzz/issues/3044
2021-07-08 10:54:09 -07:00
Behdad Esfahbod 93e6a9bc4e Revert "Remove unneeded buffer clear_output / remove_output calls"
This reverts commit 06175b7143.

One of the sanitizers is failing. Pushing again as PR to debug.
I have suspicions.
2021-06-15 15:38:49 -06:00
Behdad Esfahbod 06175b7143 Remove unneeded buffer clear_output / remove_output calls
Made sure clear_output is always paired with swap_buffers.
Trying to see if we can move towards RAII-like buffer iterators
instead of the buffer keeping an iterator internally.
2021-06-15 14:33:27 -06:00
Behdad Esfahbod c61ce962cf [buffer] In hb_buffer_get_positions(), return NULL if inside message callback
As discussed in https://github.com/harfbuzz/harfbuzz/issues/2468#issuecomment-645666066

Part of fixing https://github.com/harfbuzz/harfbuzz/issues/2468
2021-06-10 17:36:38 -06:00