Commit Graph

3244 Commits

Author SHA1 Message Date
Behdad Esfahbod a319d0777b [ft] Handle negative x_scale / y_scale 2015-01-23 12:44:24 -08:00
Behdad Esfahbod b0b38bb892 [coretext] Fix positioning of notdef 2015-01-21 19:19:33 -08:00
Behdad Esfahbod 70622e5089 [coretext] Fix scaling
Before we were not accounting for possible differences in x_scale and
y_scale, as well as the signs of those.  All should be in good shape
now.
2015-01-21 18:51:42 -08:00
Behdad Esfahbod 221ba02b08 [coretext] Use vertical advance for notdef in vertical direction 2015-01-21 18:51:42 -08:00
Behdad Esfahbod 7988da24c5 Add convenience make target "make lib" in src/ 2015-01-21 18:33:50 -08:00
Behdad Esfahbod 67dfa8c7c2 When matching second glyph of kerning pairs, use bsearch
Roboto has glyphs (like 'F') that have 200 kerning pairs.
Add a handcoded bsearch instead of previous linear search.

This doesn't show much speedup though, apparently we spend the
bulk of the time somewhere before here.
2015-01-19 17:00:31 -08:00
Behdad Esfahbod e9f5c65be0 [bindings] Minor 2015-01-19 16:15:32 -08:00
Roozbeh Pournader 5eb939ddfe Change New Tai Lue shaping engine from SEA to default
This is to reflect the UTC decision to change the encoding model of
New Tai Lue from logical to visual to be similar to Thai, Lao, and
Tai Viet: http://www.unicode.org/L2/L2014/14250.htm#141-C26

The visual encoding is already the current practice of encoding New
Tai Lue on the web anyway:
http://www.unicode.org/L2/L2014/14195-newtailue.txt

Fixes behdad/harfbuzz#66.
2015-01-18 14:39:18 -08:00
Behdad Esfahbod 1aaa7d6799 [indic] Fix out-of-bounds access 2015-01-17 20:16:56 -08:00
Behdad Esfahbod 238d6a38f2 [bindings] Update sample.py 2015-01-07 10:51:44 -08:00
Behdad Esfahbod 2cd5323531 [bindings] Use hb_glib_blob_create() in sample
hb_blob_create() is considered C-only API.
2015-01-06 19:16:38 -08:00
Behdad Esfahbod 0ef179e2dc [glib] Add hb_glib_blob_create() that takes GBytes 2015-01-06 16:58:33 -08:00
Behdad Esfahbod b91904a40d [bindings] Replace deprecated allow-none with optional and nullable 2015-01-06 15:43:14 -08:00
Behdad Esfahbod 81a31f3eff [bindings] Make sample Python 2/3 compatible 2015-01-06 15:37:31 -08:00
Behdad Esfahbod b632e7997d Fix up gobject-introspection a bit
Minimal shaping works now!
2015-01-06 14:05:26 -08:00
Chris Peterson fb85d618f5 Add #ifdef HB_USE_ATEXIT to fix -Wunused-function warnings 2015-01-04 19:31:10 -08:00
Chris Peterson d1897a98d8 Fix hb_atomic_ptr_cmpexch -Wunused-value warnings 2015-01-03 19:46:19 -08:00
Behdad Esfahbod f34aaba868 [ft] Don't set font ppem
For discussion see:

  http://lists.freedesktop.org/archives/harfbuzz/2012-April/001905.html

Over time we have had added NO_HINTING all over the place in hb-ft.  Finish it off.
Not setting ppem on hb-font disables get_contour_point() calls which is good anyway.

See comments in the commit.
2014-12-28 18:56:15 -08:00
Behdad Esfahbod 350f3a02ce [ft] Add hb_ft_face_create_referenced() and hb_ft_font_create_referenced()
When I originally wrote hb-ft, FreeType objects did not support reference
counting.  As such, hb_ft_face_create() and hb_ft_font_create() had a
"destroy" callback and client was responsible for making sure FT_Face is
kept around as long as the hb-font/face are alive.

However, since this was not clearly documented, some clienets didn't
correctly did that.  In particular, some clients assumed that it's safe
to destroy FT_Face and then hb_face_t.  This, indeed, used to work, until
45fd9424c7, which make face destroy access
font tables.

Now, I fixed that issue in 395b35903e since
the access was not needed, but the problem remains that not all clients
handle this correctly.  See:

  https://bugs.freedesktop.org/show_bug.cgi?id=86300

Fortunately, FT_Reference_Face() was added to FreeType in 2010, and so we
can use it now.  Originally I wanted to change hb_ft_face_create() and
hb_ft_font_create() to reference the face if destroy==NULL was passed in.
That would improve pretty much all clients, with little undesired effects.
Except that FreeType itself, when compiled with HarfBuzz support, calls
hb_ft_font_create() with destroy==NULL and saves the resulting hb-font on
the ft-face (why does it not free it immediately?).  Making hb-face
reference ft-face causes a cycling reference there.  At least, that's my
current understanding.

At any rate, a cleaner approach, even if it means all clients will need a
change, is to introduce brand new API.  Which this commit does.

Some comments added to hb-ft.h, hoping to make future clients make better
choices.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=75299
2014-12-28 17:59:28 -08:00
Behdad Esfahbod 9a3b74884b Remove redundant check for FT_Face_GetCharVariantIndex
We require FreeType >= 2.8.3.  This symbol was introduced earlier
than that.
2014-12-28 17:27:39 -08:00
Behdad Esfahbod affacf2f37 [ft] Open blob in READONLY mode
HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE is deprecated and fairly
useless now.
2014-12-28 16:20:31 -08:00
Behdad Esfahbod 395b35903e Avoid accessing layout tables at face destruction
"Fixes" https://bugs.freedesktop.org/show_bug.cgi?id=86300

Based on discussion someone else who had a similar issue, most probably
the user is releasing FT_Face before destructing hb_face_t / hb_font_t.
While that's a client bug, and while we can (and should) use FreeType
refcounting to help avoid that, it happens that we were accessing
the table when we didn't really have to.  Avoid that.
2014-12-28 16:03:26 -08:00
Behdad Esfahbod 7d5e7613ce Fail blob creation if length overflows or is too large
Fail if blob start plus length overflows; or if blob length
is greater than 2GB.  It takes a while for fonts to get to that
size.  In the mean time, it protects against bugs like this:

  http://www.icu-project.org/trac/ticket/11450

