Commit Graph

2579 Commits

Author SHA1 Message Date
Behdad Esfahbod 57542d7f41 Minor 2013-02-21 15:55:49 -05:00
Behdad Esfahbod d46606e119 Port TrueType-kerning to use skippy iterator
It skips joiners and default ignorables now.  Skips marks too, but only
if there is proper GDEF classes for marks.
2013-02-21 15:55:49 -05:00
Behdad Esfahbod 722e8b857e Fixup previous commit
Was not decreasing num_items.  Ouch!
2013-02-21 15:37:51 -05:00
Behdad Esfahbod ba87b8fc89 Move code around 2013-02-21 15:23:39 -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 b1f4407591 [SEA] Fix order of pre-base reordering Ra and left matras
The code was confused because it was expecting left matra to have
POS_PRE_M, like we do in the Myanmar shaper, but that is not what
we were doing in this shaper.  Rewrite to rely on category only.

Test case: U+AA06,U+AA34,U+AA2F
2013-02-17 12:12:37 -05:00
Behdad Esfahbod 99fa9ea020 Minor 2013-02-15 11:47:24 -05:00
Behdad Esfahbod 27589620ba [OTLayout] Remove unused code 2013-02-15 11:47:09 -05:00
Behdad Esfahbod c2a1cdc4c4 [Arabic] Fix shaping of left-joining 'Phags-Pa U+A872
This is the first character in Unicode to have Arabic left-joining
behavior.  Update the machine to recognize that.

Test case: U+A840,U+A872,U+A840.
2013-02-15 09:27:02 -05:00
Behdad Esfahbod c462b32dcb Disable automatic segment properties guessing
Before, if one called hb_shape() without setting script, language, and
direction on the buffer, hb_shape() was calling
hb_buffer_guess_segment_properties() on the user's behalf to guess
these.

This is very dangerous, since any serious user of HarfBuzz must set
these properly (specially important is direction).  So now, we don't
guess properties by default.  People not setting direction will get
an abort() now.  If the old behavior is desired (fragile, good for
simple testing only), users can call
hb_buffer_guess_segment_properties() on the buffer just before calling
hb_shape().
2013-02-15 07:51:47 -05:00
Behdad Esfahbod 7abddbb47a Add assertions for a couple programmer errors 2013-02-15 07:46:57 -05:00
Behdad Esfahbod 038c98f686 Allow disabling of TrueType kerning
Responds to the same feature tag that GPOS kerning does:
'kern' for horizontal and 'vkrn' for vertical.
2013-02-15 07:41:07 -05:00
Behdad Esfahbod 398238a252 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.
2013-02-15 07:40:10 -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 ee9c3a17d0 Minor refactoring 2013-02-15 06:22:52 -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 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 e7562f53fe Fix compile warnings for ragel-generated machines 2013-02-14 11:58:13 -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 6b1e3502e2 Remember ZWNJ
To be used in upcoming changes.
2013-02-13 11:02:54 -05:00
Behdad Esfahbod 1f91c39677 Indent 2013-02-13 09:38:40 -05:00
Behdad Esfahbod a0cb9f33ee [Indic] Improve base finding in final_reordering
Fixes 5 Malayalam failures!

MALAYALAM: 1048016 out of 1048334 tests passed. 318 failed (0.0303338%)
2013-02-13 09:26:55 -05:00
Behdad Esfahbod f22b7e7778 [Indic] Track base position when reordering things
Ouch, how did things ever work without this?!  The added test that has a
dot-reph as well as a pre-base reordering Ra perfectly demonstrates the
bug (tested with Nirmala font from Win8 for example).  Testing suggests
that Win8 shaper has the *exact* same bug / behavior that we used to
have.  Odd.
2013-02-13 07:32:46 -05:00
Behdad Esfahbod bc11de144c [SEA] Don't zero any mark advances
Keep the logic simple, easier to explain to font developers.
2013-02-13 05:59:06 -05:00
Behdad Esfahbod 0291a65286 Further adjust mark advance zeroing
This is a followup to 568000274c.
Looks like in the Latin shaper, Uniscribe zeroes all Unicode NSM
advances *after* GPOS, not before.  Match that.

