Commit Graph

354 Commits

Author SHA1 Message Date
Behdad Esfahbod bac1dd6a0f [OTLayout] Refactor a bit more 2013-05-04 16:04:04 -04:00
Behdad Esfahbod 76ea563673 [OTLayout] Add note about collect_glyphs() and recursive lookups 2013-05-04 16:04:03 -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 9c5a9ee967 [OTLayout] Rename process() to dispatch() 2013-03-09 01:55:04 -05:00
Behdad Esfahbod 722e8b857e Fixup previous commit
Was not decreasing num_items.  Ouch!
2013-02-21 15:37:51 -05:00
Behdad Esfahbod 2b2a6e8944 [OTLayout] Correctly skip Default_Ignorable when match_func not set
When a match_func was not set on the matcher_t object (ie. from GPOS),
then the Default_Ignorables (including joiners) were never skipped.
This meant that they were not skipped as they should during GPOS
matching.  Fix that.

A few Indic numbers have "regressed": BENGALI and DEVANAGARI went
up from 290 and 58 respectively, but in both cases new results are
superior to Uniscribe, as they apply GPOS when we weren't (and
Uniscribe isn't) before.
BENGALI: 353686 out of 354188 tests passed. 502 failed (0.141733%)
DEVANAGARI: 707305 out of 707394 tests passed. 89 failed (0.0125814%)
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-21 15:07:03 -05:00
Behdad Esfahbod ff93ac8cb2 Minor 2013-02-21 14:51:40 -05:00
Behdad Esfahbod cb90b1bbe6 [OTLayout] Respect syllable boundaries for backtrack/lookahead matching
Originally we meant to match backtrack/lookahead across syllable
boundaries.  But a bug in the code meant that this was NOT done for
backtrack.  We "fixed" that in 2c7d0b6b80,
but that broke Myanmar shaping.

We now believe that for Indic-like shapers (which is where syllables are
used), all basic shaping forms should be fully contained within their
syllables, so now we limit backtrack/lookahead matching to the syllable
too.  Unbreaks Myanmar.
2013-02-15 07:02:08 -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 0b45479198 [OTLayout] Add fine-grained control over ZWJ matching
Not used yet.  Next commit...
2013-02-14 13:02:13 -05:00
Behdad Esfahbod 607feb7cff [OTLayout] Ignore default-ignorables when matching GSUB/GPOS
When matching lookups, be smart about default-ignorable characters.
In particular:

Do nothing specific about ZWNJ, but for the other default-ignorables:

If the lookup in question uses the ignorable character in a sequence,
then match it as we used to do.  However, if the sequence match will
fail because the default-ignorable blocked it, try skipping the
ignorable character and continue.

The most immediate thing it means is that if Lam-Alef forms a ligature,
then Lam-ZWJ-Alef will do to.  Finally!

One exception: when matching for GPOS, or for backtrack/lookahead of
GSUB, we ignore ZWNJ too.  That's the right thing to do.

It certainly is possible to build fonts that this feature will result
in undesirable glyphs, but it's hard to think of a real-world case
that that would happen.

This *does* break Indic shaping right now, since Indic Unicode has
specific rules for what ZWJ/ZWNJ mean, and skipping ZWJ is breaking
those rules.  That will be fixed in upcoming commits.
2013-02-14 12:57:50 -05:00
Behdad Esfahbod 4e51df73a3 [OTLayout] Remove unused function 2013-02-14 07:42:42 -05:00
Behdad Esfahbod 8820bb235b [OTLayout] Port apply_lookup to skippy_iter 2013-02-14 07:41:23 -05:00
Behdad Esfahbod dfca269f06 [OTLayout] Port ligate_input to skippy_iter 2013-02-14 07:41:23 -05:00
Behdad Esfahbod 7e53415c2d [OTLayout] Minor fix for apply_lookup()
Should NOT change behavior, since first glyph is a match.
2013-02-14 06:24:30 -05:00
Behdad Esfahbod 6880f7e19d [OTLayout] Make table type known to apply context 2013-02-13 12:17:25 -05:00
Behdad Esfahbod 2c7d0b6b80 [OTLayou] Unbreak backtrack matching
Was introduced by 28b9d502bb.
2013-02-13 12:10:08 -05:00
Behdad Esfahbod c074ebc466 [OTLayout] Minor refactoring 2013-02-13 11:22:42 -05:00
Behdad Esfahbod 407fc12466 [OTLayout] Remove bogus caching of glyph property 2013-02-13 11:13:06 -05:00
Behdad Esfahbod 54f7b4d9ec [OTLayout] Respect lookup-flags skipping over non-mark glyphs
Before, when matching ligatures, we never skipping over base / liga
glyphs even if that was what the LookupFlags asked for.