Also avoids some weird issues with 32bit vs 64bit systems
as we accept length as unsigned int.  As such, a length of
-1 will cause overflow on 32bit machines, but happily
accepted on a 64bit machine.  Avoid that.
2014-12-18 18:22:21 -08:00
Behdad Esfahbod d5a5052098 Assert that blob length doesn't overflow address.
This will crash now, if blob was created with wrong length.
Check for that coming next commit.
2014-12-18 18:09:41 -08:00
Behdad Esfahbod 093c520de5 [otlayout] Mark variables that are C arrays as opposed to OT::ArrayOf 2014-12-12 21:07:53 -08:00
Behdad Esfahbod 9df0a52030 [otlayout] Avoid invalid access with Context format 3 2014-12-12 20:54:28 -08:00
Behdad Esfahbod 295ef1dd52 [ot] Debug get_coverage 2014-12-12 20:43:18 -08:00
Behdad Esfahbod 00f6a8e334 [ot] Print format in dispatch trace 2014-12-12 20:36:49 -08:00
Behdad Esfahbod 5c7d6f02d7 Minor 2014-12-12 20:28:49 -08:00
Behdad Esfahbod 153beebba9 [ot] Make sure all toplevel tables have tableTag 2014-12-12 19:46:09 -08:00
Behdad Esfahbod 282b13f9b4 [sanitize] Improve debug output some more 2014-12-12 19:34:49 -08:00
Behdad Esfahbod 0766ee1f4e [sanitize] Improve debug output 2014-12-12 18:23:20 -08:00
Behdad Esfahbod e6f80fa104 [indic] Allow ZWJ/ZWNJ before SM
In Oriya, a ZWJ/ZWNJ might be added before candrabindu to encourage
or stop ligation of the candrabindu.  This is clearly specified in
the Unicode section on Oriya.  Allow it there.  Note that Uniscribe
doesn't allow this.

Micro tests added using Noto Sans Oriya draft.

No changes in numbers.  Currently at:

BENGALI: 353725 out of 354188 tests passed. 463 failed (0.130722%)
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: 1048147 out of 1048334 tests passed. 187 failed (0.0178378%)
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%)
2014-12-10 12:05:24 -08:00
Behdad Esfahbod fde3e4a423 In hb_ot_collect_glyphs(), don't recurse to a lookup more than once
Otherwise, we might process a lookup thousands of times, with no
benefit.  This pathological case was hit by Noto Nastaliq Urdu Draft
in Firefox's code to determine whether space glyph is involved in
any GSUB/GPOS rules.  A test page is at http://behdad.org/urdu

See:
https://bugzilla.mozilla.org/show_bug.cgi?id=1090869
2014-10-29 11:23:08 -07:00
Behdad Esfahbod 5a5640d850 Move code around 2014-10-14 21:26:13 -07:00
Behdad Esfahbod 666b42f73b Move macros around
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=84491
2014-10-14 21:24:59 -07:00
Behdad Esfahbod 5c87120b81 Fix misc warnings
Fixes https://github.com/behdad/harfbuzz/pull/51
2014-10-14 20:07:31 -07:00
Behdad Esfahbod 8afaf09687 [ft] Add NO_HINTING in a couple other places 2014-10-02 16:40:41 -04:00
Behdad Esfahbod 5de0407337 Help clang with gcov 2014-10-01 18:18:25 -04:00
Behdad Esfahbod c0b82ba32a Create ragel-generated files in srcdir 2014-10-01 14:24:07 -04:00
Behdad Esfahbod 79bbb10b0d Clean ragel-generated headers in maintainercleanfiles 2014-10-01 13:33:21 -04:00
Behdad Esfahbod 8971cac83e Don't use tmp files in Makefile
Useful for code-coverage generation of the ragel-generated files
as they will now contain the correct .hh filename in them.
2014-10-01 12:42:16 -04:00
Behdad Esfahbod 2272318665 check-static-inits: Filter out zero-length sections
When compiling with -O0, zero-sized constructors were showing up
and confusing the test.
2014-10-01 11:56:07 -04:00
Behdad Esfahbod b695a3dc23 check-static-inits: check for static finalizers 2014-10-01 11:55:14 -04:00
Behdad Esfahbod 250398b1e4 Hide other bubble-sort 2014-10-01 11:28:59 -04:00
Behdad Esfahbod c1e8744262 Hide bubble-sort! 2014-10-01 11:07:08 -04:00
Behdad Esfahbod 156852991e [ot-font] Add hb_ot_face_cmap_accelerator_t 2014-09-25 17:45:49 +03:00
Behdad Esfahbod d088ccaf11 [ot-font] Minor 2014-09-25 17:26:56 +03:00
Behdad Esfahbod d7c160a153 [ot-font] Handle missing vertical metrics tables 2014-09-25 17:15:35 +03:00
Behdad Esfahbod be1cca2702 [ot-font] Add metrics_accel_t 2014-09-25 16:53:24 +03:00
Behdad Esfahbod d41b809e9d [ot-font] Start adding vertical support 2014-09-25 13:22:01 +03:00
Behdad Esfahbod 22f0de5025 Fix build 2014-08-25 12:54:57 -04:00
Behdad Esfahbod d457e3f0ff [arabic] Don't #include __FILE__
Fine!