Can be tested using DejaVu Sans Mono, since that font has GPOS
rules to zero the mark advances on its own.
2013-02-13 05:57:24 -05:00
Behdad Esfahbod 85c51ec2e1 [Indic] Fix Eyelash Ra with old Devanagari spec 2013-02-12 18:17:39 -05:00
Behdad Esfahbod 63e48bc33b [Indic] Apply 'blwf' before 'half'
This reverts 167b625d98.  It didn't
matter before, but that's going to change with next commit.
2013-02-12 18:02:07 -05:00
Behdad Esfahbod 70d6565711 [Indic] Apply 'vatu' before 'cjct'
This essentially reverts 1d6846db9e,
but that commit is from way back when.  We should be better
following the spec order now again.
2013-02-12 18:02:07 -05:00
Behdad Esfahbod f9b660534c [Myanmar] Use master Indic table for syllable data 2013-02-12 16:13:56 -05:00
Behdad Esfahbod a6c1e040e5 Improve check for Windows platforms
Instead of checking for compiler, check for platform.
2013-02-12 15:31:58 -05:00
Behdad Esfahbod 9e1f80ab3e [SEA] Treat Consonant_Final like Consonant_Medial 2013-02-12 15:28:21 -05:00
Behdad Esfahbod bab02d339f Rename HB_OT_INDIC_OPTIONS env var to HB_OPTIONS
The Myanmar shaper now respects the uniscribe-bug-compatibility
option too.
2013-02-12 15:26:45 -05:00
Behdad Esfahbod 3a83d33ec0 Add South-East Asian shaper
Handles Tai Tham, Cham, and New Tai Lue for now.
2013-02-12 12:14:10 -05:00
Behdad Esfahbod 5676d5d527 [Indic] Make sure New Tai Lue works! 2013-02-12 10:31:14 -05:00
Behdad Esfahbod 568000274c Adjust mark advance-width zeroing logic for Myanmar
Before, we were zeroing advance width of attached marks for
non-Indic scripts, and not doing it for Indic.

We have now three different behaviors, which seem to better
reflect what Uniscribe is doing:

  - For Indic, no explicit zeroing happens whatsoever, which
    is the same as before,

  - For Myanmar, zero advance width of glyphs marked as marks
    *in GDEF*, and do that *before* applying GPOS.  This seems
    to be what the new Win8 Myanmar shaper does,

  - For everything else, zero advance width of glyphs that are
    from General_Category=Mn Unicode characters, and do so
    before applying GPOS.  This seems to be what Uniscribe does
    for Latin at least.

With these changes, positioning of all tests matches for Myanmar,
except for the glitch in Uniscribe not applying 'mark'.  See preivous
commit.
2013-02-12 09:44:57 -05:00
Behdad Esfahbod 99749ca8e0 [Myanmar] Add note re Uniscribe NOT applying 'mark' 2013-02-12 09:44:35 -05:00
Behdad Esfahbod b842780138 Minor 2013-02-11 17:02:17 -05:00
Behdad Esfahbod 419c933ed1 [Myanmar] Fix handling of Punctuation and Symbol types
Testing with "clusters" now on par with testing without them.  15
failures both.
2013-02-11 16:16:16 -05:00
Behdad Esfahbod 0572c1410a [Myanmar] Fixup handling of joiners and GB characters 2013-02-11 16:16:07 -05:00
Behdad Esfahbod 1c8654ead4 [Myanmar] Prevent reordering between Asat and Dot below
Implemented as a hack for now.  Myanmar failures down from 23 to 15.

MYANMAR: 1123868 out of 1123883 tests passed. 15 failed (0.00133466%)