Fixed now.  We carefully reviewed all instances of this, and tested with
Amiri as well as some Indic scripts, and are confident that this should
NOT break anyone's fonts.  It's also how Uniscribe does it, from what
we can tell.
2013-02-11 13:27:17 -05:00
Behdad Esfahbod 9082efc4aa [OTLayout] s/mark_skipping/skipping/
In aticipation of upcoming changes.
2013-02-11 13:14:56 -05:00
Behdad Esfahbod 7b912c1936 Remove a few unnecessary const's
Apparently helps with MSVC compilation.
2013-01-04 01:25:27 -06:00
Behdad Esfahbod 11fba79ee9 [OTLayout] Fix various introspection issues with ClassDef's
As reported by Jonathan Kew.
2013-01-02 23:36:37 -06:00
Behdad Esfahbod 0beb66e3a6 Fix warnings 2012-12-05 19:14:28 -05:00
Behdad Esfahbod 130bb3f614 Rename VOID and void_t to have HarfBuzz prefix
Fixes build on Windows.  Ouch!
2012-12-05 16:49:47 -05:00
Behdad Esfahbod 4a350d0eb2 [OTLayout] Reuse context in collect_glyphs() recursion 2012-12-04 17:13:09 -05:00
Behdad Esfahbod 8303593ba1 Minor
Use pointers instead of references, in preparation for upcoming change.
2012-12-04 17:08:41 -05:00
Behdad Esfahbod 1bcfa06d11 [OTLayout] Don't recurse in collect_glyphs() for GPOS 2012-12-04 16:58:09 -05:00
Behdad Esfahbod e75943de80 [OTLayout] Fix collect_glyphs() recursion in ContextFormat3 2012-11-30 08:38:24 +02:00
Behdad Esfahbod f18ff5a84d [OTLayout] Return correct value from recursion
Commit 4c4e8f0e75 broke contextual lookups
by making the recurse() function always return false.