https://code.google.com/p/chromium/issues/detail?id=406957
2014-08-25 12:31:19 -04:00
Behdad Esfahbod 9ceb673d9c [arabic] Allow disabling win1256 fallback code
By defining HB_NO_WIN1256.
2014-08-25 11:48:12 -04:00
Behdad Esfahbod 8a93195021 [ot] Prefer Windows platform cmap tables / accept all Unicode encodingIDs
Some fonts on the Mac ship with (0,1).
2014-08-22 12:06:57 -04:00
Behdad Esfahbod 270971a0fc [win32] Avoid preprocessor warnings re macros 2014-08-15 14:28:04 -04:00
Behdad Esfahbod 8c6bd34d38 Fix check-symbols on OS X 2014-08-14 13:33:37 -04:00
Behdad Esfahbod 522b1cc526 [coretext] Hide feature_mappings 2014-08-14 13:29:30 -04:00
Behdad Esfahbod 0d2c2f238b Simplify hb-object 2014-08-14 13:25:55 -04:00
Behdad Esfahbod 9d861b81f3 Really fix clang build this time 2014-08-14 13:15:21 -04:00
Behdad Esfahbod 272226f294 Revert "Fix build on clang after previous commit"
This reverts commit 9c80cbc87f.
2014-08-14 13:11:33 -04:00
Behdad Esfahbod 9c80cbc87f Fix build on clang after previous commit 2014-08-14 13:09:52 -04:00
Behdad Esfahbod a5a27073cf Rewrite this==NULL checks to avoid undefined behavior
Fixes https://code.google.com/p/chromium/issues/detail?id=403594
2014-08-14 13:05:36 -04:00
Behdad Esfahbod cc3b2d432b Remove this==NULL check from face->reference_table()
Not supposed to happen, and apparently this is undefined in C++.
https://code.google.com/p/chromium/issues/detail?id=403594
2014-08-14 13:00:47 -04:00
Behdad Esfahbod cd7ea4f791 Make hb_object_t members private
In preparation for fixing:
https://code.google.com/p/chromium/issues/detail?id=403594
2014-08-14 12:57:02 -04:00
Behdad Esfahbod 20076cc41e [coretext] Add version guards for kCTLanguageAttributeName 2014-08-12 19:26:35 -04:00
Behdad Esfahbod 1b3011c27d [coretext] Pass buffer language to CoreText 2014-08-12 19:17:49 -04:00
Behdad Esfahbod 3eb6a4dbf2 [coretext] Minor 2014-08-12 19:17:45 -04:00
Behdad Esfahbod 08acfe0d3a [hb-coretext] Fix cluster order of notdef runs in RTL text 2014-08-12 19:17:45 -04:00
Behdad Esfahbod 30eed75de2 [shape-plan] Fix typo!
The only effect is, if shaper_list was not NULL and no shaper was found,
we now don't insert anything into cache and return earlier.
2014-08-12 17:15:09 -04:00
Behdad Esfahbod dc9aba6fc5 [shape-plan] Better debug messages 2014-08-12 17:14:36 -04:00
Behdad Esfahbod e956c65bf7 [shape-plan] Simplify macro 2014-08-12 17:06:50 -04:00
Behdad Esfahbod 29e25550ce Fix gcc warning 2014-08-12 17:06:50 -04:00
Behdad Esfahbod 8d5eebc0c6 [shape-plan] Fix shape-plan caching with more than one requested shaper
Wasn't breaking out of loop, ouch!

http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1246370.html
2014-08-12 17:06:50 -04:00
Behdad Esfahbod bc3d0dc601 [shape-plan] Add debug tracing 2014-08-12 17:06:50 -04:00
Behdad Esfahbod 81b8d9777b [coretext] Fix buffer resizing
Was very broken.  Now fixed and tested.
2014-08-12 15:50:15 -04:00
Behdad Esfahbod c3e924fb9e [coretext] Rewind scratch-allocated arrays when not needed anymore 2014-08-12 15:50:15 -04:00
Behdad Esfahbod 8fd4d70b14 [wince] Two more Windows CE fixes
Report has it that it builds (and works) now:

  https://codereview.qt-project.org/#/c/92087/
2014-08-12 13:12:31 -04:00
Behdad Esfahbod fd0001d7db [coretext] Compare CGFont and PS name, if CTFont didn't match
See comments.

Fixes vertical text.  CoreText backend is in very good shape now!

Also see:
5a0eed3b50
25f4fb9b56

Fixes http://github.com/behdad/harfbuzz/pull/36
2014-08-12 10:34:01 -04:00
Behdad Esfahbod 5a0eed3b50 [coretext] Implement vertical shaping
Currently doesn't work though, we detect font fallback.  Apparently
matching on ct_font is not safe for this.  Looks like commit
25f4fb9b56 wasn't enough after all.
2014-08-11 23:47:16 -04:00
Behdad Esfahbod 1b55077f03 [coretext] Remove unnecessary alt_size
Wasn't needed after a6b8dc8742.
2014-08-11 20:45:12 -04:00
Behdad Esfahbod 10b1104d79 [coretext] Use CFRunStatus
Assert that all runs had expected direction, and take hint for
non-monotone clusters.
2014-08-11 20:02:45 -04:00
Behdad Esfahbod fd1a6aa8d0 [coretext] Minor 2014-08-11 20:01:37 -04:00
Behdad Esfahbod 130856c705 [coretext] Remove debug printf! 2014-08-11 19:16:26 -04:00
Behdad Esfahbod b5fbc3b8f5 API: Do not clear buffer-flags in hb_buffer_clear_contents()
After 763e5466c0, one doesn't
need to set flags for different pieces of text.  The flags now
are something the client sets up once, depending on how it
actually uses the buffer.  As such, don't clear it in
clear_contents().

Tests updated.
2014-08-11 18:40:01 -04:00
Behdad Esfahbod 104484cefe Minor 2014-08-11 18:24:36 -04:00
Behdad Esfahbod 4acce77db7 [coretext] Pass buffer direction to CoreText
Have to use a CTTypesetter for this.
2014-08-11 17:46:50 -04:00
Behdad Esfahbod 5ec45dd37c [coretext] Minor
It's hard to handle all possible NULL returns from CoreText.  Add one
more...
2014-08-11 17:46:12 -04:00
Behdad Esfahbod 624a299b82 [coretext] Attach marks to base clusters
Fixes https://githu.com/behdad/harfbuzz/issues/49
to the extent that it can be fixed.
2014-08-11 15:29:18 -04:00
Behdad Esfahbod 3c41ccb535 [coretext] Use input clusters
Before, this shaper was returning UTF-16 cluster indices instead of
returning whatever cluster values the user had had set up in the buffer.
Ouch!
2014-08-11 15:11:59 -04:00
Behdad Esfahbod a6b8dc8742 [coretext] Fix buffer resize handling
We can't really resize buffer and continue in this shaper as we are
using the scratch buffer for string_ref and log_cluster.  Restructure
shaper to retry from (almost) scratch.
2014-08-11 15:08:53 -04:00
Behdad Esfahbod 9b3c60c88b [coretext] Always compute log_clusters
To be used soon.
2014-08-11 13:46:56 -04:00
Behdad Esfahbod 15c633dd1f Minor 2014-08-11 13:42:59 -04:00
Behdad Esfahbod 9ce067c775 [coretext] Simplify cluster mapping 2014-08-11 02:44:50 -04:00
Behdad Esfahbod 49f7fb6376 [coretext] Minor 2014-08-10 19:19:38 -04:00
Behdad Esfahbod 25f4fb9b56 [coretext] Fix fallback detection
Fixes http://github.com/behdad/harfbuzz/pull/36
2014-08-10 19:05:52 -04:00
Behdad Esfahbod 77a7a53ace [coretext] Fix last range
Test with:

hb-view /Library/Fonts/Zapfino.ttf ZapfinoZapfino --features=-dlig[7:] --shaper=coretext
2014-08-10 19:05:52 -04:00
Behdad Esfahbod c2b151d952 Fix hb_in_range() for types smaller than int
As exercised by hb-coretext .notdef code.
2014-08-10 19:05:52 -04:00
Behdad Esfahbod 26a963b9cb [wince] Try to fix some stuff on Windows CE
Based on errors seen here:
http://testresults.qt-project.org/ci/QtBase_dev_Integration/build_03837/wince70embedded-armv4i-msvc2008_Windows_7/log.txt.gz

Fully untested.
2014-08-10 18:05:24 -04:00
Behdad Esfahbod 92aeee3f04 Minor 2014-08-10 17:42:19 -04:00
Behdad Esfahbod b9993d8d6d [coretext] Fix assert on Yosemite
Apparently those functions documented as sometimes returning NULL
actually exercise that right in OS X 10.10 Yosemite.  The scratch
was too small for that.  I *think* I fixed it, but haven't tested
as I don't have Yosemite.
2014-08-10 17:40:24 -04:00
Behdad Esfahbod 087733dd66 [coretext] Use CGFont as face_data 2014-08-10 17:33:16 -04:00
Behdad Esfahbod d277c3d7ee [arabic] Bug 82306 - Mandaic had errors in its Unicode Joining_Type
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=82306
2014-08-07 15:38:52 -04:00
Behdad Esfahbod 38fb30d742 Use atexit() only if it's safe to call from shared library
Apparently they are not (advertised as?) safe on BSD systems.
We ignore the case of static libraries.

Whitelisted on glibc, Android, and MSVC / mingw.

https://bugs.freedesktop.org/show_bug.cgi?id=82246
2014-08-06 13:34:49 -04:00
Behdad Esfahbod d5e61470fa [arabic] Fix fallback shaping regression
Was broken in 615d00ea25.

Fixes https://github.com/behdad/harfbuzz/pull/48

Micro-test added.
2014-08-05 14:19:36 -04:00
Behdad Esfahbod d7c850f803 [uniscribe] Minor 2014-08-02 19:07:53 -04:00
Behdad Esfahbod 8f3eebf7ee Make sure gsubgpos buffer vars are available during fallback_position
Add buffer var allocation asserts to a few key places.
2014-08-02 19:07:49 -04:00
Behdad Esfahbod 2053f369f8 Disable 'liga' for vertical text
The reason we turned it on is because Kazuraki uses it.  But that's
not reason enough.  Until the OpenType spec gets its act together re
adding design-direction to lookups, this is better user experience.
2014-08-02 16:31:16 -04:00
Behdad Esfahbod 763e5466c0 Make it easier to use HB_BUFFER_FLAG_BOT/EOT
Previously, we expected users to provide BOT/EOT flags when the
text *segment* was at paragraph boundaries.  This meant that for
clients that provide full paragraph to HarfBuzz (eg. Pango), they
had code like this:

  hb_buffer_set_flags (hb_buffer,
                       (item_offset == 0 ? HB_BUFFER_FLAG_BOT : 0) |
                       (item_offset + item_length == paragraph_length ?
                        HB_BUFFER_FLAG_EOT : 0));

  hb_buffer_add_utf8 (hb_buffer,
                      paragraph_text, paragraph_length,
                      item_offset, item_length);

After this change such clients can simply say:

  hb_buffer_set_flags (hb_buffer,
                       HB_BUFFER_FLAG_BOT | HB_BUFFER_FLAG_EOT);

  hb_buffer_add_utf8 (hb_buffer,
                      paragraph_text, paragraph_length,
                      item_offset, item_length);

Ie, HarfBuzz itself checks whether the segment is at the beginning/end
of the paragraph.  Clients that only pass item-at-a-time to HarfBuzz
continue not setting any flags whatsoever.

Another way to put it is: if there's pre-context text in the buffer,
HarfBuzz ignores the BOT flag.  If there's post-context, it ignores
EOT flag.
2014-08-02 16:17:44 -04:00
Behdad Esfahbod 0a5ae93362 Merge branch 'win1256' 2014-08-02 15:00:34 -04:00
Behdad Esfahbod 6ab6be32c5 [arabic/win1256] Remove unused MultipleSubst macros 2014-08-02 14:59:41 -04:00
Behdad Esfahbod abfa4252cc [arabic/win1256] Really fix lam-alef this time
https://bugzilla.mozilla.org/show_bug.cgi?id=1045139#c26
b276e897d1 (commitcomment-7243499)
2014-08-02 14:59:32 -04:00
Behdad Esfahbod 55977f2a46 [arabic/win1256] Hook up lamMedi lookup
Restructure lookup array to accommodate.

https://bugzilla.mozilla.org/show_bug.cgi?id=1045139#c18
2014-08-01 16:14:33 -04:00
Behdad Esfahbod e839e2523e [arabic/win1256] Fix TEH MARBUTA final form
https://bugzilla.mozilla.org/show_bug.cgi?id=1045139#c18
2014-08-01 16:09:44 -04:00
Behdad Esfahbod a2de193220 [arabic/win1256] Fix shaping of JEEM, HAH, and KHAH
https://bugzilla.mozilla.org/show_bug.cgi?id=1045139#c16
2014-07-31 18:58:33 -04:00
Behdad Esfahbod 1789ccb1dd [arabic/win1256] Remove GCC'ism
The table can now compile independently too.  If we cannot make it work
on MSVC, we can always generate the data and distribute it.

The code now compiles cleanly with:

gcc -c -xc -std=c99 -Werror -pedantic hb-ot-shape-complex-arabic-win1256.hh
g++ -c -xc -std=c++1x -Werror -pedantic hb-ot-shape-complex-arabic-win1256.hh

See:
a97f537cec (commitcomment-7218736)
2014-07-31 18:58:24 -04:00
Behdad Esfahbod f28b1c823d [arabic] Implement Windows-1256 private shaping
Bug 1045139 - The Arabic text with "MS Sans Serif" font is rendered bad
https://bugzilla.mozilla.org/show_bug.cgi?id=1045139

This is only enabled on Windows platforms, and requires support from
Uniscribe to work.  But for clients that do hook up to Uniscribe, this
fixes shaping of Windows-1256-encoded bitmap fonts like "MS Sans Serif".

The code and table together have just less than a 1kb footprint when
enabled.

UNTESTED.  I might even have broken regular Arabic fallback shaping.
2014-07-31 18:58:24 -04:00
Behdad Esfahbod ac53443f1c [hangul] Don't apply 'calt'
See comments.

