Commit Graph

1461 Commits

Author SHA1 Message Date
Behdad Esfahbod 281683995a Cosmetic 2011-07-31 16:00:35 -04:00
Behdad Esfahbod 6b37bc8084 [Indic] Fix ZWJ/ZWNJ application
Not quite working just yet.  False alarm re 10 failures.  It was
crashing.  Ouch!  Back to 48 failures.
2011-07-31 15:57:00 -04:00
Behdad Esfahbod e7be057024 [Indic] Add Final Reordering rules into comments
Not applied yet.
2011-07-31 15:22:46 -04:00
Behdad Esfahbod cfd4382ec1 [Indic] Handle Reph when determining base consonant 2011-07-31 15:08:40 -04:00
Behdad Esfahbod 97158392a5 [Indic] Ra is a consonant too 2011-07-31 15:01:28 -04:00
Behdad Esfahbod 0d8f8a177c [Indic] Fix reph inhibition logic 2011-07-31 14:57:59 -04:00
Behdad Esfahbod 9da0487cd4 [Indic] Support ZWJ/ZWNJ
Brings test-shape-complex failures down from 52 to 10!

I hereby declare harfbuzz-ng supporting Indic!
2011-07-31 13:46:44 -04:00
Behdad Esfahbod 9ee27a928a [Indic] Suppress reph formation upon joiners 2011-07-31 11:10:14 -04:00
Behdad Esfahbod 8354e004e5 Un-Ra U+09F1. According to the test suite this is correct.
But I'm not sure...  Down from 54 failures to 52.
2011-07-31 02:24:51 -04:00
Behdad Esfahbod ba7e85c104 Cosmetic 2011-07-30 21:11:53 -04:00
Behdad Esfahbod f5bc2725cb [Indic] For old-style Indic tables, move Halant around
In old-style Indic OT standards, the post-base Halants are moved after
their base.  Emulate that by moving first post-base Halant to
post-last-consonant.

Brings test-shape-complex failures down from 88 to 54.  Getting there!
2011-07-30 21:08:10 -04:00
Behdad Esfahbod c47a31fb47 [OT] Save chosen script tag 2011-07-30 20:57:01 -04:00
Behdad Esfahbod fd06bf5611 [Indic] Handle initial Ra+Halant in scripts that support Reph
Brings test-shape-complex failures down from 104 to 92.  Way to go!
2011-07-30 20:14:44 -04:00
Behdad Esfahbod ee58f3bc75 Minor 2011-07-30 19:15:53 -04:00
Behdad Esfahbod 352372ae5e [Indic] Categorize Ra in scripts that have Reph
Is the categorization correct?  I don't know.
2011-07-30 19:04:02 -04:00
Behdad Esfahbod 45d6f29f15 [Indic] Reorder matras
Number of failing shape-complex tests goes from 125 down to 94.

Next: Add Ra handling and it's fair to say we kinda support Indic :).
2011-07-30 14:44:30 -04:00
Behdad Esfahbod 911bf32aca Bug 39686 - Add '-no-undefined' to libharfbuzz LDFLAGS 2011-07-30 11:16:00 -04:00
Behdad Esfahbod 8f0b64fb69 Minor 2011-07-29 17:02:48 -04:00
Behdad Esfahbod 743807a3ce [Indic] Apply Indic features
Find the base consonant and apply basic Indic features accordingly.
Nothing complete, but does something for now.  Specifically:
no Ra handling right now, and no ZWJ/ZWNJ.

Number of failing shape-complex tests goes from 174 down to 125.