Reported by Khaled.  Test case: لا in Amiri.
2012-11-30 08:07:06 +02:00
Behdad Esfahbod 2dc1141d7d [OTLayout] Remove operator() from ClassDef 2012-11-24 19:16:34 -05:00
Behdad Esfahbod b67881b171 [OTLayout] Remove operator() from Coverage 2012-11-24 19:13:55 -05:00
Behdad Esfahbod 1ea375da44 [OTLayout] Only collect output glyphs during recursion in collect_glyphs() 2012-11-24 02:05:52 -05:00
Behdad Esfahbod f1b12781d2 [OTLayout] Implement ChainContext collect_glyphs()
All of collect_glyphs() complete and untested now.
2012-11-24 02:02:01 -05:00
Behdad Esfahbod 4c4e8f0e75 [OTLayout] Reuse apply context for recursion 2012-11-24 01:13:20 -05:00
Behdad Esfahbod 53a69f49e5 [OTLayout] Remove unused members 2012-11-24 01:03:05 -05:00
Behdad Esfahbod d0a5233785 [OTLayout] Implement Context::collect_glyphs() 2012-11-23 18:54:59 -05:00
Behdad Esfahbod 26514d51b6 [OTLayout] More collect_glyphs() 2012-11-23 18:13:48 -05:00
Behdad Esfahbod 9b34677f36 [OTLayout] Clean up closure() a bit 2012-11-23 17:55:40 -05:00
Behdad Esfahbod 2c53bd3c3e [OTLayout] Start porting sanitize() to process() 2012-11-23 17:29:05 -05:00
Behdad Esfahbod f48ec0e834 [OTLayout] Add process() tracing 2012-11-23 17:23:41 -05:00
Behdad Esfahbod ed2e135944 [OTLayout] More Extension templatizing 2012-11-23 17:10:40 -05:00
Behdad Esfahbod 7dddd4e72b [OTLayout] More templatizing Extension 2012-11-23 17:04:55 -05:00
Behdad Esfahbod 653eeb2645 Make Extension a template 2012-11-23 16:57:36 -05:00
Behdad Esfahbod a1733db1c6 [OTLayout] Start adding process() tracing 2012-11-23 16:40:04 -05:00
Behdad Esfahbod 73c18ae1b9 Cleanup 2012-11-23 15:34:11 -05:00
Behdad Esfahbod be218c688c Pass this object to trace macros 2012-11-23 15:32:14 -05:00
Behdad Esfahbod 902cc8aca0 [OTLayout] Start unbreaking tracing 2012-11-23 15:23:30 -05:00
Behdad Esfahbod dabe698fcb Minor 2012-11-23 14:21:35 -05:00
Behdad Esfahbod c779d82b2f Fix warnings 2012-11-23 14:09:21 -05:00
Behdad Esfahbod 81822528ef Minor 2012-11-23 13:27:16 -05:00
Behdad Esfahbod 1d67ef980f Move code around 2012-11-22 16:47:53 -05:00
Behdad Esfahbod ec35a72a44 [OTLayout] Port apply() operator to process() template 2012-11-22 16:33:46 -05:00
Behdad Esfahbod 2005fa5340 [OTLayout] Port would_apply() and get_coverage() to process() templates 2012-11-22 16:33:46 -05:00
Behdad Esfahbod 44fc237b53 [OTLayout] Port closure() to process() template 2012-11-22 16:33:46 -05:00
Behdad Esfahbod e8cfdd7fa8 Start implementing collect_glyphs() operation
Not functional yet.
2012-11-16 19:07:06 -08:00
Behdad Esfahbod 7d52e6601f Whitespace 2012-11-16 18:49:54 -08:00
Behdad Esfahbod 5a08ecf920 Implement hb_ot_layout_get_glyph_class() 2012-11-16 13:34:29 -08:00
Behdad Esfahbod 2616689d15 More tracing fixups 2012-10-29 21:51:56 -07:00
Behdad Esfahbod bc513add79 Add missing TRACE_RETURN 2012-10-29 19:03:55 -07:00
Behdad Esfahbod 2bd9fe3598 Refactor 2012-09-04 15:15:19 -04:00
Behdad Esfahbod a5ddd9e31c [OT] Really fix possible NULL dereference this time 2012-09-04 14:55:00 -04:00
Behdad Esfahbod f8fa2b5cf6 Fix possible NULL dereference
As reported by Kenichi Ishibashi.
2012-09-03 20:19:46 -04:00
Behdad Esfahbod 2fcbbdb41a Port Arabic fallback ligating to share code with GSUB
This will eventually allow us to skip marks, as well as (fallback)
attach marks to ligature components of fallback-shaped Arabic.
That would be pretty cool.  I kludged GDEF props in, so mark-skipping
works, but the produced ligature id/components will be cleared later
by substitute_start() et al.