Micro-test added.
2014-07-31 18:54:43 -04:00
Behdad Esfahbod 88911e8cc7 Minor 2014-07-29 19:47:26 -04:00
Behdad Esfahbod 9e834e29e0 [hebrew] Zero mark advance by GDEF late
Seems to be what Uniscribe does.

At this point I think it's work checking our default...

Fixes Bug 76767 - Zeroing of advance of 2nd component of multiple
substitution with SBL Hebrew
https://bugs.freedesktop.org/show_bug.cgi?id=76767

Micro-test added.
2014-07-26 20:34:01 -04:00
Behdad Esfahbod 6f2d9ba52a Add old-Myanmar shaper
Looks like Unsicribe responds to the 'mymr' tag by zeroing marks
GDEF_LATE instead of generic-shaper UNICODE_LATE.  Implement that.

Fixes
Bug 81775 - Incorrect Rendering with harfbuzz-ng myanmar unicode
https://bugs.freedesktop.org/show_bug.cgi?id=81775

Micro-test added based on Padauk.
2014-07-26 19:18:59 -04:00
Behdad Esfahbod 595d2b96c3 Minor 2014-07-26 18:44:15 -04:00
Behdad Esfahbod fe6788bc57 Typo 2014-07-25 12:40:56 -04:00
Behdad Esfahbod 6e69200a2a Fix snprintf() format
Patch from Maks Naumov.
Fixes https://github.com/behdad/harfbuzz/pull/22
2014-07-25 12:30:47 -04:00
Behdad Esfahbod 5c5cdbbdf8 Make sure broken feature strings are not partially parsed
If user doesn't check hb_feature_from_string() return value, we
don't want them to end up see the partially-parsed feature.
2014-07-25 12:21:49 -04:00
Behdad Esfahbod a795fe6378 Allow quotation marks around feature tag in hb_feature_from_string()
With this, I believe we accept CSS feature strings completely.
2014-07-25 12:15:49 -04:00
Behdad Esfahbod 3f64618474 Allow space at the end of feature string with values, eg 'dlig=1 ' 2014-07-25 12:13:19 -04:00
Behdad Esfahbod f31f7d2259 Minor 2014-07-25 12:13:19 -04:00
Behdad Esfahbod 60cb18a5de Allow on/off in hb_feature_from_string()
We now allow things like "dlig on" / "dlig=on".
2014-07-25 12:13:16 -04:00
Behdad Esfahbod d9e618eca9 Remove duplicate definition of ISALNUM
It's defined in hb-private.h already.
2014-07-25 12:02:26 -04:00
Behdad Esfahbod 2ee5f665de Fix parsing of features like "- liga" (with the space) 2014-07-25 12:02:22 -04:00
Behdad Esfahbod e15fa7a8cf Do not require the '=' in hb_feature_from_string()
Towards accepting CSS font-feature-settings strings.
2014-07-25 11:46:28 -04:00
Behdad Esfahbod f4fe9baefd Reject tags longer than 4 chars in hb_feature_from_string() 2014-07-25 11:39:55 -04:00
Behdad Esfahbod 7e8c389546 Minor warnings fixes
Some systems insist on -Wmissing-field-initializers.  We have too many,
by design.  Fix a few easy ones.
2014-07-25 11:23:17 -04:00
Behdad Esfahbod fc0daafab0 [indic] Handle old-spec Malayalam reordering with final Halant
See comment.

Micro-tests added.
2014-07-23 16:53:03 -04:00
Behdad Esfahbod d6d349d178 Give CC to gir-scanner
From:
https://github.com/Alexpux/MINGW-packages/blob/master/mingw-w64-harfbuzz/0001-give-cc-to-gir-scanner.all.patch
2014-07-23 11:38:49 -04:00
Behdad Esfahbod 3f310dc0ca Disallow changing settings on immutable face
Ouch!
2014-07-22 16:26:27 -04:00
Behdad Esfahbod 0fc0a10228 [win] Fix Cygwin build
db30828048 (commitcomment-7077778)
2014-07-21 11:13:27 -04:00
Behdad Esfahbod 1132a7dd0e Add HB_TAG_MAX_SIGNED / _HB_SCRIPT_MAX_VALUE_SIGNED
To make C language police happy.
2014-07-20 01:17:40 -04:00
Behdad Esfahbod df99976398 [gobject] Skip _HB_SCRIPT_MAX_VALUE
Fixes https://github.com/behdad/harfbuzz/pull/38
2014-07-19 17:31:23 -04:00
Behdad Esfahbod f1a8d50a87 [win] Don't define visibility attribtue under Cygwin 2014-07-19 16:52:32 -04:00
Behdad Esfahbod 9c77027d64 [win] Turn STRICT on for including windows.h 2014-07-19 16:37:22 -04:00
Behdad Esfahbod db30828048 [win] Consolidate windows.h include tips and tricks 2014-07-19 16:32:04 -04:00
Behdad Esfahbod f26d59d468 More fixing MemoryBarrier() on Mingw32
Set requested windows header to Vista.  See discussion:

fbb2847f54 (commitcomment-7054700)
2014-07-19 16:10:21 -04:00
Behdad Esfahbod 385cf37cf0 Fix hb_in_range() unused-var warning on Windows 2014-07-17 18:22:07 -04:00
Behdad Esfahbod e3b42f1af4 [arabic] Disable 'cswh' again
Ouch!
2014-07-17 17:13:54 -04:00
Behdad Esfahbod 82f4d9d53f [arabic] Add note re disabled 'cswh' 2014-07-17 15:57:37 -04:00
Behdad Esfahbod 615d00ea25 [arabic] Apply init/medi/isol/fini/... in separate stages
Follows the order of the Arabic/Syriac specs.  Also don't stop
between rlig and calt in non-Arabic scripts.

Micro-tests for Arabic and Mongolian added for the latter.
2014-07-17 15:50:13 -04:00
Behdad Esfahbod 7cd33f2304 Micro optimization 2014-07-17 14:39:07 -04:00
Behdad Esfahbod 164c13d73f Another try to fix Mongolian free variation selectors
This reverts bf029281 and fixes it properly.  That commit
was not enough as it was only inheriting the shaping_action
for prev_action, but not curr_action.

Micro-test added.

https://code.google.com/p/chromium/issues/detail?id=393896
2014-07-17 14:28:04 -04:00
Behdad Esfahbod 5209c50506 Revert "Show U+FFFD REPLACEMENT CHARACTER for invalid Unicode codepoints"
We now handle U+FFFD replacement in hb_buffer_add_utf*().  Any other
manipulation can happen in user callbacks.  No need for this.

efe74214bb (commitcomment-7039404)

This reverts commit efe74214bb.