Next: reorder matras.
2011-07-29 16:46:09 -04:00
Behdad Esfahbod 9f9bcceca6 Register buffer vars in Indic shaper 2011-07-28 17:07:50 -04:00
Behdad Esfahbod be09bf6b79 Oops. This should have gone into the previous commit 2011-07-28 17:03:43 -04:00
Behdad Esfahbod b65c06025d Formalize buffer var allocations 2011-07-28 16:49:29 -04:00
Behdad Esfahbod a9ad3d3460 Move more code around
Buffer var allocation coming into shape
2011-07-28 15:42:18 -04:00
Behdad Esfahbod cc06c243d8 Streamline debugging infrastructure even more 2011-07-25 20:34:17 -04:00
Behdad Esfahbod 43ff203d8e Use variadic macros for debugging
Looks *so* much nicer!
2011-07-25 17:35:24 -04:00
Behdad Esfahbod decd4e3e16 Add sugar syntax for debug messages
Buffer debugging coming soon.
2011-07-25 16:47:02 -04:00
Behdad Esfahbod 3a81b1db89 Minor, fix leak from my previous refactorings 2011-07-25 16:30:32 -04:00
Behdad Esfahbod f4a579bc42 Add internal API for buffer var allocation 2011-07-25 16:26:05 -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 c86f932015 Move code around 2011-07-25 00:44:50 -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 c311d85208 Keep Unicode props updated as we go so we avoid a scan later 2011-07-23 23:43:54 -04:00
Behdad Esfahbod 5389ff4dbc Implement the Unicode Canonical Composition algorithm
Fallback normalization is complete and working now!
2011-07-22 20:22:49 -04:00
Behdad Esfahbod dcdc51cdc0 Handle singleton decompositions 2011-07-22 17:14:46 -04:00
Behdad Esfahbod 34c22f8168 Implement Unicode Canonical Reordering Algorithm 2011-07-22 17:04:20 -04:00
Behdad Esfahbod 4ff0d2d9df Decomposition works now! 2011-07-22 16:15:32 -04:00
Behdad Esfahbod 468e9cb25c Move buffer methods into the object 2011-07-22 14:49:14 -04:00
Behdad Esfahbod 45412523dc More normalization kick 2011-07-22 11:07:05 -04:00
Behdad Esfahbod 63c0ef4a07 Fix decompose() implementations to work with non-starter non-composables
Add tests.
2011-07-21 20:58:42 -04:00
Behdad Esfahbod 5d90a342e3 Document normalization design 2011-07-21 15:25:01 -04:00
Behdad Esfahbod 02cdf743c2 Add prefer_decomposed() complex-shaper callback
This allows the Indic shaper to request decomposed characters.  This will
handle split matra for free.  Other shapers prefer precomposed
characters.
2011-07-21 12:23:12 -04:00
Behdad Esfahbod d6b9c6d200 More kicking 2011-07-21 12:16:45 -04:00
Behdad Esfahbod 192445aef2 Remove intermittent_glyph()
Lets not worry about performance for now...
2011-07-21 12:13:04 -04:00
Behdad Esfahbod d63adfc7d0 No need to handle variation-selectors seperately, they are GC=Mn 2011-07-21 11:48:57 -04:00
Behdad Esfahbod aa7264123a Only form clusters if we are reversing
This produces more accurate cluster mappings.  Cluster mappings are
minimal now.  Combining marks get their own cluster value most of
the time.
2011-07-21 11:34:59 -04:00
Behdad Esfahbod 5c6f5982d7 Towards normalization 2011-07-21 11:31:08 -04:00
Behdad Esfahbod cf7f43ec33 Remove stale comment 2011-07-21 01:12:26 -04:00
Behdad Esfahbod 54d1a0d2b2 Form clusters before ensuring native direciton
This is essential as ensure_native_direction uses cluster info that
is set by form_clusters().
2011-07-21 01:11:09 -04:00
Behdad Esfahbod 9111b21ef9 Add _hb_buffer_output_glyph() and _hb_buffer_skip_glyph() 2011-07-21 00:59:15 -04:00
Behdad Esfahbod 655586fe5e Towards normalization 2011-07-21 00:52:42 -04:00
Behdad Esfahbod 49741c8633 Include variation-selectors in cluster calculation 2011-07-21 00:35:37 -04:00
Behdad Esfahbod dd89d958c1 Fix cluster calculation for non-LTR text 2011-07-21 00:28:57 -04:00
Behdad Esfahbod 4a68684654 When forming clusters, participate all mark types 2011-07-21 00:14:01 -04:00
Behdad Esfahbod 5157e12a55 Rename HB_UNICODE_GENERAL_CATEGORY_COMBINING_MARK to HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK
Spacing_Mark is the current Unicode long-name for this property value.
The previous name was wrongly carried from glib.
2011-07-21 00:12:33 -04:00
Behdad Esfahbod 7b08b0a7f2 Minor 2011-07-20 23:59:07 -04:00
Behdad Esfahbod 498e1a9be6 [icu] Implement compose()/decompose() 2011-07-20 23:19:49 -04:00
Behdad Esfahbod ffd4a436f7 Add tests for compose()/decompose()
Adjust glib fallback implementation.