Perhaps using a synthetic table for Arabic fallback shaping was a better
idea.  The current approach has way too many layering violations...
2012-08-29 14:01:22 -04:00
Behdad Esfahbod 5e399a8a45 Minor 2012-08-29 10:40:49 -04:00
Behdad Esfahbod a177d027d1 [GSUB] Move ligation logic over 2012-08-28 23:18:22 -04:00
Behdad Esfahbod 191fa885d9 [GSUB] Merge Ligature and context input matching
Looks better now...
2012-08-28 22:58:55 -04:00
Behdad Esfahbod 93814ca7dc Start converging Ligature and match_input 2012-08-28 22:39:10 -04:00
Behdad Esfahbod 7c8e844d92 Use namespace for OpenType tables
Avoids USHORT, SHORT, ULONG, LONG clashes with Windows API.
2012-08-28 17:57:49 -04:00
Behdad Esfahbod d9b204d3d2 [GSUB] Allow non-zero-context matching in would_apply()
To be used in the next patch.
2012-08-23 16:22:28 -04:00
Behdad Esfahbod 1f2bb172fe Revert "[Indic/GSUB] Ignore context when matching would_apply()"
This reverts commit 24dd4e5674.

Oops.  My bad.  The change _regressed_ Malayalam test suite, not
improved it.  I'll redo it, differentiating between old-spec and
new-spec cases.
2012-08-23 16:10:37 -04:00
Behdad Esfahbod 24dd4e5674 [Indic/GSUB] Ignore context when matching would_apply()
The MS Indic specs say "...all classifications are determined ... using
context-free substitutions."  However, testing shows that MS's Malayalam
shapers (both old and new), "match" even if there is no zero-context rule.
We follow.

Fixes below-base La (eg. Pa,H,La) with AnjaliNewLipi.ttf (old spec).
Moreover, test suite Malayalam failures are down to 312 from 875!  No
change in other scripts.

Current numbers:

BENGALI: 353996 out of 354285 tests passed. 289 failed (0.0815727%)
DEVANAGARI: 707339 out of 707394 tests passed. 55 failed (0.00777502%)
GUJARATI: 366489 out of 366506 tests passed. 17 failed (0.0046384%)
GURMUKHI: 60769 out of 60809 tests passed. 40 failed (0.0657797%)
KANNADA: 951086 out of 951913 tests passed. 827 failed (0.0868777%)
KHMER: 299106 out of 299124 tests passed. 18 failed (0.00601757%)
LAO: 53611 out of 53644 tests passed. 33 failed (0.0615167%)
MALAYALAM: 1047541 out of 1048416 tests passed. 875 failed (0.0834592%)
ORIYA: 42320 out of 42329 tests passed. 9 failed (0.021262%)
SINHALA: 271726 out of 271847 tests passed. 121 failed (0.0445103%)
TAMIL: 1091837 out of 1091837 tests passed. 0 failed (0%)
TELUGU: 970558 out of 970573 tests passed. 15 failed (0.00154548%)
TIBETAN: 208469 out of 208469 tests passed. 0 failed (0%)
2012-08-23 15:47:10 -04:00
Behdad Esfahbod 2eaf482b37 Revert "[GSUB/GPOS] Reject Context/ChainContext lookups with zero input"
This reverts commit 0981068b75.

I was confused.  Even if we access coverage[0] unconditionally, we don't
need bound checks since the array machinary already handles that.
2012-08-09 18:30:05 -04:00
Behdad Esfahbod 472f229a63 [GSUB] Generalize would_apply()
Fixes logic also, where before we were always matching if glyphs_len==1
and a ligature started with the glyph.
2012-08-07 22:25:24 -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 305246744e Minor 2012-08-02 08:08:04 -04:00
Behdad Esfahbod 22148b8c4a Use Coverage digests in would_apply 2012-08-02 03:51:51 -04:00
Behdad Esfahbod 6c459c8fef Minor 2012-08-02 03:45:53 -04:00
Behdad Esfahbod 1336ecdf8e [GSUB/GPOS] Use Coverage digests as gatekeeper
Gives me a good 10% speedup for the Devanagari test case.  Less so
for less lookup-intensive tests.

