Commit Graph

407 Commits

Author SHA1 Message Date
Behdad Esfahbod 3e905e396b Add hb_font_set_parent()
No reason to not have it.  Makes life easier later.
We (hb-ft, hb-ot-font, etc) can use this API to inject new
parent into a font...
2015-10-08 12:51:02 -04:00
Behdad Esfahbod 88da7bba9f Default font scale to face upem
Makes for a better default and avoids nasty inheritance issues.
See mailing list thread "Default hb_font_t scale".
2015-10-02 14:38:20 +01:00
Behdad Esfahbod 1866e17114 Make hb_font_create_sub_font() NOT make parent immutable
We don't rely on that.  However, whenever hb_font_make_immutable()
is called, it makes its parenting chain immutable.
2015-10-02 14:21:29 +01:00
Sascha Brawer f2ad935e19 Handle language tags that indicate phonetic IPA transcription
The BCP-47 registry defines a variant subtag "fonipa" that can be used
in combination with arbitrary other language tags. For example,
"rm-CH-fonipa-sursilv" indicates the Sursilvan dialect of Romansh
as used in Switzerland, transcribed used the International Phonetic
Alphabet.

http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry
2015-09-29 14:32:06 +01:00
Behdad Esfahbod b6d7d161a8 [tests] Add Hebrew test for normalization under cluster-level=1
Currently fails.
https://bugzilla.gnome.org/show_bug.cgi?id=541608
2015-09-01 16:12:44 +01:00
Behdad Esfahbod fad2674874 Minor 2015-09-01 14:45:46 +01:00
Behdad Esfahbod 31594b98af [test] Fix test-object
See previous commit.
2015-08-30 17:33:04 +01:00
Behdad Esfahbod 7368da6724 [test] Add test for cursive-positioning with mixed directions
Fails now.  Fix coming.  See thread "Issue with cursive attachment"
started by Khaled.  Test fonts were made by modifying test font
from Khaled to add more anchors.
2015-08-25 20:29:36 +01:00
Behdad Esfahbod f3792342f6 [tests] Add test for fallback positioning with cluster_level > 0
For https://github.com/behdad/harfbuzz/pull/123
Currently fails.  Fix coming.
2015-08-08 18:03:16 +02:00
Romain Naour 160f635523 fix static linking with icu-uc
When linking test-unicode statically it needs $(ICU_LIBS)
which contains all required flags.
Especially -lstdc++.

Fixes:
http://autobuild.buildroot.net/results/210/2107f9dfb39eeb6559fb4271c7af8b39aef521ca/

Signed-off-by: Romain Naour <romain.naour@openwide.fr>
2015-07-31 16:12:26 +02:00
Behdad Esfahbod df6cb84449 Merge branch 'use' 2015-07-26 19:40:55 +02:00
Behdad Esfahbod 786ba45847 [test] Encode Kharoshti text
Ouch!
2015-07-23 13:04:34 +01:00
Behdad Esfahbod b423125503 [test] Add Batak and Buginese test texts 2015-07-23 13:01:55 +01:00
Behdad Esfahbod b8c159ffcc [test] Remove shaper-sea texts under shaper-use 2015-07-23 13:00:44 +01:00
Behdad Esfahbod 67ba7320cc [test] Remove New Tai Lue texts
New Tai Lue changed encoding to visual, boring, model.
2015-07-23 12:58:21 +01:00
Behdad Esfahbod c81d957a26 [test] Add tests for improved 'vert' feature 2015-07-23 12:50:48 +01:00
Behdad Esfahbod 8a6a16dbcb [test] Add recently added test
Ouch.
2015-07-23 12:49:09 +01:00
Behdad Esfahbod 895fb31c7f [test] Support additional options to hb-shape in micro-test suite 2015-07-23 12:14:03 +01:00
Behdad Esfahbod 582069172c Add test case for deleting default ignorables with positioning 2015-07-22 18:44:59 +01:00
Behdad Esfahbod 14b12f92a9 [USE] Add Kharoshti test data from Unicode proposal 2015-07-20 11:57:44 +01:00
Behdad Esfahbod b3a2f6afba [test] Add test for cluster merging
Based on test from https://code.google.com/p/chromium/issues/detail?id=497578

Currently fails.  Basically, if there's a default_ignorable at the
start of text, and font has no space glyph, we remove the default_ignorable,
and that makes the first char in text to correspond to no cluster.

Fix coming.
2015-06-18 17:15:33 -07:00
Behdad Esfahbod 8f0a4d6714 [test] Ignor 'n' and 'i' in hb-unicode-encode
Allows accepting uniXXXX format.
2015-04-23 14:32:33 -07:00
Behdad Esfahbod eb0bf3ae66 Relax inert checks
Previously, when creating an object from inert inputs (eg:
"hb_font_create(hb_face_get_empty())") we returned the inert
empty object.  This is not helpful as there are legitimate
usecases to do that.

We now never return the inert object unless allocation failed.

Tests are revised to reflect.
2015-04-09 19:16:57 -07:00
Behdad Esfahbod 9868749abe [test] Use /usr/bin/env python instead of /usr/bin/python
Bug 76494 - #!/usr/bin/python in testsuite

https://bugs.freedesktop.org/show_bug.cgi?id=76494
2015-04-06 14:51:31 -07:00
Ebrahim Byagowi 363ceec3fb Make hb_test_tools.py compatible with python 3
On ArchLinux, /usr/bin/python is linked to python 3 so
HarfBuzz `make check` is broken there.

This makes hb_test_tools.py compatible with python 3 while
no breaking it on python 2.
2015-03-31 03:06:32 +04:30
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 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 a1f27ac3c4 Update test expectation for previous commit 2014-10-02 16:54:33 -04:00
Behdad Esfahbod 715f27f85f [test] Fixup test 2014-10-01 16:53:00 -04:00
Behdad Esfahbod c4308f895a Minor 2014-08-13 19:42:01 -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 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 ac53443f1c [hangul] Don't apply 'calt'
See comments.

Micro-test added.
2014-07-31 18:54:43 -04:00
Behdad Esfahbod 8292f96b2b [test] Fix record-test.sh 2014-07-31 18:54:43 -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 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 d218bdb26b Fix test runner under Windows 2014-07-22 18:02:11 -04:00
Behdad Esfahbod 00a57eb4b5 [test] Remove unused micro-font 2014-07-18 14:42:50 -04:00
Behdad Esfahbod ed29b15f5d [test] Add more Mongolian variation selector tests
From
https://code.google.com/p/chromium/issues/detail?id=393896
2014-07-18 14:37:49 -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 d21e997035 [test] Make record_test understand cmdline args to hb-shape 2014-07-17 15:30:17 -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 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 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 844f1a487d [tests] Add record-test.sh 2014-07-16 13:32:51 -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 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 24b2ba9dfa [test-buffer] Add test for lonely low-surrogate
Currenty fails.  Ouch!
2014-07-10 19:31:16 -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