The tests are not hooked up for ICU yet.
2011-07-20 22:31:23 -04:00
Behdad Esfahbod fca0923b04 Minor 2011-07-20 22:16:13 -04:00
Behdad Esfahbod 26b6024962 [glib] Use g_unicode_script_to/from_iso15924() if available 2011-07-20 22:16:01 -04:00
Behdad Esfahbod 22fdc66712 [glib] Add compose() and decompose() implementations with fallback 2011-07-20 21:51:37 -04:00
Behdad Esfahbod a54a5505a3 Minor 2011-07-20 16:42:10 -04:00
Behdad Esfahbod 22989c5ffc Distribute hb-ot-shape-complex-indic-machine.rl 2011-07-12 11:54:58 -04:00
Behdad Esfahbod f6fd3780e1 Let shapers decide when to apply ccmp and locl
Instead of always applying those two features before the complex shaper,
let the complex shaper decide whether they should be applied first.

Also add stub for Indic's final_reordering().
2011-07-08 00:22:40 -04:00
Behdad Esfahbod c4641723fb [API] Add compose() and decompose() unicode funcs, rename other ones
Add compose() and decompose() unicode funcs.  These implement
pair-wise canonical composition/decomposition.

The glib/icu implementations are lacking for now.  We are adding
API for this to glib, but I cannot find any useful API in ICU.
May end of implementing these in-house.

Changed all unicode_funcs callback names to remove the "_get" part.
Eg, hb_unicode_get_script_func_t is now hb_unicode_script_func_t,
and hb_unicode_get_script() is hb_unicode_script() now.
2011-07-08 00:09:31 -04:00
Behdad Esfahbod d05dded167 More code generation through preprocessor 2011-07-07 23:43:47 -04:00
Behdad Esfahbod 891c4755ba Humm, undo some shuffling
In preparation for adding more advanced unicode funcs.
2011-07-07 23:27:27 -04:00
Behdad Esfahbod 4b6317c4f4 More code shuffling 2011-07-07 23:14:42 -04:00
Behdad Esfahbod 3361c9a323 Minor 2011-07-07 22:35:17 -04:00
Behdad Esfahbod 76f76812ac Shuffle code around, remove shape_plan from complex shapers 2011-07-07 22:25:25 -04:00
Behdad Esfahbod e88bff9b4d Minor, use function typedefs 2011-07-07 22:03:02 -04:00
Behdad Esfahbod 359dcaa0d3 Update copyright headers 2011-07-07 21:55:05 -04:00
Behdad Esfahbod d8d0c480c8 Refactor some code common to GSUB and GPOS 2011-07-07 21:22:08 -04:00
Behdad Esfahbod b70c96dbe4 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.
2011-07-07 21:12:15 -04:00
Behdad Esfahbod f6d7a9bb4c Shuffle code around 2011-07-07 16:20:35 -04:00
Behdad Esfahbod 2e18c6dbdf Fix reverse_range() position loop
Mozilla Bug 669175 - Slow rendering of text sometimes in this case,
using direction: rtl
2011-07-06 16:05:45 -04:00
Behdad Esfahbod fa2befa46f Minor 2011-07-04 17:18:57 -04:00
Behdad Esfahbod d69d5ceaa0 [Indic] Well, at least finding syllables works now :)
Still not much there.
2011-07-04 12:56:38 -04:00
Behdad Esfahbod 4ec30aec30 [Indic] Optimize Indic table storage 2011-06-28 14:13:38 -04:00
Behdad Esfahbod c4a59de6d8 [Indic] Generate a single data table instead of multiple ones 2011-06-28 14:03:29 -04:00
Behdad Esfahbod 8fdba506f0 [Indic] Define indic_position_t 2011-06-24 20:45:55 -04:00
Behdad Esfahbod 65988a145b [Indic] Add a table of consonant positions
Copied form HarfBuzz.old Indic data.  These are below and post
consonants.  This is temporary.  Read the comment in the patch.
2011-06-24 19:05:52 -04:00
Behdad Esfahbod c7fe56a1d5 [Indic] Some of the basic features are global; Mark them so 2011-06-24 19:05:34 -04:00
Behdad Esfahbod 867361c3ad [indic] Add syllable recognition state machine
Using an incredible tool called Ragel.
2011-06-17 18:35:46 -04:00
Behdad Esfahbod 422e08dbb8 Better categorize Indic character classes
Matches OT types now.
2011-06-15 17:22:48 -04:00
Behdad Esfahbod 31f18abecb Minor compiler warning fixes 2011-06-15 09:49:58 -04:00
Behdad Esfahbod e3693b72f0 Change a couple strstr() to strchr() 2011-06-15 09:33:52 -04:00
Behdad Esfahbod b9452bfc16 Fix compiler warnings with -pedantic 2011-06-14 14:47:07 -04:00
Behdad Esfahbod 970e092dc2 Remove extra semicolon 2011-06-14 14:35:44 -04:00
Behdad Esfahbod 8142680802 Cosmetic 2011-06-13 16:12:56 -04:00
Behdad Esfahbod 902ab866f2 GNOME Bug 652227 - Unconditional use of stdint.h 2011-06-10 23:08:54 -04:00
Behdad Esfahbod 20503ccd57 More Indic data shuffling 2011-06-07 17:02:48 -04:00
Behdad Esfahbod 63b177e45c Minor 2011-06-07 15:51:40 -04:00
Behdad Esfahbod b9ddbd5593 [Indic] Start an Indic shaper
Nothing functional in there yet.