For the Devanagari test case, the false positive rate of the GSUB digest
is 4%.
2012-08-01 21:46:36 -04:00
Behdad Esfahbod c2e42c3db6 Minor 2012-07-30 19:54:50 -04:00
Behdad Esfahbod 03f67bc012 More refactoring glyph class access 2012-07-30 19:47:53 -04:00
Behdad Esfahbod 300c7307eb [OT] Don't crash if no GDEF available 2012-07-30 19:37:44 -04:00
Behdad Esfahbod 05bd1b6342 [GSUB/GPOS] Move glyph props matching around 2012-07-30 19:30:01 -04:00
Behdad Esfahbod 2fca1426ca [GSUB] Don't erase glyph classes if GDEF does not have glyph classes 2012-07-30 18:46:41 -04:00
Behdad Esfahbod 7fbbf86efe [GSUB] Minor 2012-07-30 18:36:42 -04:00
Behdad Esfahbod fe20c0f84f [GSUB] Fix mark component stuff when ligatures form ligatures!
See comments.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=437633
2012-07-30 00:00:59 -04:00
Behdad Esfahbod e6f7479fe3 [GSUB] Simplify would-apply 2012-07-28 18:34:58 -04:00
Behdad Esfahbod 0b99429ead [GSUB/GPOS] Add get_coverage() and use it to speed up main loop
And use it to speed up the hotspot by checking coverage directly in
the main loop, not 10 functions deep in.

Gives me a solid 20% boost with Indic test suite.  Less so for less
lookup-intensive scenarios.

Remove the "fast_path" hack from before.
2012-07-28 17:46:35 -04:00
Behdad Esfahbod 0981068b75 [GSUB/GPOS] Reject Context/ChainContext lookups with zero input 2012-07-28 17:01:59 -04:00
Behdad Esfahbod ec8d249469 Make data members of various OpenType structs protected instead of private
Should fix warnings generated when building with -Wunused-private-field.
Based on patch from Jonathan Kew.
2012-07-24 15:40:37 -04:00
Behdad Esfahbod 49c5ec5144 Minor refactoring 2012-07-23 20:14:13 -04:00
Behdad Esfahbod c3e6fdc379 [Indic] Improve check on ligatures
Only skip actual ligatures, not marks in-between ligature components.
2012-07-23 20:11:42 -04:00
Behdad Esfahbod d1af9e82e5 [GSUB/GPOS] Const correctness 2012-07-23 19:55:35 -04:00
Behdad Esfahbod 8932858123 Minor 2012-07-19 21:02:38 -04:00
Behdad Esfahbod e72b360ac6 Refactor / finish would_apply() operation
Untested.
2012-07-19 14:44:46 -04:00
Behdad Esfahbod 60da763dfa [GSUB/GDEF] Guess glyph classes after substitution only if no GDEF
Brings down Khmer failures with Daun Penh font from 36% to 20%.
2012-07-16 16:14:40 -04:00
Behdad Esfahbod 6d08c7f1b3 Revert "Towards templatizing common Lookup types"
This reverts commit 727135f3a9.

This is work-in-progress.  Didn't mean to push it out just yet.
2012-07-11 18:01:27 -04:00
Behdad Esfahbod 727135f3a9 Towards templatizing common Lookup types 2012-07-11 18:00:28 -04:00
Behdad Esfahbod b12e2549cb Minor 2012-06-09 03:05:20 -04:00
Behdad Esfahbod f19e0b0099 Match input before backtrack
Makes more sense, optimization-wise.
2012-06-09 02:26:57 -04:00
Behdad Esfahbod ce47613889 Micro-optimize
I know...
2012-06-09 01:43:15 -04:00
Behdad Esfahbod 7b84c536c1 In MarkBase attachment, only attach to first of a MultipleSubst sequence
This is apparently what Uniscribe does.  Test case is:

  SEEN FATHA TEH ALEF

