src/hb-ot-map.cc


Log

Author Commit Date CI Message
Behdad Esfahbod f33ad6d6 2018-10-23T14:31:51 [aat] Fix up previous commit and add files
Behdad Esfahbod 8be0e5fd 2018-10-23T13:39:50 [ot-map] Minor
David Corbett 7f1fbfe2 2018-07-23T21:19:23 Add hb_ot_tags_to_script_and_language
David Corbett 91067716 2017-12-08T11:21:14 Refactor the selection of script and language tags The old hb-ot-tag.cc functions, `hb_ot_tags_from_script` and `hb_ot_tag_from_language`, are now wrappers around a new function: `hb_ot_tags`. It converts a script and a language to arrays of script tags and language tags. This will make it easier to add new script tags to scripts, like 'dev3'. It also allows for language fallback chains; nothing produces more than one language yet though. Where the old functions return the default tags 'DFLT' and 'dflt', `hb_ot_tags` returns an empty array. The caller is responsible for using the default tag in that case. The new function also adds a new private use subtag syntax for script overrides: "x-hbscabcd" requests a script tag of 'abcd'. The old hb-ot-layout.cc functions,`hb_ot_layout_table_choose_script` and `hb_ot_layout_script_find_language` are now wrappers around the new functions `hb_ot_layout_table_select_script` and `hb_ot_layout_script_select_language`. They are essentially the same as the old ones plus a tag count parameter. Closes #495.
Behdad Esfahbod f048ead8 2018-09-24T18:01:53 Some more
Behdad Esfahbod 606bf574 2018-09-16T19:33:48 Revert forcing use of single-parameter static_assert() Some clang versions define static_assert as a macro apparently, so we cannot redefine it... This reverts commit 94bfea0ce6a7b4d5641c198d50751748a353df11. This reverts commit 4e62627831e7457ed60ff87712570065b14b200a.
Behdad Esfahbod 4e626278 2018-09-16T18:09:36 Enforce single-param static_assert() only So we don't accidentally break it again.
Behdad Esfahbod 71c9f84e 2018-09-10T22:37:19 Make --features rand=1 available to the user Use rand=255 to mean "randomize". Part of https://github.com/harfbuzz/harfbuzz/pull/803
David Corbett f05df643 2018-01-26T21:36:15 Allow requesting a specific glyph for 'rand' Randomization only happens by default. If the user specifies a value for 'rand', that value is respected.
David Corbett c2a75e07 2018-01-25T14:22:03 Implement 'rand'
Behdad Esfahbod c77ae408 2018-08-25T22:36:36 Rename hb-*private.hh to hb-*.hh Sorry for the noise, downstream custom builders. Please adjust.
Behdad Esfahbod bddeb2b1 2018-07-10T14:12:37 Minor renamings of internal inline functions
Behdad Esfahbod f9abbf83 2018-06-02T15:30:59 Fix fallout from 975bdd5ef562e37655067b703b2b9ca7481f4985 Ouch!
Behdad Esfahbod f7515769 2018-06-01T17:48:37 [vector] Use Crap pool in push() as well
Behdad Esfahbod 90869e69 2018-05-07T14:04:01 [ot] Apply langsys's required feature even if no other feature exists
Behdad Esfahbod 978ace6f 2018-02-16T16:06:17 Improve _hb_popcount() Support 128bit type.
Behdad Esfahbod 12757b69 2018-01-26T18:14:05 Misc warning fixes Fixes https://github.com/harfbuzz/harfbuzz/issues/712
Behdad Esfahbod dbdbfe3d 2017-10-15T12:11:08 Use nullptr instead of NULL
Behdad Esfahbod c3448e8d 2017-10-15T12:02:00 Use static_assert instead of custom ASSERT_STATIC
Behdad Esfahbod 5287ccc9 2017-08-10T14:25:53 [unsafe-to-break] Allocate public bits from 0
Behdad Esfahbod 40bd7e9a 2016-05-02T14:47:45 [unsafe-to-break] Add UNSAFE_TO_BREAK flag Not all shapers code is updated to set this properly. GSUB and Arabic shaper are updated. GPOS and other shapers are NOT. Fixes https://github.com/behdad/harfbuzz/issues/224
Behdad Esfahbod cdf1fd06 2017-07-14T12:43:34 [indic] Add infrastructure to disable ZWNJ-skipping in context-matching Not used yet.
Behdad Esfahbod 72ada4f0 2016-09-10T03:57:24 [GX] Hook up feature variations Shape-plan caching is not implemented.
Behdad Esfahbod 7ceadbe9 2016-09-10T02:44:20 Shuffle code around
Behdad Esfahbod bde5e395 2016-09-10T02:43:20 Move add_lookups from map to map-builder In prep for more changes.
Behdad Esfahbod 09c7a2d6 2016-08-08T17:28:54 Limit bits-per-feature to eight Limits number of alternatives per glyph per feature to 255, so be it. That's better than possibly breaking shaping because of one bad feature value.
Behdad Esfahbod 33317310 2016-08-08T17:24:04 Fix sign of shift operators This one: map->mask = (1 << (next_bit + bits_needed)) - (1 << next_bit); before the fix, the shift was done as an int, causing overflow if it ever got to 1 << 31. Sprinkle 'u's around. Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=634805
Behdad Esfahbod 731a430c 2016-03-02T13:32:42 Fix requiredFeature stage handling logic Originally the way Jonathan had written this was correct in "continue"ing: https://github.com/jfkthame/harfbuzz/commit/35e28c7a733eaffcd9f062b18d7db9fbb3d990fc#diff-ead86a33a5cc9ad7f6e6381031a0baddR199 When I rewrote his patch, I messed it up: https://github.com/behdad/harfbuzz/commit/da132937989acb4d8ca9bd41c79f98750e7dda30#diff-ead86a33a5cc9ad7f6e6381031a0baddR209 the intended behavior was NOT to set found=TRUE and NOT to continue. This was resulting in feature_index[table_index] being left unset. Oops!
Behdad Esfahbod ea512f71 2015-11-26T19:22:22 Use C-style casts instead of compare to 0, to convert hb_bool_t to bool
ThePhD 5c99cf93 2015-08-14T01:02:00 Merge branch 'master' into vc++-fixes
Behdad Esfahbod 0f98fe88 2015-07-23T11:52:11 [ot] Search globally for 'vert' feature if not found in specified script/lang Fixes https://github.com/behdad/harfbuzz/issues/63
ThePhD 8e545d59 2015-06-22T22:29:04 Fix all VC++ warnings and errors in the current commit's builds.
Jonathan Kew da132937 2014-04-27T14:05:24 Rework handling of requiredFeature to solve problem with rlig in arial.ttf from winxp https://bugzilla.mozilla.org/show_bug.cgi?id=986802 Fixes https://github.com/behdad/harfbuzz/pull/39 API Change: -hb_ot_layout_language_get_required_feature_index +hb_ot_layout_language_get_required_feature New API takes an extra pointer argument. Pass NULL in to get behavior of previous API. Reworked by behdad
Behdad Esfahbod fb8cc86f 2014-06-19T15:30:18 Rename sort() to qsort() In an effort to make the algorithm used clear.
Behdad Esfahbod 176fd17d 2013-10-30T17:27:24 Bug 70971 - Signed/unsigned compiler warnings on windows Patch from Emil Eklund.
Behdad Esfahbod 27674b4b 2013-10-03T14:54:50 [OTLayout] Protect against out-of-range lookup indices Filter them out when compiling map.
Behdad Esfahbod d2c96819 2013-05-02T18:18:24 Move code around
Behdad Esfahbod 3276c354 2013-05-02T15:16:59 [OTLayout] Minor refactoring
Behdad Esfahbod 2265be0a 2013-05-02T14:25:09 Minor
Behdad Esfahbod 893f57b3 2013-04-21T15:21:49 Minor renaming
Behdad Esfahbod 8ac3c9c0 2013-04-21T15:19:38 Rename "pause" to "stage" The compile() function is starting to become illegible...
Behdad Esfahbod dd0641a4 2013-04-21T15:13:57 Minor
Behdad Esfahbod 06a44e85 2013-04-21T15:13:08 Remove unneeded code We always push a pause at the end such that each lookup falls in exactly one pause_map_t. Now, only if I can find a better name for that...
Behdad Esfahbod a8cf7b43 2013-03-19T05:53:26 [Indic] Futher adjust ZWJ handling in Indic-like shapers After the Ngapi hackfest work, we were assuming that fonts won't use presentation features to choose specific forms (eg. conjuncts). As such, we were using auto-joiner behavior for such features. It proved to be troublesome as many fonts used presentation forms ('pres') for example to form conjuncts, which need to be disabled when a ZWJ is inserted. Two examples: U+0D2F,U+200D,U+0D4D,U+0D2F with kartika.ttf U+0995,U+09CD,U+200D,U+09B7 with vrinda.ttf What we do now is to never do magic to ZWJ during GSUB's main input match for Indic-style shapers. Note that backtrack/lookahead are still matched liberally, as is GPOS. This seems to be an acceptable compromise. As to the bug that initially started this work, that one needs to be fixed differently: Bug 58714 - Kannada u+0cb0 u+200d u+0ccd u+0c95 u+0cbe does not provide same results as Windows8 https://bugs.freedesktop.org/show_bug.cgi?id=58714 New numbers: BENGALI: 353689 out of 354188 tests passed. 499 failed (0.140886%) DEVANAGARI: 707305 out of 707394 tests passed. 89 failed (0.0125814%) GUJARATI: 366349 out of 366457 tests passed. 108 failed (0.0294714%) GURMUKHI: 60706 out of 60747 tests passed. 41 failed (0.067493%) KANNADA: 951030 out of 951913 tests passed. 883 failed (0.0927606%) KHMER: 299070 out of 299124 tests passed. 54 failed (0.0180527%) LAO: 53611 out of 53644 tests passed. 33 failed (0.0615167%) MALAYALAM: 1048102 out of 1048334 tests passed. 232 failed (0.0221304%) ORIYA: 42320 out of 42329 tests passed. 9 failed (0.021262%) SINHALA: 271666 out of 271847 tests passed. 181 failed (0.0665816%) TAMIL: 1091753 out of 1091754 tests passed. 1 failed (9.15957e-05%) TELUGU: 970555 out of 970573 tests passed. 18 failed (0.00185457%) TIBETAN: 208469 out of 208469 tests passed. 0 failed (0%)
Behdad Esfahbod 398238a2 2013-02-15T07:40:10 Fix partial disabling of default-on features Surprisingly, if user ever tried to turn a default feature off partially (say, disable liga for a range), the feature was being turned off globally! Fixed now.
Behdad Esfahbod cfc507c5 2013-02-14T10:40:12 [Indic-like] Disable automatic joiner handling for basic shaping features Not for Arabic, but for Indic-like scripts. ZWJ/ZWNJ have special meanings in those scripts, so let font lookups take full control. This undoes the regression caused by automatic-joiners handling introduced two commits ago. We only disable automatic joiner handling for the "basic shaping features" of Indic, Myanmar, and SEAsian shapers. The "presentation forms" and other features are still applied with automatic-joiner handling. This change also changes the test suite failure statistics, such that a few scripts show more "failures". The most affected is Kannada. However, upon inspection, we believe that in most, if not all, of the new failures, we are producing results superior to Uniscribe. Hard to count those! Here's an example of what is fixed by the recent joiner-handling changes: https://bugs.freedesktop.org/show_bug.cgi?id=58714 New numbers, for future reference: BENGALI: 353892 out of 354188 tests passed. 296 failed (0.0835714%) DEVANAGARI: 707336 out of 707394 tests passed. 58 failed (0.00819911%) GUJARATI: 366262 out of 366457 tests passed. 195 failed (0.0532122%) GURMUKHI: 60706 out of 60747 tests passed. 41 failed (0.067493%) KANNADA: 950680 out of 951913 tests passed. 1233 failed (0.129529%) KHMER: 299074 out of 299124 tests passed. 50 failed (0.0167155%) LAO: 53611 out of 53644 tests passed. 33 failed (0.0615167%) MALAYALAM: 1047983 out of 1048334 tests passed. 351 failed (0.0334817%) ORIYA: 42320 out of 42329 tests passed. 9 failed (0.021262%) SINHALA: 271539 out of 271847 tests passed. 308 failed (0.113299%) TAMIL: 1091753 out of 1091754 tests passed. 1 failed (9.15957e-05%) TELUGU: 970555 out of 970573 tests passed. 18 failed (0.00185457%) TIBETAN: 208469 out of 208469 tests passed. 0 failed (0%)
Behdad Esfahbod ec544866 2013-02-14T11:25:10 Add hb_ot_map_feature_flags_t Code cleanup. No (intended) functional change.
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 362a990b 2012-11-15T14:57:31 Rename hb_ot_layout_would_substitute_lookup() and hb_ot_layout_substitute_closure_lookup() To match upcoming API.
Behdad Esfahbod 851784f8 2012-11-14T16:24:05 Improve shaper selection
Behdad Esfahbod 6fddf2d7 2012-11-12T17:57:24 Refactoring ot-map building to make chosen script available earlier
Behdad Esfahbod fabd3113 2012-09-05T22:19:28 [OT] Port Arabic fallback shaping to synthetic GSUB All of init/medi/fina/isol and rlig implemented. Let there be dragons... ⻯
Behdad Esfahbod 87b75d0a 2012-09-04T23:06:38 [OT] Allow adding features with fallback implementation
Behdad Esfahbod d9b204d3 2012-08-23T16:22:28 [GSUB] Allow non-zero-context matching in would_apply() To be used in the next patch.
Behdad Esfahbod 8bb5deba 2012-08-02T10:07:58 [OT] Pipe shape_plan down to pause_callbacks
Behdad Esfahbod 3e38c0f2 2012-08-02T09:44:18 More massaging
Behdad Esfahbod 5393e3a6 2012-08-02T09:24:35 [OT] Minor refactoring
Behdad Esfahbod afbcc24b 2012-08-02T08:36:40 [GSUB] Wire the font, not just the face, down to substitute() We need the font for glyph lookup during GSUB pauses in Indic shaper. Could perhaps be avoided, but at this point, we don't mean to support separate substitute()/position() entry points (anymore), so there is no point in not providing the font to GSUB.
Behdad Esfahbod b0e6a26a 2012-08-02T08:11:14 [OT] Hide some API It was impossible to meaningfully use them from the outside these days.
Behdad Esfahbod 610e5e8f 2012-08-02T05:27:46 [Indic] Streamline feature would_apply() Comes with some 10% speedup for Devanagari even!
Behdad Esfahbod f8603664 2012-07-30T02:38:39 [OT] Gain back some lost speed
Behdad Esfahbod 77471e03 2012-06-08T20:21:02 Clear output buffer before calling GSUB pause functions
Behdad Esfahbod 6a9be5bd 2012-04-23T22:23:17 Rename hb_glyph_map_t to hb_set_t
Behdad Esfahbod d2984a24 2012-04-23T17:21:14 Add map->substitute_closure()
Behdad Esfahbod c605bbbb 2011-08-04T20:00:53 Remove C++ guards from source files Where causing issues for people with MSVC.
Behdad Esfahbod c47a31fb 2011-07-30T20:57:01 [OT] Save chosen script tag
Behdad Esfahbod 359dcaa0 2011-07-07T21:55:05 Update copyright headers
Behdad Esfahbod d8d0c480 2011-07-07T21:22:08 Refactor some code common to GSUB and GPOS
Behdad Esfahbod b70c96db 2011-07-07T21:07:41 Enable applying GSUB/GPOS features in multiple segments Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=644184 among others. Shapers now can request segmented feature application by calling add_gsub_pause() or add_gpos_pause(). They can also provide a callback to be called at the pause. Currently the Arabic shaper uses pauses to enforce certain feature application. The Indic shaper can use the same facility to pause and do reordering in the callback.
Behdad Esfahbod 31f18abe 2011-06-15T09:49:58 Minor compiler warning fixes
Behdad Esfahbod 51881a61 2011-05-27T18:15:56 Shrink code size
Behdad Esfahbod 90645fb2 2011-05-27T18:13:31 [OT] Separate map_builder from the actual map Respectively, separate planner from the actual plan.
Behdad Esfahbod 265ac614 2011-05-05T14:38:16 Replace fixed-size lookup_maps array with hb_array_t
Behdad Esfahbod 6843569d 2011-05-05T14:12:37 Replace fixed-size feature_maps array with hb_array_t
Behdad Esfahbod 44b0a4d2 2011-05-05T13:42:19 Replace fixed-size feature_infos array with hb_array_t
Behdad Esfahbod 2409d5f8 2011-04-21T17:14:28 Update Copyright headers
Behdad Esfahbod 62879eeb 2011-04-18T23:40:21 [API] Use ISO 15924 tags for hb_script_t This simplifies the code, reduces static data, and makes the design more extensible to future additions of new scripts.
Behdad Esfahbod 39dede9f 2010-10-13T15:54:06 Make sure boolean features always use value=1 Previously boolean features turned on the entire feature mask. This is wrong if feature is Alternate and user has provided values bigger than one. Though, I don't think other engines support such corner cases.
Behdad Esfahbod 852912fc 2010-10-13T15:34:50 Fix applying default-value for features Previously if a default global feature was overrided by a non-global user feature, we were not setting any default mask for the feature, essentially disabling the feature by default. Fix that.
Behdad Esfahbod 57ac0ecb 2010-10-12T17:07:02 Merge clearing masks and setting global masks
Behdad Esfahbod 49baa1f6 2010-10-12T16:50:36 Add hb_ot_complex_shaper_t stuff and start hooking Arabic shaper up
Behdad Esfahbod 895fb5d3 2010-10-12T16:00:21 Refactor, in a different direction
Behdad Esfahbod d2ba016c 2010-10-12T15:35:45 More refactoring
Behdad Esfahbod 36925f69 2010-10-08T20:20:32 Rename hb_mask_allocator_t to hb_ot_map_t hb_ot_plan_t may be a better name, donno.
Behdad Esfahbod 5a2b0b38 2010-10-08T20:14:57 Add hb-ot-map.cc