Commit Graph

3184 Commits

Author SHA1 Message Date
Behdad Esfahbod
6b03e3c724 Optimize fallback kerning
Patch from Jonathan Kew.  "These changes seem to yield a small but
just-about-measurable improvement with old fonts that lack GPOS
kerning."
2013-10-27 21:04:55 +01:00
Behdad Esfahbod
133eeba6a3 Minor
See:
https://github.com/prezi/harfbuzz-js/pull/1/files#r7032397
2013-10-27 00:24:59 +02:00
Behdad Esfahbod
a74f0de225 [indic] Fix CM2, really
Followup from 6e613f3365.
2013-10-24 11:46:33 +02:00
Behdad Esfahbod
6e613f3365 Fix "shift count >= width of type" issue 2013-10-23 23:34:13 +02:00
Behdad Esfahbod
ac8cd51191 Refactor 2013-10-18 19:33:09 +02:00
Behdad Esfahbod
0f3fe37fcc Comment 2013-10-18 19:14:22 +02:00
Behdad Esfahbod
ddce2d8df6 [indic] Improve positioning of post-base bells and whistles
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

Test with U+0CB0,U+200D,U+0CCD,U+0C95,U+0CBF and tunga.ttf.

Improves some scripts.  Improves Bengali too, but numbers
are up because we produce better results than Uniscribe for some
sequences now.

New numbers:
BENGALI: 353724 out of 354188 tests passed. 464 failed (0.131004%)
DEVANAGARI: 707307 out of 707394 tests passed. 87 failed (0.0122987%)
GUJARATI: 366349 out of 366457 tests passed. 108 failed (0.0294714%)
GURMUKHI: 60732 out of 60747 tests passed. 15 failed (0.0246926%)
KANNADA: 951190 out of 951913 tests passed. 723 failed (0.0759523%)
KHMER: 299070 out of 299124 tests passed. 54 failed (0.0180527%)
MALAYALAM: 1048140 out of 1048334 tests passed. 194 failed (0.0185056%)
ORIYA: 42320 out of 42329 tests passed. 9 failed (0.021262%)
SINHALA: 271662 out of 271847 tests passed. 185 failed (0.068053%)
TAMIL: 1091753 out of 1091754 tests passed. 1 failed (9.15957e-05%)
TELUGU: 970555 out of 970573 tests passed. 18 failed (0.00185457%)
2013-10-18 18:17:29 +02:00
Behdad Esfahbod
d5bd0590ae Zero marks by GDEF for Tibetan
See:
http://lists.freedesktop.org/archives/harfbuzz/2013-April/003101.html
2013-10-18 18:17:29 +02:00
Behdad Esfahbod
bf029281b1 Bug 65258 - [...] Mongolian with free variation selector 2013-10-18 18:17:29 +02:00
Behdad Esfahbod
0193649ce4 [otfallback] Don't shift down above-marks too much
This seems to generate much better, almost-perfect, positioning for
Arabic as well as Latin above marks.
2013-10-18 18:17:29 +02:00
Behdad Esfahbod
dba9580237 [otfallback] Never fallback-position a below-mark upwards
Test with WinXP times.ttf and U+05D9,U+05B5.
2013-10-18 18:17:29 +02:00
Behdad Esfahbod
8177da29ad Minor 2013-10-18 18:17:29 +02:00
Behdad Esfahbod
c16012e901 [indic] Add Javanese support!
Seems to be working just fine!
2013-10-18 18:17:29 +02:00
Behdad Esfahbod
755b44cce6 [ft] Round metrics instead of truncate
Lohit-Punjabi has a upem of 769!  We were losing one unit in our
code, and FreeType is losing another one...  Test with U+0A06.
Has an advance of 854 in the font.  We were producing 852.
Now we do 853, which is what FreeType is telling us.
2013-10-18 12:03:01 +02:00
Behdad Esfahbod
9a49351cc2 [indic] Swith pref logic to use _hb_glyph_info_substituted()
See comments from caveat!  Seems to work fine.