with Arabic Typesetting.  Originally reported by Khaled Hosny.
2012-06-08 22:04:23 -04:00
Behdad Esfahbod e085fcf7ca Remove unused buffer->replace_glyphs_be16 2012-06-08 21:45:00 -04:00
Behdad Esfahbod 3ec77d6ae0 Don't use replace_glyphs_be for MultipleSubst 2012-06-08 21:44:06 -04:00
Behdad Esfahbod 4b7192125f Minor 2012-06-08 21:41:46 -04:00
Behdad Esfahbod 68b76121f8 Fix regressions introduced by sed. Ouch!
Introduced in 99c2695759.
Broken mark-mark and mark-ligature stuff.
2012-06-08 10:47:00 -04:00
Behdad Esfahbod 2a3d911fe0 Fix alignment-requirement missmatch
Detected by clang and lots of cmdline options.
2012-06-07 17:31:46 -04:00
Behdad Esfahbod ed2f1363a3 Fix substitution glyph class propagation
The old code was doing nothing.

Still got to find an example font+string that makes this matter, but
need this for fixing synthetic GDEF anyway.
2012-05-22 22:12:22 -04:00
Behdad Esfahbod 99c2695759 Add accessort to buffer for current info, current pos, and prev info 2012-05-13 15:45:18 +02:00
Behdad Esfahbod 6736f3c5b0 Minor 2012-05-13 15:21:06 +02:00
Behdad Esfahbod 5df809b655 [GSUB/GPOS] Remove context_length
The spec doesn't say contextual matching should be done this way,
and AOTS doesn't do it either.  It was inherited from old HarfBuzz.
Remove it.
2012-05-13 15:17:51 +02:00
Behdad Esfahbod 28b9d502bb Minor 2012-05-13 15:04:00 +02:00
Behdad Esfahbod 5f131d3226 [GSUB/GPOS/Indic] Apply GSUB/GPOS within syllables only
This does not apply to the context matchings.

This regresses tests right now.  And we are not sure whether this is
the right thing to do for GPOS.  But we'll figure out.
2012-05-11 17:29:40 +02:00
Behdad Esfahbod 8fd83aaf6e [GSUB/GPOS] Fix wrong buffer access in backward skippy mask matching 2012-05-11 17:18:37 +02:00
Behdad Esfahbod 203d71069c [GSUB/GPOS] Check all glyph masks when matching input 2012-05-11 16:01:44 +02:00
Behdad Esfahbod cee7187447 [Indic] Move syllable tracking from Indic to generic layer
This is to incorporate it into GSUB/GPOS processing.
2012-05-11 11:41:39 +02:00
Behdad Esfahbod 55fe2cf79b Make APPLY debug output print current index and codepoint
Yay!
2012-05-11 03:56:33 +02:00
Behdad Esfahbod 98619ce4fa Minor 2012-05-11 02:34:06 +02:00
Behdad Esfahbod acea183e98 Add return annotation for APPLY 2012-05-11 02:33:11 +02:00
Behdad Esfahbod 0ab8c86217 Annotate SANITIZE return values
More to come, for APPLY, CLOSURE, etc.
2012-05-11 02:11:52 +02:00
Behdad Esfahbod 6f45538017 More massaging trace messaging 2012-05-10 23:24:43 +02:00
Behdad Esfahbod 208109703c Better trace message support infrastructure
We have varargs in the trace interface now.  To be used soon...
2012-05-10 23:06:58 +02:00
Behdad Esfahbod a9844d41c6 Combine lig_id and lig_comp into one byte, to free up one for Indic 2012-05-09 17:53:13 +02:00
Behdad Esfahbod 5caece67ab Make closure() return void 2012-04-23 23:03:12 -04:00
Behdad Esfahbod 5b93e8d94f Update copyright headers 2012-04-23 22:26:27 -04:00
Behdad Esfahbod 6a9be5bd35 Rename hb_glyph_map_t to hb_set_t 2012-04-23 22:23:17 -04:00
Behdad Esfahbod 31081f7390 Implement closure() for Context and ChainContext lookups 2012-04-23 16:54:58 -04:00
Behdad Esfahbod 3e32cd9570 Minor 2012-04-23 13:22:50 -04:00
Behdad Esfahbod 650ac00da3 Minor refactoring 2012-04-23 13:17:09 -04:00
Behdad Esfahbod f94b0aa646 Add "closure" operation stubs to GSUB
Filling in.
2012-04-23 13:04:38 -04:00
Behdad Esfahbod 41ae674f68 Don't create hb_apply_context_t per glyph!
I couldn't measure significant performance gains out of this; maybe
about 5% (with one million Malayalam strings).  Still, not bad.
But reminds me that optimizing this codebase without profiling first
is simply not going to work.  Oh well...
2012-04-11 17:13:50 -04:00
Behdad Esfahbod 03408ce73d Fix more possible buffer overruns
I have this function, but can't clean up it to my satisfaction.
2012-01-18 21:28:34 -05:00
Behdad Esfahbod 7d479900cd Refactor the two remaining uses of _hb_ot_layout_skip_mark() 2012-01-18 21:19:32 -05:00
Behdad Esfahbod 506ffeb8e7 Further mark skippy fixes from Jonathan Kew
We should be in good shape now.
2012-01-18 16:07:53 -05:00
Behdad Esfahbod a4a48fe6d4 Fix mark skipping regression
Ouch!
2012-01-17 18:08:41 -05:00
Behdad Esfahbod 4ab9731154 Refactor mark skipping 2012-01-16 22:20:31 -05:00
Behdad Esfahbod 370f03e9c6 Minor 2012-01-16 17:06:59 -05:00
Behdad Esfahbod 4d3aeb8cb2 [GSUB/GPOS] Fix mark skip indexing issues
Mozilla bug 701637 and 714067 combined.

