Commit Graph

76 Commits

Author SHA1 Message Date
Behdad Esfahbod f9abbf83b6 Fix fallout from 975bdd5ef5
Ouch!
2018-06-02 15:46:08 -07:00
Behdad Esfahbod 6c2227640b Add HB_DISALLOW_COPY_AND_ASSIGN 2018-05-25 16:21:27 -07:00
Behdad Esfahbod 5c3112aec8 s/hb_prealloced_array_t/hb_vector_t/g
Part of https://github.com/harfbuzz/harfbuzz/issues/1017
2018-05-01 19:07:04 -04:00
Behdad Esfahbod a60ba7964e s/finish/fini
For consistency.
2018-05-01 19:01:25 -04:00
Behdad Esfahbod c479a59988 [subset] Assemble font 2018-02-07 21:26:04 -06:00
Behdad Esfahbod 12757b6929 Misc warning fixes
Fixes https://github.com/harfbuzz/harfbuzz/issues/712
2018-01-26 18:14:05 -08:00
Behdad Esfahbod 0712e915b4 Remove hb_compare_func_t 2017-10-29 17:01:47 -06:00
Behdad Esfahbod db5f7ef189 Inline another bsearch() 2017-10-15 16:28:34 -03:00
Behdad Esfahbod dbdbfe3d7b Use nullptr instead of NULL 2017-10-15 12:11:08 +02:00
Behdad Esfahbod cdf1fd0627 [indic] Add infrastructure to disable ZWNJ-skipping in context-matching
Not used yet.
2017-07-14 12:43:34 +01:00
jfkthame 740fdbcd0e avoid UBSan warning in get_stage_lookups (#450)
See https://bugzilla.mozilla.org/show_bug.cgi?id=1336600
2017-04-03 13:22:39 +02:00
Behdad Esfahbod 72ada4f0c6 [GX] Hook up feature variations
Shape-plan caching is not implemented.
2016-12-16 19:06:26 -06:00
Behdad Esfahbod bde5e3959c Move add_lookups from map to map-builder
In prep for more changes.
2016-12-16 19:06:26 -06:00
Behdad Esfahbod 255df68012 Fix undefined behavior in cmp function
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=93274
2015-12-07 10:34:47 +01: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
Behdad Esfahbod aa7044de0c Generalize flags types 2015-11-04 16:25:57 -08:00
Behdad Esfahbod 0f98fe88f4 [ot] Search globally for 'vert' feature if not found in specified script/lang
Fixes https://github.com/behdad/harfbuzz/issues/63
2015-07-23 11:52:11 +01:00
Behdad Esfahbod 7627100f42 Mark unsigned integer literals with the u suffix
Simplifies hb_in_range() calls as the type can be inferred.
The rest is obsessiveness, I admit.
2014-07-11 16:22:13 -04:00
Behdad Esfahbod 6faff8e413 Add static storage classifier to inline functions
Before we were just relying on the compiler inlining them and not
leaving a trace in our public API.  Try to fix.  Hopefully not
breaking anyone's build.
2014-04-28 14:30:44 -07:00
Behdad Esfahbod a7e8bbb080 Minor fraction mask setting improvement 2013-12-22 19:33:35 -05:00
Behdad Esfahbod 014f369ec9 Add XXX note 2013-12-22 16:15:30 -05:00
Behdad Esfahbod bac1dd6a0f [OTLayout] Refactor a bit more 2013-05-04 16:04:04 -04:00
Behdad Esfahbod 3276c354da [OTLayout] Minor refactoring 2013-05-02 15:39:15 -04:00
Behdad Esfahbod ea86efa486 Minor 2013-05-02 15:39:15 -04:00
Behdad Esfahbod 2265be0a62 Minor 2013-05-02 15:39:15 -04:00
Behdad Esfahbod 893f57b32f Minor renaming 2013-04-21 15:23:21 -04:00
Behdad Esfahbod 8ac3c9c0b6 Rename "pause" to "stage"
The compile() function is starting to become illegible...
2013-04-21 15:19:38 -04:00
Behdad Esfahbod 06a44e8593 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...
2013-04-21 15:13:08 -04:00
Behdad Esfahbod a8cf7b43fa [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%)
2013-03-19 06:22:06 -04:00
Behdad Esfahbod 41732f1fe3 [Indic] Help compiler put indic_features table in .rodata
The overridden "or" operator was preventing the flag expression from
being const, and putting the table in .data instead or .rodata.
2013-02-27 20:40:54 -05:00
Behdad Esfahbod cfc507c543 [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%)
2013-02-14 13:10:54 -05:00
Behdad Esfahbod ec5448667b Add hb_ot_map_feature_flags_t
Code cleanup.  No (intended) functional change.
2013-02-14 12:53:57 -05:00
Behdad Esfahbod e7ffcfafb1 Clean-up add_bool_feature 2013-02-14 11:58:13 -05:00
Behdad Esfahbod f30641038b 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.)
2012-11-15 18:48:10 -08:00
Behdad Esfahbod 851784f837 Improve shaper selection 2012-11-14 17:53:09 -08:00
Behdad Esfahbod 5ab3855f81 Choose shaper based on chosen OT script tag
For Arabic and Indic shapers, if the font doesn't have a script system
for the script, use default shaper.

Make an exception for Arabic script since we have fallback logic for
that one.
2012-11-12 18:27:42 -08:00
Behdad Esfahbod 6fddf2d739 Refactoring ot-map building to make chosen script available earlier 2012-11-12 18:03:07 -08:00
Behdad Esfahbod fabd3113a9 [OT] Port Arabic fallback shaping to synthetic GSUB
All of init/medi/fina/isol and rlig implemented.

Let there be dragons... ⻯
2012-09-06 00:51:44 -04:00
Behdad Esfahbod 87b75d0a4a [OT] Allow adding features with fallback implementation 2012-09-04 23:06:38 -04:00
Behdad Esfahbod 8bb5deba96 [OT] Pipe shape_plan down to pause_callbacks 2012-08-02 10:07:58 -04:00
Behdad Esfahbod 3e38c0f288 More massaging 2012-08-02 09:44:18 -04:00
Behdad Esfahbod afbcc24be0 [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.
2012-08-02 08:36:40 -04:00
Behdad Esfahbod 610e5e8f71 [Indic] Streamline feature would_apply()
Comes with some 10% speedup for Devanagari even!
2012-08-02 05:41:18 -04:00
Behdad Esfahbod f860366456 [OT] Gain back some lost speed 2012-07-30 03:16:38 -04:00
Behdad Esfahbod f055442716 [Indic] Lookup consonant position in the font
Fixes most failures of Oriya, and improves others a bit.
2012-07-19 16:20:21 -04:00
Behdad Esfahbod 1827dc208c Add hb_ot_shape_glyphs_closure()
Experimental API for now.
2012-04-24 16:56:37 -04:00
Behdad Esfahbod 6a9be5bd35 Rename hb_glyph_map_t to hb_set_t 2012-04-23 22:23:17 -04:00
Behdad Esfahbod d2984a241e Add map->substitute_closure() 2012-04-23 17:21:14 -04:00
Behdad Esfahbod c605bbbb6d Remove C++ guards from source files
Where causing issues for people with MSVC.
2011-08-04 20:00:53 -04:00
Behdad Esfahbod 8336186a52 Zero map objects 2011-08-04 19:49:05 -04:00