So far, we're parsing IndicSyllabicCategory.txt and IndicMatraCategory.txt
fils from Unicode Character Database and store them in an array to be used
by the shaper.  Also hooked up the shaper, but it does not do anything
right now.
2011-06-02 17:43:12 -04:00
Behdad Esfahbod 697a65c5f5 Minor 2011-06-01 23:15:48 -04:00
Behdad Esfahbod 9de1481f2b Update to ArabicShaping-6.1.0d2.txt 2011-06-01 20:45:14 -04:00
Behdad Esfahbod 9d49433efb Minor rename 2011-06-01 18:10:10 -04:00
Behdad Esfahbod 89a2bc9ba6 [Vertical] Apply vertical features
We apply all of vert, vrt2, vkrn, valt, and vpal.
2011-05-31 15:18:13 -04:00
Behdad Esfahbod 0c6a9767c8 [hb-view] Add --face-index to choose a face in a TrueType Collection 2011-05-31 12:59:17 -04:00
Behdad Esfahbod 4f28fbdd80 Fix TTC header handling
Also change the Version type to avoid similar bugs in the future.

Reported by Grigori Goronzy.
2011-05-31 12:33:11 -04:00
Behdad Esfahbod 21deab2bdc Fixed inifinite loop introduced in 7403e055cd
k is the index, not j.

Reported by Tom Hacohen.
2011-05-30 11:08:40 -04:00
Behdad Esfahbod 51881a61ca Shrink code size 2011-05-27 18:15:56 -04:00
Behdad Esfahbod 90645fb24b [OT] Separate map_builder from the actual map
Respectively, separate planner from the actual plan.
2011-05-27 18:13:31 -04:00
Behdad Esfahbod 5560a19e2b Minor 2011-05-27 17:49:16 -04:00
Behdad Esfahbod 5bc18195d5 Add check-includes.sh 2011-05-27 15:58:54 -04:00
Behdad Esfahbod 376dafa6ed Hide internal symbols 2011-05-27 03:40:04 -04:00
Behdad Esfahbod 329c15714b Add libtool versioning
The versioning is automatic.  For now, soname-major is 0.  With
the 1.0.0 release it will jump to 1 and stay there forever.
2011-05-25 16:07:07 -04:00
Behdad Esfahbod 2d8ebcb9d0 [API] One last font-funcs API change
Now that vertical text works correctly, I'm doing a last round
modification of the font-funcs API to simplify.  Expect no more
changes around here.
2011-05-25 11:27:33 -04:00
Behdad Esfahbod 7403e055cd [Vertical] fix vertical gpos
Wow, it took me a few days to find the right fix!

We now set the advance for attached marks to zero, but we
do this in the _finish() state of gpos, so it shouldn't
regress with fonts like DejaVuSansMono that explicitly
decrease the mark advance width to set it to zero.
2011-05-25 10:52:15 -04:00
Behdad Esfahbod 3b0bb855e0 [Vertical] GPOS x/y advance adjustments only apply in hori/vert respectively 2011-05-20 15:59:59 -04:00
Behdad Esfahbod cc2086d67c [Vertical] Fix GPOS y-advance direction 2011-05-19 19:19:50 -04:00
Behdad Esfahbod 67d51ff961 [Vertical] Do fallback origin calculation 2011-05-19 19:08:57 -04:00
Behdad Esfahbod 60fbb36096 [Vertical] GPOS is always done with horizontal origin 2011-05-19 18:46:15 -04:00
Behdad Esfahbod 8b38faeede More vertical
Starting to get there, but not without yet another round of changes.