The remaining 15 cases are all where the syllable is wrong according to
the OpenType spec.  We insert dottedcircle.  Uniscribe fails to do that,
but it also fails to reorder the prebase-reordering medial-Ra.  So it
gets it wrong.
2013-02-11 14:28:59 -05:00
Behdad Esfahbod 98628cac9f Add Win8-style Myanmar shaper
Myanmar failures down from 51% to 0.00204648%!

MYANMAR: 1123860 out of 1123883 tests passed. 23 failed (0.00204648%)
2013-02-11 14:20:08 -05:00
Behdad Esfahbod 1df5644958 Minor 2013-02-11 14:18:09 -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 9621e0ba29 [Indic] Fix bug introduced in 8b217f5ac5
Was breaking reph formation logic when the Ra is the only consonant.
Devanagari regression fixed.  Down to 57 failures again.  Ouch.
2013-02-11 12:59:36 -05:00
Behdad Esfahbod 6e74c64211 Improve normalization heuristic
Before, for most scripts, we were not trying to recompose two characters
if the second one had ccc=0.  That fails for Myanmar where U+1026
decomposes to U+1025,U+102E, both of which have ccc=0.  However, we do
want to try to recompose those.  We now check whether the second is a
mark, using general category instead.

At the same time, remove optimization that was conflicting with this.

[Let the Ngapi hackfest begin!]
2013-02-11 12:59:00 -05:00
Behdad Esfahbod adff377815 Revert "[Indic] Import ragel-generated Indic machine in git"
This reverts commit fab7a71f11.

Conflicts:
	src/hb-ot-shape-complex-indic-machine.hh

Keeping that generated file in-tree causes problems with processes like
tinderbox  that automatically fetch and build harfbuzz.  It's harder to
bootstrap harfbuzz now (as was previously), but I'm willing to give this
another chance and see how it goes.
2013-02-06 23:43:27 -05:00
Behdad Esfahbod 9de5f98f36 Bug 60035 - intermittent make install failure on hb-version.h 2013-02-04 23:28:22 -05:00
Behdad Esfahbod 6c1e8b614c Bug 59637 - check-exported-symbols.sh & check-internal-symbols.sh fail on mips/mipsel 2013-02-04 23:24:16 -05:00
Behdad Esfahbod bafdf3d983 Merge check-internal-symbols.sh and check-exported-symbols.sh 2013-02-04 23:06:50 -05:00
Behdad Esfahbod e9171af55c Bug 60053 - hb-common.cc:181:6: warning: ‘void free_langs()’ defined but not used 2013-01-29 22:45:00 -05:00
Behdad Esfahbod eb45c0a2fb Minor 2013-01-16 22:07:50 -06:00
Behdad Esfahbod 52c8d1226f Minor 2013-01-14 13:51:46 -06:00
Behdad Esfahbod f88d3bd7e4 Fix build with Sun compiler 2013-01-14 00:33:58 -06:00
Behdad Esfahbod 08b29c0809 Revert "Minor"
This reverts commit 0a49235701.

Enables code on more compilers.
2013-01-14 00:32:12 -06:00
Behdad Esfahbod e78463211e Fix linking with non-gcc compilers 2013-01-14 00:27:21 -06:00
Behdad Esfahbod de649f07f1 Fix residuals from fontconfig changes 2013-01-14 00:26:43 -06:00
Behdad Esfahbod 2dcb333f52 Add atomic ops for Solaris
Based on fontconfig patch from Raimund Steger.
2013-01-10 01:18:10 -06:00
Behdad Esfahbod 69fd6e157c Fix crasher during multi-thread shaper data creation
Sample crash:

0  _hb_graphite2_shaper_face_data_destroy (data=0xffffffffffffffff)
    at ../../src/hb-graphite2.cc:129
1  0x00007ffff4271d7d in hb_graphite2_shaper_face_data_ensure (
    face=<optimized out>) at ../../src/hb-shaper-list.hh:35
2  hb_shape_plan_plan (shaper_list=<optimized out>, num_user_features=0,
    user_features=0x0, shape_plan=0xf7b490) at ../../src/hb-shaper-list.hh:35
