src/hb-buffer.cc


Log

Author Commit Date CI Message
Behdad Esfahbod 18e1c6b6 2015-11-19T11:50:58 Revert "Make sure we make progress in OOM situations" This reverts commit 68b507a3c3c62c28c38e13fee733702bb703b6ca. Commit abadc1717d997b69f987fdf1be9e12156d2d13d6 provides a better fix for this.
Behdad Esfahbod 68b507a3 2015-11-06T00:09:26 Make sure we make progress in OOM situations
Behdad Esfahbod 4301703b 2015-11-05T23:44:59 Limit buffer max size growth https://github.com/behdad/harfbuzz/issues/161
Behdad Esfahbod 49ef6309 2015-11-04T17:27:07 Adjust the width of various spaces if font does not cover them See discussion here: https://github.com/behdad/harfbuzz/commit/81ef4f407d9c7bd98cf62cef951dc538b13442eb There's no way to disable this fallback, but I don't think it would be needed. Let's hope for the best! Fixes https://github.com/behdad/harfbuzz/issues/153
Behdad Esfahbod b8811429 2015-09-03T15:53:22 Fix Since tags Fixes https://github.com/behdad/harfbuzz/issues/103
Behdad Esfahbod e995d33c 2015-09-01T16:13:32 [OT] Merge clusters when reordering marks for normalization Fixes https://bugzilla.gnome.org/show_bug.cgi?id=541608 and cluster test.
Behdad Esfahbod 85846b3d 2015-09-01T15:07:52 Use insertion-sort instead of bubble-sort Needed for upcoming merge-clusters fix.
Behdad Esfahbod 376d587f 2015-07-22T16:51:12 Implement more granular cluster-merging TODO: Documentation. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=71445
Behdad Esfahbod 701112da 2015-07-22T15:42:20 [ot] Simplify form_clusters()
Behdad Esfahbod 5f13bbd9 2015-06-19T13:31:49 When removing default-ignorables, merge clusters Fixes test-shape, and: https://code.google.com/p/chromium/issues/detail?id=497578
Sascha Brawer 01c3a885 2015-06-01T13:22:01 Fix "Since:" tags Based on data from http://upstream-tracker.org/versions/harfbuzz.html Resolves #103
Behdad Esfahbod 81bedda5 2015-04-30T13:04:16 New API: hb_buffer_reverse_range()
Khaled Hosny 22524a51 2015-04-10T18:14:45 [bindings] Fix hb_buffer_get_segment_properties Annotate the output parameter.
Khaled Hosny 04f89e8f 2015-04-10T17:49:01 [bindings] Fix ownership of returned hb_language_t It should not be freed by the caller.
Behdad Esfahbod 9e401f68 2015-03-20T16:08:38 Fix reverse_range() for empty range Fixes coretext notdef loop consisting of all default_ignorable glyphs https://code.google.com/p/chromium/issues/detail?id=464755
Behdad Esfahbod 8ac345e5 2015-03-02T16:06:55 Fix reverse_range() to only reverse alt array if positions are used In hb-coretext, when we were using scratch buffer for book-keeping, a reverse_range() caused by the notdef-insertion loop could mess up our log_clusters. Ouch!
Behdad Esfahbod 61820bc4 2015-01-26T14:25:52 [API] Add hb_buffer_add_latin1() This is by no ways to promote non-Unicode encodings. This is an entry point that takes Unicode codepoints that happen to all be the first 256 characters and hence fit in 8bit strings. This is useful eg in Chrome where strings that can fit in 8bit are implemented that way, and this avoids copying into UTF-8 or UTF-16. Perhaps we should rename this to hb_buffer_add_codepoints8(). I'm also curious if anyone would be really interested in hb_buffer_add_codepoints16(). Please discuss!
Behdad Esfahbod 78c6e86c 2015-01-26T14:08:36 Fix hb_buffer_add_codepoints to actually NOT validate
Behdad Esfahbod b632e799 2015-01-06T14:05:26 Fix up gobject-introspection a bit Minimal shaping works now!
Behdad Esfahbod b5fbc3b8 2014-08-11T18:40:01 API: Do not clear buffer-flags in hb_buffer_clear_contents() After 763e5466c0a03a7c27020e1e2598e488612529a7, one doesn't need to set flags for different pieces of text. The flags now are something the client sets up once, depending on how it actually uses the buffer. As such, don't clear it in clear_contents(). Tests updated.
Behdad Esfahbod 976c8f45 2014-07-16T15:34:20 New API: hb_buffer_[sg]et_replacement_codepoint() With this change, we now by default replace broken UTF-8/16/32 bits with U+FFFD. This can be changed by calling new API on the buffer. Previously the replacement value used to be (hb_codepoint_t)-1. Note that hb_buffer_clear_contents() does NOT reset the replacement character. See discussion here: https://github.com/behdad/harfbuzz/commit/6f13b6d62daae4989e3cc2fe4b168e5c59650964 New API: hb_buffer_set_replacement_codepoint() hb_buffer_get_replacement_codepoint()
Behdad Esfahbod bcba8b45 2014-07-16T14:59:04 New API hb_buffer_add_codepoints() Like hb_buffer_add_utf32, but doesn't do any Unicode validation. This is like what hb_buffer_add_utf32 used to be until a couple commits ago.
Behdad Esfahbod 625dbf14 2014-07-16T14:49:55 [buffer] Templatize UTF-* functions
Behdad Esfahbod 66c6a48b 2014-04-14T15:55:42 Add HB_NO_MERGE_CLUSTERS Disables any cluster-merging. Added for testing purposes while we investigate what kind of API to add for this.
Behdad Esfahbod 02c6c8cd 2013-11-15T13:05:38 Set buffer content type to INVALID in hb_buffer_set_length(0) Previously we were only setting this in hb_buffer_clear_contents(), but set_length(0) is a valid way to reinitialize buffer to use with new text.
Behdad Esfahbod 061cb464 2013-11-13T14:50:25 Use long alignment for scratch buffer Fixes last of scratch alignment warnings in hb-coretext.
Behdad Esfahbod 68c372ed 2013-11-13T14:44:01 More scratch-buffer cleanup
Behdad Esfahbod 16f175cb 2013-11-12T17:22:49 Fix scratch-buffer alignment warnings
Behdad Esfahbod da72042c 2013-10-17T12:01:50 [otlayout] Fix up recent Context matching change Commit 6b65a76b40522a4f57a6fedcbdfc5a4d736f1d3c. "end" was becoming negative. Was trigerred by Lohit-Kannada 2.5.3 and the sequence: U+0CB0,U+200D,U+0CBE,U+0CB7,U+0CCD,U+0C9F,U+0CCD,U+0CB0,U+0C97,U+0CB3 Two glyphs were being duplicated.
Behdad Esfahbod 6b65a76b 2013-10-14T18:51:39 [otlayout] Fix (Chain)Context recursion! Previously we only supported recursive sublookups with ascending indices. We were also not correctly handling non-1-to-1 recursed lookups. Fix all that! Fixes the three tests in test/shaping/tests/context-matching.tests, which were derived from NotoSansBengali and NotoSansDevanagari among others.
Behdad Esfahbod 085d4291 2013-09-12T17:14:33 [introspection] Disable constructors for now Since our types are not associated with their methods, marking constructors makes them inaccessible from bindings. Undo for now.
Behdad Esfahbod 288f2899 2013-09-06T15:40:22 [docs/introspection] More annotations
Behdad Esfahbod c44b8183 2013-09-06T15:13:16 Whitespace
Behdad Esfahbod 5f512017 2013-09-04T18:28:39 [docs] Document a few symbols
Behdad Esfahbod 4dc798de 2013-08-26T20:39:00 Add hb-deprecated.h, and rename a couple enum values Add deprecated alias for old name.
Behdad Esfahbod 6c15ddfe 2013-04-30T11:34:00 Renamed DEBUG to something else Some infrastructures use DEBUG as a generic symbol.
Behdad Esfahbod 847794e9 2013-02-27T17:59:28 [buffer] Implement buffer deserialization for format=text Using a ragel machine.
Behdad Esfahbod d3e14aaf 2013-02-27T11:06:36 [buffer] Move buffer serialization code to a new file
Behdad Esfahbod 1172dc73 2013-01-07T16:46:37 Rename hb_buffer_clear() to hb_buffer_clear_contents() The previous name was clashing with harfbuzz.old. There are systems that need to link both... Clash-free now again.
Behdad Esfahbod f4abcbfc 2012-12-21T16:48:51 Minor
Behdad Esfahbod 8465a05a 2012-11-30T08:46:43 Fix hb_buffer_guess_segment_properties() for empty buffer Was causing assertion failure in shape_plan().
Behdad Esfahbod 3f82f8ff 2012-11-15T18:45:31 Rename hb_buffer_guess_properties() to hb_buffer_guess_segment_properties()
Behdad Esfahbod f3064103 2012-11-15T18:39:46 Bunch of independent changes (ouch) API additions: hb_segment_properties_t HB_SEGMENT_PROPERTIES_DEFAULT hb_segment_properties_equal() hb_segment_properties_hash() hb_buffer_set_segment_properties() hb_buffer_get_segment_properties() hb_ot_layout_glyph_class_t hb_shape_plan_t hb_shape_plan_create() hb_shape_plan_create_cached() hb_shape_plan_get_empty() hb_shape_plan_reference() hb_shape_plan_destroy() hb_shape_plan_set_user_data() hb_shape_plan_get_user_data() hb_shape_plan_execute() hb_ot_shape_plan_collect_lookups() API changes: Rename hb_ot_layout_feature_get_lookup_indexes() to hb_ot_layout_feature_get_lookups(). New header file: hb-shape-plan.h And a bunch of prototyped but not implemented stuff. Coming soon. (Tests fail because of the prototypes right now.)
Behdad Esfahbod c54599ad 2012-11-15T16:14:23 Minor
Behdad Esfahbod 072ae7a9 2012-11-15T13:14:12 Add hb_buffer_serialize_list_formats()
Behdad Esfahbod f9edf167 2012-11-15T12:14:09 Add buffer serialization / deserialization API Two output formats for now: TEXT, and JSON. For example: hb-shape --output-format=json Deserialization API is added, but not implemented yet.
Behdad Esfahbod 66ac2ff3 2012-11-13T16:26:32 API change: Remove "mask" from hb_buffer_add() I don't expect anybody using hb_buffer_add(), so this shouldn't break anyone's code.
Behdad Esfahbod 0c7df222 2012-11-13T14:42:35 Add buffer flags New API: hb_buffer_flags_t HB_BUFFER_FLAGS_DEFAULT HB_BUFFER_FLAG_BOT HB_BUFFER_FLAG_EOT HB_BUFFER_FLAG_PRESERVE_DEFAULT_IGNORABLES hb_buffer_set_flags() hb_buffer_get_flags() We use the BOT flag to decide whether to insert dottedcircle if the first char in the buffer is a combining mark. The PRESERVE_DEFAULT_IGNORABLES flag prevents removal of characters like ZWNJ/ZWJ/...
Behdad Esfahbod 82ecaff7 2012-11-13T13:57:52 Add hb_buffer_clear() Which is like _reset(), but does NOT clear unicode-funcs.
Behdad Esfahbod da70111a 2012-10-31T13:45:30 Don't clear buffer pre-context if no new context is being provided Patch from Jonathan Kew. Part of fixing: Mozilla Bug 801410 - avoid inserting dotted-circle for run-initial Unicode combining characters in "simple" scripts such as Latin https://bugzilla.mozilla.org/show_bug.cgi?id=801410
Behdad Esfahbod 0bc7a384 2012-10-29T22:02:45 [OT] Fix ReverseChainingSubst We should make it clear that we don't want output buffer in this case, otherwise buffer->backtrack_len() would be wrong.
Behdad Esfahbod 38b015e5 2012-10-28T20:11:47 Fix hb_buffer_set_length(buffer, 0) Was causing invalid realloc()s.
Behdad Esfahbod 05207a79 2012-09-25T17:44:53 [buffer] Save pre/post textual context To be used for a variety of purposes. We save up to five characters in each direction. No public API changes, everything is taken care of already. All clients need to do is to call hb_buffer_add_utf* with the full text + segment info (or at least some context) instead of just passing in the segment. Various operations (hb_buffer_reset, hb_buffer_set_length, hb_buffer_add*) automatically reset the relevant contexts.
Behdad Esfahbod 1f66c3c1 2012-09-25T11:42:16 Add hb_utf_strlen() Speeds up UTF-8 parsing by calling strlen().
Behdad Esfahbod 7f19ae7b 2012-09-25T11:22:28 [buffer] Templatize UTF handling Also move UTF routines into a separate file, to be reused from shapers that need it.
Behdad Esfahbod 0e0a4da9 2012-09-25T11:09:04 [buffer] Towards template'izing different UTF adders
Behdad Esfahbod 7d372806 2012-09-25T11:04:41 Minor
Behdad Esfahbod 96fdc04e 2012-09-06T22:26:16 Add hb_buffer_[sg]et_content_type And hb_buffer_content_type_t and enum values.
Behdad Esfahbod b85800f9 2012-08-31T18:12:01 [Indic] Implement dotted-circle insertion for broken clusters No panic, we reeally insert dotted circle when it's absolutely broken. Fixes most of the dotted-circle cases against Uniscribe. (for Devanagari fixes 80% of them, for Khmer 70%; the rest look like Uniscribe being really bogus...) I had to make a decision. Apparently Uniscribe adds one dotted circle to each broken character. I tried that, but that goes wrong easily with split matras. So I made it add only one dotted circle to an entire broken syllable tail. As in: "if there was a dotted circle here, this would have formed a correct cluster." That works better for split stuff, and I like it more.
Behdad Esfahbod 1be368e9 2012-08-31T16:29:17 Minor
Behdad Esfahbod 965c280d 2012-08-29T13:59:16 Add HB_BUFFER_ASSERT_VAR To be used in places we access buffer vars...
Behdad Esfahbod d5045a5f 2012-08-11T21:26:25 [ICU] Use new normalizer2 compose/decompose API It's considerably faster than the fallback implementation we had previously!
Behdad Esfahbod 208f70f0 2012-08-01T17:13:10 Inline Unicode callbacks internally
Behdad Esfahbod 69cc492d 2012-07-31T14:51:36 [buffer] Minor
Behdad Esfahbod ea278d38 2012-07-27T02:12:28 Partially switch ot shaper to shape_plan
Behdad Esfahbod 47ef931f 2012-07-19T20:52:44 [buffer] Make sure out_info = info during GPOS
Behdad Esfahbod 39b17837 2012-07-17T17:09:29 Add hb_buffer_normalize_glyphs() and hb-shape --normalize-glyphs This reorders glyphs within the cluster to a nominal order. This should have no visible effect on the output, but helps with testing, for getting the same hb-shape output for visually-equal glyphs for each cluster.
Behdad Esfahbod e085fcf7 2012-06-08T21:45:00 Remove unused buffer->replace_glyphs_be16
Behdad Esfahbod fe3dabc0 2012-06-08T20:56:05 Minor
Behdad Esfahbod e88e1442 2012-06-08T20:55:21 Use merge_clusters instead of open-coding
Behdad Esfahbod e51d2b6e 2012-06-08T20:33:27 Extend into main buffer if extension hit end of out-buffer merging clusters
Behdad Esfahbod 5ced012d 2012-06-08T20:31:32 Extend end when merging clusters in out-buffer
Behdad Esfahbod 72c0a187 2012-06-08T20:30:03 Extend clusters backward in out-buffer
Behdad Esfahbod cd589149 2012-06-08T20:27:53 Extend clusters backwards, into the out-buffer too
Behdad Esfahbod cafa6f37 2012-06-08T20:17:10 When merging clusters, extend the end
Behdad Esfahbod 2a3d911f 2012-06-07T17:31:46 Fix alignment-requirement missmatch Detected by clang and lots of cmdline options.
Behdad Esfahbod 0594a244 2012-06-05T20:35:40 Cleanup TRUE/FALSE vs true/false
Behdad Esfahbod e1ac38f8 2012-06-05T20:31:49 Fix inert buffer set_length() with zero Oops!
Behdad Esfahbod be4560a3 2012-06-05T18:14:03 Undo default unicode-funcs to avoid static initializer again
Behdad Esfahbod f06ab8a4 2012-06-05T12:31:51 Better hide nil objects and make them const
Behdad Esfahbod 8e3715f8 2012-04-23T22:18:54 Minor
Behdad Esfahbod 3b26f96e 2012-04-10T10:52:07 Add Thai shaper that does SARA AM decomposition / reordering That's not in the OpenType spec, but it's what MS and Adobe do.
Behdad Esfahbod d4cc4471 2012-04-07T21:52:28 Move code around, in prep for Thai/Lao shaper
Behdad Esfahbod c521e793 2012-01-18T21:51:05 Fix OOB in replace_glyph() Patch from Kenichi Ishibashi.
Behdad Esfahbod 9ebe8c02 2011-08-26T09:29:42 Add buffer->replace_glyphs()
Behdad Esfahbod e6c09cdf 2011-08-17T19:07:59 Remove the pre_allocate argument from hb_buffer_create() For two reasons: 1. User can always call hb_buffer_pre_allocate() themselves, and 2. Now we do a pre_alloc in add_utfX anyway, so the total number of reallocs is limited to a small number (~3) anyway. This just makes the API cleaner.
Behdad Esfahbod 4e9ff1dd 2011-08-15T16:21:22 Pre-allocate buffers when adding string We do a conservative estimate of the number of characters, but still, this limits the number of buffer reallocs to a small constant.
Behdad Esfahbod 33ccc779 2011-08-09T00:43:24 [API] Make set_user_data() functions take a replace parameter We need this to set data on objects safely without worrying that some other thread unsets it by setting it at the same time.
Behdad Esfahbod 944b2ba1 2011-08-09T00:23:58 [buffer] Make API take signed int length Since we already switched to accepting -1 as 'zero-terminated'.
Behdad Esfahbod 144cd49a 2011-08-07T00:51:50 [buffer] Accept -1 for text_length and item_length A -1 text_length means: zero-terminated string. A -1 item_length means: to the end of string.
Behdad Esfahbod 02aeca98 2011-08-04T22:31:05 [API] Changes to main shape API hb_shape() now accepts a shaper_options and a shaper_list argument. Both can be set to NULL to emulate previous API. And in most situations they are expected to be set to NULL. hb_shape() also returns a boolean for now. If shaper_list is NULL, the return value can be ignored. shaper_options is ignored for now, but otherwise it should be a NULL-terminated list of strings. shaper_list is a NULL-terminated list of strings. Currently recognized strings are "ot" for native OpenType Layout implementation, "uniscribe" for the Uniscribe backend, and "fallback" for the non-complex backend (that will be implemented shortly). The fallback backend never fails. The env var HB_SHAPER_LIST is also parsed and honored. It's a colon-separated list of shaper names. The fallback shaper is invoked if none of the env-listed shapers succeed. New API hb_buffer_guess_properties() added.
Behdad Esfahbod c605bbbb 2011-08-04T20:00:53 Remove C++ guards from source files Where causing issues for people with MSVC.
Behdad Esfahbod e62df436 2011-08-03T17:38:54 Add internal hb_buffer_t::get_scratch_buffer()
Behdad Esfahbod b65c0602 2011-07-28T16:48:43 Formalize buffer var allocations
Behdad Esfahbod a9ad3d34 2011-07-28T15:42:18 Move more code around Buffer var allocation coming into shape
Behdad Esfahbod 3a81b1db 2011-07-25T16:30:32 Minor, fix leak from my previous refactorings
Behdad Esfahbod f4a579bc 2011-07-25T16:20:16 Add internal API for buffer var allocation
Behdad Esfahbod 468e9cb2 2011-07-22T11:28:07 Move buffer methods into the object
Behdad Esfahbod 9111b21e 2011-07-21T00:58:29 Add _hb_buffer_output_glyph() and _hb_buffer_skip_glyph()
Behdad Esfahbod dd89d958 2011-07-21T00:28:57 Fix cluster calculation for non-LTR text