I think I know wheere to go now.
2011-05-19 13:08:00 -04:00
Behdad Esfahbod e609aeb1e2 [hb-view] Add --annotate
Currently it only marks glyph origins.
2011-05-18 10:17:02 -04:00
Behdad Esfahbod b8d76dd74e Vertical: Adjust origin in glyph_extents() and glyph_contour_point()
The base for vertical is almost ready now.
2011-05-17 23:31:00 -04:00
Behdad Esfahbod 190981851f Cosmetic 2011-05-17 23:27:22 -04:00
Behdad Esfahbod 2c3f51a11c Minor 2011-05-17 23:23:27 -04:00
Behdad Esfahbod 7e2c85de30 [API] Vertical support, take 2
I like this API *much* better.  Implementation still incomplete, but
horizontal works.
2011-05-17 17:55:03 -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 4053f3f788 Cosmetic 2011-05-16 17:03:27 -04:00
Behdad Esfahbod 56d12e0356 Remove unnecessary TODO item 2011-05-16 16:01:58 -04:00
Behdad Esfahbod 1883af3796 [hb-view] Start work on vertical support 2011-05-16 15:18:16 -04:00
Behdad Esfahbod 9aa6f96af5 [hb-view] No need to allocate an extra glyph item at the end 2011-05-16 15:08:31 -04:00
Behdad Esfahbod 1a64f6e19a [API] Add HB_LANGUAGE_INVALID 2011-05-13 22:55:32 -04:00
Behdad Esfahbod 40b5c2e86c [test/test-ot-tag] Test hb-ot-tag.h, fix many bugs
I'm in awe with how many bugs this test revealed.  All fixed.
2011-05-13 22:46:36 -04:00
Behdad Esfahbod 7fc5a30cb4 [API] Add hb_face_make/is_immutable() 2011-05-12 17:48:20 -04:00
Behdad Esfahbod 20c8b908dd Finish off previous change 2011-05-12 15:19:33 -04:00
Behdad Esfahbod 0fd8c2f1be [API] Make get_glyph() callback return a boolean
We need to know whether the glyph exists, so we can fallback to
composing / decomposing.  Assuming that glyph==0 means "doesn't exist"
wouldn't work for applications like Pango that want to use different
"doesn't exist" glyph codes for different characters.  An explicit
return value fixes that.
2011-05-12 15:14:13 -04:00
Behdad Esfahbod 805af72405 Rename get_kernings() arguments from first/second_glyph to left/right_glyph
Makes it clear that kerning is in visual order.
2011-05-12 12:39:40 -04:00
Behdad Esfahbod df077fadd7 [object] Make object inert during destruction
Such that user_data and other finalizers cannot resurrect object
2011-05-12 01:19:39 -04:00
Behdad Esfahbod 52df150efe Fix font subclass chainup
Test passing now.
2011-05-12 00:46:57 -04:00
Behdad Esfahbod 7033518f75 [API] Pass face to get_table() 2011-05-11 23:31:15 -04:00
Behdad Esfahbod b467827806 [API] Remove const from font user_data 2011-05-11 23:25:28 -04:00
Behdad Esfahbod 9a14688e40 [API] Rename hb_face_create_for_data() to hb_face_create() 2011-05-11 22:49:29 -04:00
Behdad Esfahbod 46d6a21cc8 [API] Add hb_ot_layout_substitute_start/finish() 2011-05-11 22:33:13 -04:00
Behdad Esfahbod c84d15f52e Remove unused hb_set_t 2011-05-11 22:23:15 -04:00
Behdad Esfahbod 389a7c9e67 Remove hb_static_threadsafe_set_t 2011-05-11 22:21:38 -04:00
Behdad Esfahbod e06d4eda7b Use constructor/destructor for hb_ot_shape_plan_t 2011-05-11 22:18:31 -04:00
Behdad Esfahbod daa446f184 Fix compile with no mutex available 2011-05-11 21:31:25 -04:00
Behdad Esfahbod 1e56c476c1 Free static mutex'es 2011-05-11 21:28:01 -04:00
Behdad Esfahbod 831886a9b4 Streamline mutex stuff 2011-05-11 21:27:52 -04:00
Behdad Esfahbod 438c4eee35 Remove unused hb_mutex_trylock() 2011-05-11 21:14:34 -04:00
Behdad Esfahbod 80a6833b03 [API] Add hb_*_get_empty() for all objects 2011-05-11 18:21:58 -04:00
Behdad Esfahbod d3b30be378 [API] Add HB_UNTAG()
Useful in C API only.
2011-05-11 18:06:12 -04:00
Behdad Esfahbod 3cc6e9dcb4 Minor 2011-05-11 18:02:48 -04:00
Behdad Esfahbod 4101ca7dbb Plug more leaks
All good now.
2011-05-11 14:30:56 -04:00
Behdad Esfahbod 6a7ac79e26 Plug leaks 2011-05-11 14:19:18 -04:00
Behdad Esfahbod 7aa12ebdff [unicode] Simplify method setting 2011-05-11 11:55:11 -04:00
Behdad Esfahbod d5bfd02721 Minor 2011-05-11 11:48:28 -04:00