This is useful for Javanese which has an atomically encoded pre-base
reordering Ra which should only be reordered if it was substituted
by the pref feature.
2013-10-18 11:25:24 +02:00
Behdad Esfahbod
f175aa33c5 [indic] Fix compiler warnings 2013-10-18 11:25:24 +02:00
Behdad Esfahbod
8570273414 [otlayout] Add _hb_glyph_info_substituted()
Currently unused.
2013-10-18 11:25:24 +02:00
Behdad Esfahbod
a1f7b28561 [otlayout] Switch over from old is_a_ligature() to IS_LIGATED
Impact should be minimal and positive.
2013-10-18 11:25:24 +02:00
Behdad Esfahbod
09675a8115 [otlayout] Add HB_OT_LAYOUT_GLYPH_PROPS_LIGATED
Currently unused.
2013-10-18 11:25:24 +02:00
Behdad Esfahbod
05ad6b50ac [otlayout] Add HB_OT_LAYOUT_GLYPH_PROPS_SUBSTITUTED
Currently unused.
2013-10-18 11:21:15 +02:00
Behdad Esfahbod
101303dbf7 [otlayout] More shuffling around 2013-10-18 11:21:15 +02:00
Behdad Esfahbod
91689de260 [otlayout] Add _hb_glyph_info_set_glyph_props()
No functional change.
2013-10-18 11:21:15 +02:00
Behdad Esfahbod
a016174658 [otlayout] Simplify set_class() usage 2013-10-18 11:21:15 +02:00
Behdad Esfahbod
3ddf892b53 [otlayout] Renaming 2013-10-18 11:21:15 +02:00
Behdad Esfahbod
2e96d2c6ee [otlayout] More shuffling 2013-10-18 11:21:15 +02:00
Behdad Esfahbod
469524692b [otlayout] Code shuffling 2013-10-18 11:21:15 +02:00
Behdad Esfahbod
11fb16cb84 Use unsigned enums for mask types 2013-10-18 11:21:11 +02:00
Behdad Esfahbod
03058c3d1e [otlayout] Remove two unused HB_OT_LAYOUT_GLYPH_PROPS_* values 2013-10-17 20:55:34 +02:00
Behdad Esfahbod
941b699204 [otlayout] Remove unused HB_OT_LAYOUT_GLYPH_PROPS_UNCLASSIFIED 2013-10-17 20:47:33 +02:00
Behdad Esfahbod
8f9ec92dfc [indic] Adjust Javanese base algorithm 2013-10-17 19:52:47 +02:00
Behdad Esfahbod
49901862e3 [otlayout] Guard against use of ReverseChain through Context 2013-10-17 19:48:51 +02:00
Behdad Esfahbod
74f4bbf056 [indic] Towards supporting atomicly-encoded prebase-reorderings 2013-10-17 19:07:53 +02:00
Behdad Esfahbod
efed40b975 [indic] Minor refactoring of reph handling 2013-10-17 18:50:11 +02:00
Behdad Esfahbod
684fe59ff8 [indic] Minor refactoring of would_substitute() 2013-10-17 18:30:06 +02:00
Behdad Esfahbod
321df83fb4 Route Buginese through the SEA shaper
Both Indic and SEA seem to do it just fine, but SEA is much
simpler.
2013-10-17 18:16:14 +02:00
Behdad Esfahbod
b5a0f69e47 [indic] Pass zero-context=false to would_substitute for newer scripts
For scripts without an old/new spec distinction, use zero-context=false.
This changes behavior in Sinhala / Khmer, but doesn't seem to regress.
This will be useful and used in Javanese.
2013-10-17 18:04:23 +02:00
Behdad Esfahbod
c4e71ff36d [indic] Clean up Khmer and Sinhala base finding algorithm 2013-10-17 17:04:47 +02:00
Behdad Esfahbod
e10453e6fb [indic] Add BASE_POS_LAST_SINHALA
Previously we planted this into the mode used for Khmer.  There's not
really much in common between the two, so separate again.
2013-10-17 16:49:06 +02:00
Behdad Esfahbod
9ac6b01e0c [indic] Adjust Sinhala cluster merging under uniscribe
Similar to 190c8f2b60 but for
Sinhala.
2013-10-17 16:27:38 +02:00
Behdad Esfahbod
3c3df9cba1 [otlayout] Minor 2013-10-17 13:58:31 +02:00
Behdad Esfahbod
6cc136f753 [otlayout] Minor 2013-10-17 13:55:48 +02:00
Behdad Esfahbod
ba6ddc421e [otlayout] Increase MAX_CONTEXT_LENGTH
It's cheap.
2013-10-17 13:52:51 +02:00
Behdad Esfahbod
e714fe6d6a [otlayout] Simplify ligate_input()
Shouldn't change behavior at all, but is faster / more robust.
2013-10-17 13:49:51 +02:00
Behdad Esfahbod
6b2abdcd20 [indic] Improve clusters in presence of reph 2013-10-17 13:15:43 +02:00
Behdad Esfahbod
42d0f55cbc [indic] Apply calt,clig in the same stage as presentation features
Whic means these twp are applied per-syllable now.  Apparently
in some Khmer fonts the clig interacts with presentation features.

Test case: U+1781,U+17D2,U+1789,U+17BB,U+17C6 with Mondulkiri-R.ttf
should produce one big ligature.
2013-10-17 13:06:22 +02:00
Behdad Esfahbod
ae9a5834df [indic] Fix pref vs blwf interaction
If a glyph can be both blwf and pref, we were wrongly sorting it
in the post position instead of below position.
2013-10-17 12:24:55 +02:00
Behdad Esfahbod
c7dacac02c [indic] Don't apply blwf before base under old-spec mode
Test case: U+09AC,U+09CD,U+09A6 with Lohit-Bengali 2.5.3.
2013-10-17 12:20:46 +02:00
Behdad Esfahbod
da72042c52 [otlayout] Fix up recent Context matching change
Commit 6b65a76b40.  "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.
2013-10-17 12:02:34 +02:00
Behdad Esfahbod
1a7de1ba98 [indic] Improve Avagraha support in machine 2013-10-16 19:55:06 +02:00
Behdad Esfahbod
3756efaf4e [indic] Misc harmless fixes!
First, we were abusing OT_VD instead of OT_A.  Fix that
but moving OT_A in the grammar where it belongs (which
is different from what the spec says).

Also, only allow medial consonants after all other
consonants.  This doesn't affect any current character.

Finally, fix Halant attachment in presence of medial
consonants.  Again, this currently doesn't affect any
sequence.

I lied.  There's Gurmukhi U+0A75 which is Consonant_Medial.
Uniscribe allows one of those in each of these positions:
before matras, after matras and before syllable modifiers,
and after syllable modifiers!  We currently just allow
unlimited numbers of it, before matras.
2013-10-16 19:06:29 +02:00