Conflicts:
	src/hb-ot-shape-normalize.cc
2014-07-17 12:23:44 -04:00
Dominik Röttsches 9e7c720100 Fix CoreText build after a8b89a09f6 2014-07-17 12:18:08 -04:00
Behdad Esfahbod a4d643755a Minor 2014-07-16 20:15:45 -04:00
Behdad Esfahbod 976c8f4552 New API: hb_buffer_[sg]et_replacement_codepoint()
With this change, we now by default replace broken UTF-8/16/32 bits
with U+FFFD.  This can be changed by calling new API on the buffer.
Previously the replacement value used to be (hb_codepoint_t)-1.

Note that hb_buffer_clear_contents() does NOT reset the replacement
character.

See discussion here:

6f13b6d62d

New API:

  hb_buffer_set_replacement_codepoint()
  hb_buffer_get_replacement_codepoint()
2014-07-16 15:34:20 -04:00
Behdad Esfahbod bcba8b4502 New API hb_buffer_add_codepoints()
Like hb_buffer_add_utf32, but doesn't do any Unicode validation.
This is like what hb_buffer_add_utf32 used to be until a couple
commits ago.
2014-07-16 14:59:04 -04:00
Behdad Esfahbod 625dbf141a [buffer] Templatize UTF-* functions 2014-07-16 14:52:59 -04:00
Behdad Esfahbod e634fed428 [buffer] Validate UTF-32 input
Same as what we do for UTF-8 and UTF-16.
2014-07-16 14:17:26 -04:00
Behdad Esfahbod b98c5db32d Minor refactoring 2014-07-16 13:44:01 -04:00
Behdad Esfahbod 3b861421a7 Fix Mongolian Variation Selectors for fonts without GDEF
Originally we fixed those in 79d1007a50.
However, fonts like MongolianWhite don't have GDEF, but have IgnoreMarks
in their LigatureSubstitute init/etc features.  We were synthesizing a
GDEF class of mark for Mongolian Variation Selectors and as such the
ligature lookups where not matching.  Uniscribe doesn't do that.

I tried with more sophisticated fixes, like, if there is no GDEF and
a lookup-flag mismatch happens, instead of rejecting a match, try
skipping that glyph.  That surely produces some interesting behavior,
but since we don't want to support fonts missing GDEF more than we have
to, I went for this simpler fix which is to always mark
default-ignorables as base when synthesizing GDEF.

Micro-test added.

Fixes rest of https://bugs.freedesktop.org/show_bug.cgi?id=65258
2014-07-16 13:30:26 -04:00
Behdad Esfahbod 878a25375b Minor 2014-07-16 13:21:59 -04:00
Behdad Esfahbod ec181e5014 Minor moving around 2014-07-16 13:10:03 -04:00
Behdad Esfahbod e7ce50d9eb [indic] Fix access past end of array 2014-07-16 12:30:39 -04:00
Behdad Esfahbod 73e23b0acf Whitespace 2014-07-15 18:43:49 -04:00
Behdad Esfahbod b7bc0b671d Simplify / speed up UTF-8 code 2014-07-11 16:22:13 -04:00
Behdad Esfahbod af2490c095 Only accept well-formed UTF-8 sequences
Enable tests that were disabled before, and adjust one test,
and add more tests.
2014-07-11 16:22:13 -04:00
Behdad Esfahbod 7323d385cc Simplify hb_utf_prev<16> to call hb_utf_next<16> 2014-07-11 16:22:13 -04:00
Behdad Esfahbod c09a607a84 Use hb_in_range() for arabic and indic tables
Though, looks like gcc was smart enough to produce the same code
before...
2014-07-11 16:22:13 -04: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 a8b89a09f6 Simplify hb_in_range()
It's both faster and produces smaller code.  Now I feel stupid for
not writing it this way before.
2014-07-11 14:18:01 -04:00
Behdad Esfahbod db8934faa1 Simplify hb_utf_prev<8> to call hb_utf_next<8> 2014-07-11 13:58:36 -04:00
Behdad Esfahbod efe74214bb Show U+FFFD REPLACEMENT CHARACTER for invalid Unicode codepoints
Only if the font doesn't support it.  Ie, this gives the user to
use non-Unicode codepoints as private values and return a meaningful
glyph for them.  But if it's invalid and font callback doesn't
like it, and if font has U+FFFD, show that instead.

Font functions that do not want this automatic replacement to
happen should return true from get_glyph() if unicode > 0x10FFFF.

Replaces https://github.com/behdad/harfbuzz/pull/27
2014-07-11 11:59:48 -04:00
Behdad Esfahbod 6f13b6d62d When parsing UTF-16, generate invalid codepoint for lonely low surrogate
Test passes now.
2014-07-10 19:39:39 -04:00
Behdad Esfahbod 6334495ac1 Use zh-Hans / zh-Hant when converting OT language tag to hb_language_t 2014-07-10 19:22:07 -04:00
Behdad Esfahbod f381e320df Fix lang matching logic
Previous code was broken logically, but harmless.
2014-07-10 19:20:35 -04:00
Behdad Esfahbod ee5350d667 Accept BCP 47 zh-Hans / zh-Hant language tags 2014-07-10 19:18:56 -04:00
Behdad Esfahbod 8b16ff1259 [uniscribe] Fix build after recent changes to Offset 2014-07-09 17:41:09 -04:00
Behdad Esfahbod 73f7f8919e Define _POSIX_C_SOURCE only if it is not defined
Fixes https://github.com/behdad/harfbuzz/pull/45
2014-07-09 17:17:18 -04:00
Behdad Esfahbod 0cd94491b9 [ucdn] Update to Unicode 7.0.0 data
From http://github.com/behdad/ucdn
2014-07-09 16:53:06 -04:00
Behdad Esfahbod 68f724484b [indic] Remove some more now-unused special-cases 2014-06-30 15:46:53 -04:00
Behdad Esfahbod e79c948980 [indic] Remove special-casing of U+1CF2,1CF3
These were introduced in a498565ced,
but IndicSyllabicCategory has had the correct value already, so the
special code was never needed.
2014-06-30 15:39:39 -04:00
Behdad Esfahbod d743ce78e1 [indic-table] Update to Unicode 7.0 data
Touch code just enough to preserve previous syllable structure
and functionality as closely as possible.  Many further cleanups
coming later.
2014-06-30 15:24:45 -04:00
Behdad Esfahbod 5fa21b3ab7 [indic-table] Fix category frequency counts in comments 2014-06-30 14:30:54 -04:00
Behdad Esfahbod 5c4e3e9a57 Whitespace 2014-06-30 14:25:18 -04:00
Behdad Esfahbod af528b6674 Fix typo; ouch! 2014-06-27 18:07:00 -04:00
Behdad Esfahbod 7d4ada66c9 Mark unsed members with a "Z" suffix
There may be more.  There are members that are by definition
redundant or reserved and not needed, NOT what we *currently*
don't use.