3  hb_shape_plan_create (face=<optimized out>, props=<optimized out>,
    user_features=0x0, num_user_features=0, shaper_list=<optimized out>)
    at ../../src/hb-shape-plan.cc:108
4  0x00007ffff4272c93 in hb_shape_plan_create_cached (face=0x10cf2b0,
    props=0x11980d8, user_features=0x0, num_user_features=<optimized out>,
    shaper_list=0x0) at ../../src/hb-shape-plan.cc:283
2013-01-10 00:03:36 -06:00
Behdad Esfahbod ecd454b3cd [Indic] In old-spec shaping, don't move viramas around if seq ends with one
For example: u0c9a u0ccd u0c9a u0ccd with Lohit.  See:

https://bugs.freedesktop.org/show_bug.cgi?id=59118
2013-01-08 18:09:46 -06:00
Behdad Esfahbod e95e031b56 [GPOS] If an Anchor offset is NULL, return false
If in a MarkPos table, a base has no anchor for a particular mark class,
return NULL such that the subsequent subtables get a chance at it.

Test case:
hb-shape ./EBGaramond12-Regular.otf ἂ --features="ss20","smcp"
2013-01-08 16:17:06 -06:00
Behdad Esfahbod 1172dc7362 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.
2013-01-07 16:46:37 -06: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 f0c82410db [OTLayout] Always collect default language system in collect_lookups
Not sure if this is the most desired behavior.  It's the most easily
defined though.
2013-01-03 00:07:16 -06:00
Behdad Esfahbod 15e9e4e1dd [OTLayout] Fix feature iteration in collect_lookups
Previous logic was just wrong.
2013-01-03 00:04:40 -06:00
Behdad Esfahbod 733e8c0d7b [OTLayout] Whitespace 2013-01-03 00:00:23 -06:00
Behdad Esfahbod d37ae38047 [OTLayout] Handle required_feature_index in collect_lookups 2013-01-02 23:57:36 -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 7b1b720a8d Protect sets in-error from further modication
Fixes test-set.c
2013-01-02 23:02:59 -06:00
Behdad Esfahbod 8165f2765b [tests] Start adding tests for hb-set.h
Fails now.  Fixing.
2013-01-02 22:50:36 -06:00
Behdad Esfahbod 11d2956553 Minor 2013-01-02 17:41:27 -06:00
Behdad Esfahbod 596740db04 [Indic] Insert dottedcircle after a lone Malayalam dot-reph 2012-12-21 19:41:04 -05:00
Behdad Esfahbod 6f69fa283e Minor 2012-12-21 16:51:15 -05:00
Behdad Esfahbod f4abcbfc62 Minor 2012-12-21 16:48:51 -05:00
Behdad Esfahbod 8b217f5ac5 [Indic] Reorder Malayalam dot-reph to after base
Test sequence is simple: U+0D4E,U+0D15.  The doth-reph should be
reordered to after the Ka.