Patch from Jonathan Kew.
2012-01-16 16:43:26 -05:00
Behdad Esfahbod 7a750ac33e Rename table files from eg maxp-private.hh to maxp-table.hh 2011-08-17 14:19:59 +02: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 cc06c243d8 Streamline debugging infrastructure even more 2011-07-25 20:34:17 -04:00
Behdad Esfahbod 651e8dd79e Start cleaning up buffer var allocation
I've messed up a lot of stuff recently, different parts of the
shaping process are stumbling on eachother's toes because
manually tracking what's in which buffer var is hard.  I'm
going to add some internal API to track those such that mistakes
are discovered as soon as they are introduced.
2011-07-25 14:54:08 -04:00
Behdad Esfahbod 18c42850c9 Shrink space used for ligature ids
This frees 16bits in the glyph_info struct during the ot_layout process.
We can use the freed space in the shapers now.
2011-07-25 00:43:39 -04:00
Behdad Esfahbod d8787493c9 Minor 2011-07-25 00:36:01 -04:00
Behdad Esfahbod 468e9cb25c Move buffer methods into the object 2011-07-22 14:49:14 -04:00
Behdad Esfahbod 744970af4d [API] Add support for vertical text
Design not final yet, and in fact I'm going to change it immediately,
but this is an standalone change for itself.
2011-05-17 17:12:34 -04:00
Behdad Esfahbod abcfe9b59b Remove hb_ot_layout_context_t, simplify code 2011-05-11 00:02:02 -04:00
Behdad Esfahbod 2409d5f8d7 Update Copyright headers 2011-04-21 17:14:28 -04:00
Behdad Esfahbod cc1a8a938b Fix ChanContext backtrack matching with GPOS
Reported on mailing list by Keith Stribley and Khaled Hosny.
2011-01-06 14:58:52 -05:00
Behdad Esfahbod 7eb875118d Mozilla Bug 618592 - freeze on typekit
Fix apply_lookup() for zero-input broken fonts.
2010-12-13 14:13:35 -05:00