I'm sure there's more...
2014-06-27 17:32:56 -04:00
Behdad Esfahbod 23afcff1d1 [ot-font] Implement Unicode variation selectors 2014-06-27 17:22:36 -04:00
Behdad Esfahbod a5a4736916 [cmap] Implement subtable format 14 2014-06-27 17:22:31 -04:00
Behdad Esfahbod 586b60622c Minor: final bits of cleanup 2014-06-27 15:39:47 -04:00
Behdad Esfahbod 51d9ba09bc Minor 2014-06-27 15:27:15 -04:00
Behdad Esfahbod 3084767e92 Minor: Remove LongArrayOf 2014-06-27 15:24:35 -04:00
Behdad Esfahbod 41ea594950 Minor: Remove LongSortedArrayOf 2014-06-27 15:23:18 -04:00
Behdad Esfahbod bb6ecf2ce5 Minor: Remove LongOffsetArrayOf and LongOffsetLongArrayOf 2014-06-27 15:21:08 -04:00
Behdad Esfahbod 99d2817123 Minor: Remove GenericOffset 2014-06-27 15:19:15 -04:00
Behdad Esfahbod 9da552dcc5 Minor: Remove some GenericXXX templates 2014-06-27 15:18:36 -04:00
Behdad Esfahbod 36073ede5b Minor: Reorder template parameter order 2014-06-27 15:18:26 -04:00
Behdad Esfahbod 0394ec1bfb Minor: Introduce GenericOffset 2014-06-27 15:18:08 -04:00
Behdad Esfahbod 0d1b3419a7 Minor: Use template parameter default values for OffsetTo 2014-06-27 15:17:47 -04:00
Behdad Esfahbod 546b1adcdc Minor: Use template parameter default values for hb_prealloced_array_t 2014-06-27 15:17:01 -04:00
Behdad Esfahbod 911ca38645 Add back API removed recently
Add hb_ot_layout_language_get_required_feature_index() again, which
is used in Pango.  This was removed in
da13293798 in favor of
hb_ot_layout_language_get_required_feature().

API changes:

  - Added hb_ot_layout_language_get_required_feature_index back.
2014-06-24 10:20:36 -06:00
Behdad Esfahbod 89e4946929 Add new IndicSyllabicCategory short forms for Unicode 7.0 2014-06-22 11:32:13 -06:00
Behdad Esfahbod dcee838e89 Minor 2014-06-22 11:29:59 -06:00
Behdad Esfahbod f2ad86e605 [indic-table-gen] Minor 2014-06-21 15:31:10 -06:00
Behdad Esfahbod 2ec62279aa [indic-table] Update to Unicode 6.3.0
Was from 6.2.0.  It's a no-op.  Committing for the record.
2014-06-21 15:25:59 -06:00
Behdad Esfahbod 5d4d7384ef Minor: format 2014-06-21 14:53:21 -06:00
Behdad Esfahbod 44243ae590 [arabic-table] Update to Unicode 7.0
Old table was from 6.2.  Remove hard-coded Mongolian and Phags-pa data.
This completes support for new scripts Manichian and Psaltar Pahlavi.
2014-06-21 14:19:34 -06:00
Behdad Esfahbod cd86ab9b4f [arabic-table] Add ZWJ/ZWNJ now that table is segmented 2014-06-21 14:16:54 -06:00
Behdad Esfahbod 2390d9b67e [arabic-table] Further tune
In anticipation of Unicode 7.0 data coming in the next commit.
2014-06-21 14:07:02 -06:00
Behdad Esfahbod a133e6067a [indic-table] Minor 2014-06-20 18:01:34 -04:00
Behdad Esfahbod b900fa2c8c [arabic-table] Use segmented table
No functional change.
2014-06-20 17:59:43 -04:00
Behdad Esfahbod c2e1134046 [indic-table] Make output stable 2014-06-20 17:57:03 -04:00
Behdad Esfahbod 55abfbd2ac [indic-table] Minor
No output change.
2014-06-20 16:47:43 -04:00
Behdad Esfahbod f886707490 [arabic-table] Don't write comments
No functional change.
2014-06-20 16:30:10 -04:00
Behdad Esfahbod 200dfe3eb1 [arabic-table] Use short names for values
No functional change.
2014-06-20 16:20:59 -04:00
Behdad Esfahbod 3f5327a41e [arabic-table] Read Blocks.txt and shuffle code around
No functional change.
2014-06-20 16:17:42 -04:00
Behdad Esfahbod 171f970e4f [indic-table] Black-list Thai, Lao, and Tibetan
We don't need Indic table for those.
2014-06-20 15:30:29 -04:00
Behdad Esfahbod 65ac2dae4f [indic-table] Speed up lookup 2014-06-20 15:29:38 -04:00
Behdad Esfahbod 64442a3f4c [indic-table] Fix compiler warning 2014-06-20 15:29:21 -04:00
Behdad Esfahbod 0436e1d505 [indic-table] Make table more compact by not covering full blocks
-#define indic_offset_total 4416
+#define indic_offset_total 3816

-}; /* Table occupancy: 60% */
+}; /* Table occupancy: 69% */
2014-06-20 15:28:38 -04:00
Behdad Esfahbod 190a251479 [indic-table] Remove block range from data table
No functional change.
2014-06-20 14:42:03 -04:00
Behdad Esfahbod 2b051c6057 Rename HB_VERSION_CHECK and hb_version_check to "atleast"
HB_VERSION_CHECK's comparison was originally written wrongly
by mistake.  When API tests were written, they were also written
wrongly to pass given the wrong implementation... Sigh.

Given the purpose of this API, there's no point in fixing it
without renaming it.  As such, rename.

API changes:

  HB_VERSION_CHECK -> HB_VERSION_ATLEAST
  hb_version_check -> hb_version_atleast
2014-06-20 14:09:57 -04:00
Behdad Esfahbod cabfa538ed Adjust unused doc symbols 2014-06-20 14:02:30 -04:00
Jonathan Kew da13293798 Rework handling of requiredFeature to solve problem with rlig in arial.ttf from winxp
https://bugzilla.mozilla.org/show_bug.cgi?id=986802
Fixes https://github.com/behdad/harfbuzz/pull/39