https://bugzilla.redhat.com/show_bug.cgi?id=799565
2012-12-21 15:49:26 -05:00
Behdad Esfahbod 742c4ee97e Minor 2012-12-21 15:35:03 -05:00
Behdad Esfahbod 044d385276 Bug 58498 - Tests fail with gold linker on ARM 2012-12-19 13:00:16 -05:00
Behdad Esfahbod b68b86daf1 Use C++ linker if ICU is disabled
Bug 54948 - Undefined symbols: "operator delete(void*)" "operator
new(unsigned long)" "___cxa_pure_virtual"
2012-12-18 20:39:40 -05:00
Behdad Esfahbod 1ffd23cb47 [OTLayout] Limit alternate-location FeatureParams to 'size' feature 2012-12-17 23:29:15 -05:00
Behdad Esfahbod efe252e600 [OTLayout] Fix 'size' featureParams implementation
Looks at alternate location now.
2012-12-17 23:25:57 -05:00
Behdad Esfahbod e77b442574 [OTLayout] Fix tracing 2012-12-17 18:42:59 -05:00
Behdad Esfahbod 9b54562d63 [OTLayout] Towards correct FeatureParams handling 2012-12-17 13:55:36 -05:00
Behdad Esfahbod 87e43b7f2b [OTLayout] Wire tag and list start all the way to Feature
To fix FeatureParam issues.  No actual fix yet, just plumbing.
2012-12-14 17:48:23 -05:00
Behdad Esfahbod 85bc44b90a [OTLayout] More 'size' feature sanity checking
We still don't look for the old incorrect place of the featureParams.
I'll wait till someone actually complains about it...
2012-12-12 11:38:49 -05:00
Behdad Esfahbod 0bae50a36f [OTLayout] Add FeatureParamsCharacterVariants struct
No API yet.
2012-12-11 16:29:24 -05:00
Behdad Esfahbod bd61bc13ea [OTLayout] Add UINT24 type 2012-12-11 16:01:07 -05:00
Behdad Esfahbod 9cf7f9d4f6 Make test-size-params write size in points 2012-12-11 14:31:13 -05:00
Behdad Esfahbod 372fe2b67b [OTLayout] Make hb_ot_layout_get_size_params() do some checks 2012-12-11 14:30:57 -05:00
Behdad Esfahbod 875a5cbc9c [OTLayout] Change hb_ot_layout_get_params() API
And add implementation for StylisticSet UINameID.  No API yet.
2012-12-11 14:17:01 -05:00
Behdad Esfahbod 0e9f0f3e5f Fix atomic ops on iOS
Patch from John Ralls.
2012-12-10 15:25:21 -05:00
Behdad Esfahbod 5f9569c139 Make older MSVC happy 2012-12-10 13:39:06 -05:00
Behdad Esfahbod 071d5b831e Work around missing OSAtomicCompareAndSwapPtrBarrier() on OS X 10.4
Not sure how to handle iOS.
2012-12-10 00:57:00 -05:00
Behdad Esfahbod e923e6487b [coretext] Fixed typo
Oops.  Thanks Khaled for catching this.
2012-12-09 19:39:40 -05:00
Behdad Esfahbod 9a8395824b [coretext] Add hb_coretext_face_get_cg_font()
Not sure if it's useful, but it was missing.
2012-12-09 18:47:36 -05:00
Behdad Esfahbod 8611235688 [coretext] Remove hack around GlyphID
We not namespace our types, so the hack is not needed anymore.
2012-12-09 18:47:09 -05:00
Behdad Esfahbod 8e58459aeb [graphite2] "Update to new API"
Part of patch from Martin Hosken.  I believe he knows what he's doing
:).
2012-12-09 18:45:47 -05:00
Behdad Esfahbod a5a4ab3846 [graphite2] Add hb_graphite2_face_get_gr_face and hb_graphite2_font_get_gr_font
Based on patch from Martin Hosken.  I believe it returns NULL if the
font doesn't have graphite tables, but have not tested.
2012-12-09 18:44:41 -05:00
Behdad Esfahbod 737ba15644 [graphite2] Preload all tables
Part of patch from Martin Hosken.
2012-12-09 18:43:03 -05:00
Behdad Esfahbod 0ae6dbf1b4 Minor 2012-12-09 18:37:38 -05:00
Behdad Esfahbod 3fe5c159d3 Remove excess return
Oops!
2012-12-09 18:20:19 -05:00
Behdad Esfahbod ba2d543004 Update OT language tags
Patch from Roozbeh Pournader.
2012-12-08 19:28:41 -05:00
Behdad Esfahbod aba38173c6 Minor 2012-12-05 19:54:48 -05:00
Behdad Esfahbod 61865745e3 Fix test with gold linker
Bug 57633 - Symbol tests should ignore __bss_start, _edata, _end
2012-12-05 19:42:10 -05:00
Behdad Esfahbod b71b0bd9ee [Indic] Add link to Sinhala split matra section of the Sinhala spec 2012-12-05 19:20:31 -05: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 b5e04c7dc6 [ucdn] Match upstream changes 2012-12-04 15:57:02 -05:00
Behdad Esfahbod 7babfe5a79 Move object mutext into the user-data array
We are not using it for anything lse it seems.
2012-12-04 00:35:54 +02:00
Behdad Esfahbod a190011477 Remove unused functions 2012-12-04 00:29:35 +02:00
Behdad Esfahbod 88b7564183 "Update" to Unicode 6.2.0 tables
Nothing changed...
2012-12-02 19:14:29 +02:00
Behdad Esfahbod 4ab99fb8c3 Minor 2012-11-30 15:02:04 +02:00
Behdad Esfahbod 6748b96d27 Minor 2012-11-30 12:02:21 +02:00
Behdad Esfahbod 0f3f529904 Add test-size-params
Eventually this will become part of a yet-to-be-written hb-ot cmdline
tool.
2012-11-30 09:06:59 +02:00
Behdad Esfahbod 8465a05a89 Fix hb_buffer_guess_segment_properties() for empty buffer
Was causing assertion failure in shape_plan().
2012-11-30 08:46:43 +02:00
Behdad Esfahbod e75943de80 [OTLayout] Fix collect_glyphs() recursion in ContextFormat3 2012-11-30 08:38:24 +02:00
Behdad Esfahbod 3038ae6adb [OTLayout] Minor 2012-11-30 08:24:13 +02:00
Behdad Esfahbod 0dff11f6bf [OTLayout] Look for any 'size' feature, not only in DFLT script
The old code doesn't work with all fonts, as Khaled has reported.
2012-11-30 08:14:20 +02:00
Behdad Esfahbod e9ad71dee8 [OTLayout] Rename hb_ot_layout_position_get_size() to hb_ot_layout_get_size_params() 2012-11-30 08:10:26 +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 f54cce3c6a [OTLayout] Implement 'size' feature 2012-11-26 14:02:31 +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 a88e716021 [OTLayout] Implement hb_ot_layout_collect_lookups()
Untested.
2012-11-24 02:31:02 -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 cdd756b9f4 [OTLayout] Implement GPOS collect_glyphs() 2012-11-24 01:38:41 -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 c6fb843f2a [OTLayout] Templatize process_recurse_func 2012-11-23 18:04:08 -05:00
Behdad Esfahbod 9b34677f36 [OTLayout] Clean up closure() a bit 2012-11-23 17:55:40 -05:00
Behdad Esfahbod adf7758a27 Improve debug log format in presence of templates 2012-11-23 17:34:02 -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 08f1eede1b Minor 2012-11-23 16:51:43 -05:00
Behdad Esfahbod 2c9d6485a1 More tracing fixup 2012-11-23 16:49:19 -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 5be86b1bb4 [ucdn] Make data tables const! 2012-11-22 16:33:46 -05:00
Behdad Esfahbod 7c5b7fe686 Fix hb_shape_plan_get_shaper() 2012-11-22 16:33:46 -05:00
Behdad Esfahbod ac064a2db2 Rename hb_set_population() to hb_set_get_population() 2012-11-21 01:14:19 -05:00
Behdad Esfahbod 16c914c2a6 [Indic] One more try at unbreaking Khmer fonts
See comments and discussion on the list.
2012-11-21 01:04:15 -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 51bb498b7b Minor 2012-11-16 14:08:05 -08:00
Behdad Esfahbod 89ca8eeb83 Implement hb_ot_layout_get_glyphs_in_class() 2012-11-16 13:53:40 -08:00
Behdad Esfahbod 5a08ecf920 Implement hb_ot_layout_get_glyph_class() 2012-11-16 13:34:29 -08:00
Behdad Esfahbod f9edd5d56b Implement hb_shape_plan_get_shaper()
Untested.
2012-11-16 13:23:37 -08:00
Behdad Esfahbod 43b6531500 [Indic] Another try to unbreak Sinhala split matras
Just read the comments...
2012-11-16 13:14:26 -08:00
Behdad Esfahbod 977f1740ac Unbreak tests 2012-11-16 13:10:07 -08:00
Behdad Esfahbod eba312c8d1 Plumbing to get shape plan and font into complex decompose function
So we can handle Sinhala split matras smartly...  Coming soon.
2012-11-16 12:58:38 -08:00
Behdad Esfahbod 3f82f8ff07 Rename hb_buffer_guess_properties() to hb_buffer_guess_segment_properties() 2012-11-15 18:48:10 -08: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 e05a999495 Add hb_face_[sg]et_glyph_count() 2012-11-15 16:23:21 -08:00
Behdad Esfahbod aec89de564 Add / modify set API a bit 2012-11-15 16:15:42 -08:00
Behdad Esfahbod c54599ad26 Minor 2012-11-15 16:14:39 -08:00
Behdad Esfahbod d1aa143ca4 [Thai] Remove U+0E2C from "AC" consonants
WinXP doesn't include it.
2012-11-15 15:38:08 -08:00
Behdad Esfahbod 362a990b22 Rename hb_ot_layout_would_substitute_lookup() and hb_ot_layout_substitute_closure_lookup()
To match upcoming API.
2012-11-15 14:57:31 -08:00
Behdad Esfahbod 3cec819d39 Make the OT shaper default, even if CoreText or Uniscribe is enabled 2012-11-15 13:15:39 -08:00
Behdad Esfahbod 072ae7a982 Add hb_buffer_serialize_list_formats() 2012-11-15 13:14:12 -08:00
Behdad Esfahbod f9edf16725 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.
2012-11-15 13:10:07 -08:00
Behdad Esfahbod fd0de881f4 Avoid C++ undefined behavior
https://bugzilla.mozilla.org/show_bug.cgi?id=810823
2012-11-15 10:48:50 -08:00
Behdad Esfahbod f41dc2d35b Fix undefined behavior in Indic dottedcircle
Chromium Issue 158998:	Conditional jump in harfbuzz-ng
http://code.google.com/p/chromium/issues/detail?id=158998
2012-11-15 10:36:43 -08:00
Behdad Esfahbod 1eb3e94fe9 [Thai] Implement PUA-based fallback shaping
As explained here:

  http://linux.thai.net/~thep/th-otf/shaping.html