API Change:

-hb_ot_layout_language_get_required_feature_index
+hb_ot_layout_language_get_required_feature

New API takes an extra pointer argument.  Pass NULL in to get
behavior of previous API.

Reworked by behdad
2014-06-19 16:33:48 -04:00
Behdad Esfahbod df554af99d Rename search() to bsearch() and lsearch()
Such that the complexity of the algorithm used is clear at
call site.
2014-06-19 15:39:18 -04:00
Behdad Esfahbod fb8cc86ff9 Rename sort() to qsort()
In an effort to make the algorithm used clear.
2014-06-19 15:31:09 -04:00
Behdad Esfahbod 577ca48143 [unicode7] Update list of Default_Ignorable codepoints 2014-06-18 12:29:23 -04:00
Behdad Esfahbod 7cfee38276 [unicode7] Route Manichaean and Psalter Pahlavi through Arabic shaper
Still needs update to joining table to fully work.
2014-06-18 12:22:45 -04:00
Behdad Esfahbod a4a7899cd9 [unicode7] Mark right-to-left scripts 2014-06-18 12:22:45 -04:00
Behdad Esfahbod 62587bfc51 [unicode7] Declare Unicode 7 scripts 2014-06-18 12:22:45 -04:00
Behdad Esfahbod dc61294aa9 [unicode7] Add missing ISO 15924 tags 2014-06-18 12:22:45 -04:00
Behdad Esfahbod 7526373e70 [coretext] Remove unused var 2014-06-17 11:45:26 -04:00
Jonathan Kew 798e4185bc When zeroing mark widths for LTR, also adjust offset...
...so that they overstrike preceding glyph.

https://github.com/behdad/harfbuzz/pull/43
2014-06-12 18:34:15 -04:00
Jonathan Kew 80f7405a52 [Thai] set the correct general category on Nikhahit when decomposing Sara-Am. 2014-06-12 18:25:58 -04:00
Behdad Esfahbod 1d634cbb4b Fix base-position when 'pref' is NOT formed
If pre-base reordering Ra is NOT formed (or formed and then
broken up), we should consider that Ra as base.  This is
observable when there's a left matra or dotreph that positions
before base.

Now, it might be that we shouldn't do this if the Ra happend
to form a below form.  We can't quite deduce that right now...

Micro test added.  Also at:

https://code.google.com/a/google.com/p/noto-alpha/issues/detail?id=186#c29
2014-06-12 17:10:35 -04:00
Behdad Esfahbod 04dc52fa15 [indic] Recover OT_H undergone ligation and multiplication
Sometimes font designers form half/pref/etc consonant forms
unconditionally and then undo that conditionally.  Try to
recover the OT_H classification in those cases.

No test number changes expected.
2014-06-09 14:20:06 -04:00
Behdad Esfahbod 39c8201f8e [indic] Improve base re-finding
No test numbers change.
2014-06-09 14:20:06 -04:00
Behdad Esfahbod c04d5f0dd2 [indic] Minor 2014-06-09 14:20:06 -04:00
Behdad Esfahbod 832a6f99b3 [indic] Don't reorder reph/pref if ligature was expanded
Normally if you want to, say, conditionally prevent a 'pref', you
would use blocking contextual matching.  Some designers instead
form the 'pref' form, then undo it in context.  To detect that
we now also remember glyphs that went through MultipleSubst.

In the only place that this is used, Uniscribe seems to only care
about the "last" transformation between Ligature and Multiple
substitions.  Ie. if you ligate, expand, and ligate again, it
moves the pref, but if you ligate and expand it doesn't.  That's
why we clear the MULTIPLIED bit when setting LIGATED.

Micro-test added.  Test: U+0D2F,0D4D,0D30 with font from:

[1]
https://code.google.com/a/google.com/p/noto-alpha/issues/detail?id=186#c29
2014-06-05 20:36:01 -04:00
Behdad Esfahbod b5be231720 [gsub] Adjust single-length ligature subst to act like single subst 2014-06-05 19:00:22 -04:00
Behdad Esfahbod aae69451df [gsub] Minor shuffling 2014-06-05 19:00:08 -04:00
Behdad Esfahbod b6b304f12b [ot] Add TODO re zero-len MultipleSubst sequences 2014-06-05 17:12:54 -04:00
Behdad Esfahbod f1a72fe7bf [ot-font] Fix cmap EncodingRecord cmp order 2014-06-04 19:03:16 -04:00
Behdad Esfahbod ce34f0b07e [ot-font] Use binary search for format12 cmap subtable 2014-06-04 18:57:46 -04:00
Behdad Esfahbod 257d1adfa1 [ot-font] Work around broken cmap subtable format 4 length
Roboto was hitting this.  FreeType also has pretty much the
same code for this, in ttcmap.c:tt_cmap4_validate():

    /* in certain fonts, the `length' field is invalid and goes */
    /* out of bound.  We try to correct this here...            */
    if ( table + length > valid->limit )
    {
      if ( valid->level >= FT_VALIDATE_TIGHT )
        FT_INVALID_TOO_SHORT;

      length = (FT_UInt)( valid->limit - table );
    }
2014-06-04 18:47:55 -04:00
Behdad Esfahbod 51f563579b Move try_set to sanitize context 2014-06-04 18:42:32 -04:00
Behdad Esfahbod 500737e8e1 [ot-font] Don't select a Null cmap subtable
Can happen either in broken fonts, or as a result of sanitize().
2014-06-04 18:17:29 -04:00
Behdad Esfahbod dac86026a6 Fix some cppcheck warnings
Bug 77800 - cppcheck reports
2014-06-03 17:57:00 -04:00
Behdad Esfahbod c306410cab Bug 77732 - Fix unused typedef warning for ASSERT_STATIC with GCC 4.8 2014-06-03 17:00:07 -04:00
Behdad Esfahbod ae2b854eab Move code around 2014-06-03 16:59:09 -04:00
Behdad Esfahbod 17c3b809f4 [indic] Treat U+A8E0..A8F1 as OT_A instead of OT_VD
Apparently they can intermix with other OT_A.

Test: U+0915,A8E2,1CD0
2014-06-02 15:08:18 -04:00
Behdad Esfahbod 6ae13f257c [graphite2] Fix cluster mapping
Patch from Martin Hosken.  I expect this to fix the following bugs:

https://bugs.freedesktop.org/show_bug.cgi?id=75076
https://bugzilla.gnome.org/show_bug.cgi?id=723582
https://bugzilla.redhat.com/show_bug.cgi?id=998812
2014-05-30 17:38:14 -04:00