Our output now matches Uniscribe for old fonts (eg. XP Tahoma) with no
Thai GSUB table.
2012-11-14 17:53:09 -08:00
Behdad Esfahbod 851784f837 Improve shaper selection 2012-11-14 17:53:09 -08:00
Behdad Esfahbod 43f04a7456 Move Thai shaper into a separate file 2012-11-14 15:51:54 -08:00
Behdad Esfahbod ba82325b7a Add note re 'Phags-pa letter U+A872, which is Joining_Type=L 2012-11-14 15:36:53 -08:00
Behdad Esfahbod d469fadce8 [Indic] Exchange abort() for assert() 2012-11-14 15:07:36 -08:00
Behdad Esfahbod 0f80a89de9 Don't route Kharoshthi through the Indic shaper
It's a simple, right-to-left, script.
2012-11-14 15:05:19 -08:00
Behdad Esfahbod e67072bb17 [Indic] Handle overstruck matra position 2012-11-14 15:00:53 -08:00
Behdad Esfahbod 7e99e4f074 Reposition Lao marks
Lao marks are center-aligned, unlike Thai ones.
2012-11-14 14:09:46 -08:00
Behdad Esfahbod 865745b5b8 Don't do fallback positioning for Indic and Thai shapers 2012-11-14 13:48:26 -08:00
Behdad Esfahbod 981748cb2e [Indic] If Khmer fonts have a 'liga' feature, use generic shaper
Seems to produce more coherent results than trying the Indic shaper on
them.  I'm looking at you, Kh-* fonts...
2012-11-14 13:38:16 -08:00