Commit Graph

2794 Commits

Author SHA1 Message Date
Primiano Tucci 05870ed62e Use __aarch64__ for 64-bit ARM detection, not __arm64__
Many GCC versions don't define __arm64__
2014-04-02 12:41:11 -07:00
Behdad Esfahbod 04d894e897 Minor 2014-03-25 12:11:32 -07:00
Behdad Esfahbod 903648437c Start fleshing out builtin font functions 2014-03-24 15:19:15 -07:00
Behdad Esfahbod 343a0e4e74 Add "make built-sources" 2014-03-21 14:37:27 -07:00
Konstantin Ritt b96af03c20 Fix build with --coretext on iOS
On iOS CoreText and CoreGraphics are stand-alone frameworks
2014-03-21 10:29:34 -07:00
Behdad Esfahbod 09732cc669 Remove dead warning 2014-03-19 12:00:17 -07:00
Behdad Esfahbod a949cd329e Don't use "register" storage class specifier
Fixes warnings.
https://bugzilla.mozilla.org/show_bug.cgi?id=984081
2014-03-16 20:22:42 -07:00
jfkthame 0082dbeae6 wrap definition of free_langs() with HAVE_ATEXIT
...to avoid an unused function warning; see mozilla bug https://bugzilla.mozilla.org/show_bug.cgi?id=984081.
2014-03-16 13:40:33 -07:00
Behdad Esfahbod a9e25e90a4 [coretext] Add hb_coretext_face_create()
Not tested.
2014-03-14 19:55:46 -07:00
Behdad Esfahbod c79865f90f [coretext] Add coretext_aat shaper
This is a higher-priority shaper than default shaper ("ot"), but
only picks up fonts that have AAT "morx"/"mort" table.

Note that for this to work the font face's get_table() implementation
should know how to return the full font blob.

Based on patch from Konstantin Ritt.
2014-03-14 19:38:58 -04:00
Behdad Esfahbod af1aa362ca If HAVE_ICU_BUILTIN is defined, use hb-icu Unicode callbacks
Useful for Android / Chrome / etc when ICU is built in the same
library as harfbuzz itself.
2014-03-14 15:54:13 -07:00
Behdad Esfahbod 853daf857f Remove old cruft 2014-03-14 15:49:18 -07:00
Behdad Esfahbod bb8ffb581b Use AM_MISSING_PROG for ragel and git 2014-03-04 13:03:51 -08:00
Behdad Esfahbod a82165248c Only do fallback Hebrew composition if no GPOS 'mark' available
Apparently some modern fonts have proper GPOS mark positioning
tables, but undesirable precomposed forms!  See thread
"Hebrew composition to presentation forms" and:

  http://tex.stackexchange.com/questions/156775/having-trouble-with-vowel-positioning-in-ezra-sil-xelatex

Test case: U+fb1d,05d9,05b4
2014-02-18 15:53:56 -05:00
Werner Lemberg db068d81cd typo in ucdn's Makefile.am 2014-02-10 13:05:48 -05:00
Behdad Esfahbod fbb2847f54 Improve MemoryBarrier() implementation
See thread "[HarfBuzz] compilation error of 0.9.26 with MinGW"
started by Werner.
2014-02-05 08:22:06 -05:00
Jonathan Kew 7691a154e5 Ensure hb_script_t can safely hold any hb_tag_t value it's given.
Fixes https://github.com/behdad/harfbuzz/pull/21
2014-01-29 16:09:16 -05:00
Behdad Esfahbod c29993a181 [coretext] Handle surrogate pairs when generating notdef glyphs
Fixes github.com/behdad/harfbuzz/pull/19
2014-01-28 17:29:42 -05:00
Behdad Esfahbod 748b2782e4 [coretext] Minor optimization 2014-01-28 17:10:05 -05:00
Konstantin Ritt 24e6b11f12 Fix double destruction in case of OOM 2014-01-28 11:21:18 -05:00
Konstantin Ritt 083225916a Micro optimizations 2014-01-28 11:14:12 -05:00
Konstantin Ritt c9522de233 Make it possible to disable the fallback shaper at configure time
The OT shaper supersedes the fallback shaper in every case
and the latter become an extra weight for 99.9% of users.
2014-01-28 11:13:53 -05:00
Behdad Esfahbod 6775da3a7c Fix clang warning 'private field 'xxx' is not used
Fixes https://github.com/behdad/harfbuzz/pull/16
2014-01-23 14:18:49 -05:00
Behdad Esfahbod 62299826f4 Fix typo in _hb_buffer_serialize_glyphs_text()
Fixes https://github.com/behdad/harfbuzz/pull/17
2014-01-23 14:11:03 -05:00
Behdad Esfahbod ae23c24c32 [arabic] Disable 'cswh' by default
I believe Windows 8 disables it, and spec update dated
Jan 2014 also clearly says it's disabled by default:

  http://www.microsoft.com/typography/OpenTypeDev/arabic/intro.htm#features
2014-01-22 11:03:02 -05:00
Behdad Esfahbod 08cf5d75ef [ot] Don't try to compose if normalization is off 2014-01-22 07:53:55 -05:00
Behdad Esfahbod 0596343bfe Merge pull request #13 from jfkthame/hangul-shaper
Tone-mark reordering and improved Old Hangul support
2014-01-22 04:43:51 -08:00
Jonathan Kew 62cb28dfc6 fixup for 64-bit windows build 2014-01-22 07:31:54 -05:00
Jonathan Kew 83d7e7915a [hangul] Fix ordering of dotted circle with Hangul tone mark (reported by Dohyun Kim). 2014-01-20 19:49:47 +00:00
Jonathan Kew deef186265 [hangul] Don't force zero-width for marks - this is not wanted for the Jamo Filler glyphs. 2014-01-20 10:38:27 +00:00
Jonathan Kew 391934db0a [unicode] Exclude the Jamo Filler characters from Default_Ignorable, as some fonts want these to be visible/spacing glyphs. 2014-01-20 10:37:32 +00:00
Jonathan Kew 7244b3fc3b [hangul] Reorder Hangul tone mark to beginning of syllable, unless font implements it using a zero-width glyph. 2014-01-20 10:35:51 +00:00
Jonathan Kew 103436838d [hangul] Apply the appropriate *jmo features to decomposed syllables, including Old Hangul sequences that don't have Unicode compositions. Merge clusters in decomposed syllables. 2014-01-20 10:35:07 +00:00
Behdad Esfahbod 8fc1f7fe74 [ot/hangul] Don't decompose Hangul even when combining marks present
As discussed on
https://github.com/behdad/harfbuzz/pull/10#issuecomment-31442030
2014-01-02 17:04:04 +08:00
Behdad Esfahbod 64426ec73a [ot] Simplify composing
Not tested.  Ouch.
2014-01-02 14:33:10 +08:00
Behdad Esfahbod 8de20b1e8a Add font->has_glyph() 2014-01-02 14:30:45 +08:00
Behdad Esfahbod f6298e55ae [fallback] Minor 2014-01-02 14:23:56 +08:00
Behdad Esfahbod 29ea403d67 [hangul] Fix decomposition logic
Seems to be working now.
2014-01-02 14:20:00 +08:00
Behdad Esfahbod bdb20dafc3 [hangul] Fix decomposition
Part of https://github.com/behdad/harfbuzz/pull/10
2014-01-02 14:04:30 +08:00
Behdad Esfahbod 32478656ce [hangul] Tighten up character categories
I had tried to expand to fill the blocks, but that sounds wrong in
retrospect.
2014-01-02 14:01:56 +08:00
Behdad Esfahbod f14bb7de63 [ot] Separate out hebrew and tibetan shapers from default
Now default shaper is truly no-op.
2013-12-31 16:49:15 +08:00
Behdad Esfahbod 6300cd7253 [ot] Define HB_OT_SHAPE_ZERO_WIDTH_MARKS_DEFAULT 2013-12-31 16:38:47 +08:00
Behdad Esfahbod 3d6ca0d32e [ot] Simplify normalization_preference again
No shaper has more than one behavior re this, so no need for a callback.
2013-12-31 16:35:37 +08:00
Behdad Esfahbod c98b7183f7 [ot] Add Hangul shaper
Not exhaustively tested, but I think I got the intended logic
right.

The logic can perhaps be simplified.  Maybe we should disabled
normalization with this shaper.  Then again, for now focusing on
correctness.
2013-12-31 16:23:48 +08:00
Behdad Esfahbod 15f67048e4 Reorder Tai Tham SAKOT to ensure it comes after any tone marks 2013-12-27 19:33:28 -05:00
Behdad Esfahbod 3216e44feb [uniscribe] Fix scratch-buffer accounting 2013-12-23 14:39:23 -05:00
Behdad Esfahbod beeb12c9af Add TODO item 2013-12-22 22:53:27 -05:00
Luis de Bethencourt fbd4acc58a Clean ht-ob headers 2013-12-22 22:52:57 -05:00
Behdad Esfahbod 5497a8a274 Cache various masks on the shape plan 2013-12-22 20:48:53 -05:00
Behdad Esfahbod 02f909664f Minor correction to kern mask checking 2013-12-22 19:35:27 -05:00
Behdad Esfahbod a7e8bbb080 Minor fraction mask setting improvement 2013-12-22 19:33:35 -05:00
Behdad Esfahbod 76fff252a9 Don't form fractions if only one of numr/dnom exist 2013-12-22 17:55:59 -05:00
Behdad Esfahbod 3aeee519f0 Bug 72698 - Automatically support frac / numr / dnom
When seeing U+2044 FRACTION SLASH in the text, find decimal
digits (Unicode General Category Decimal_Number) around it,
and mark the pre-slash digits with 'numr' feature, the post-slash
digits with 'dnom' feature, and the whole sequence with 'frac'
feature.

This beautifully renders fractions with major Windows fonts,
and any other font that implements those features (numr/dnom is
enough for most fonts.)

Not the fastest way to do this, but good enough for a start.
2013-12-22 16:17:54 -05:00
Behdad Esfahbod 014f369ec9 Add XXX note 2013-12-22 16:15:30 -05:00
Behdad Esfahbod 739325178a Initialize masks before mirroring
We were throwing away the rtlm feature mask set during
mirroring...
2013-12-21 00:18:18 -05:00
Behdad Esfahbod 2a8c49ade0 Remove unnecessary includes 2013-12-11 20:24:20 -05:00
Behdad Esfahbod 205bf834d8 Revert "Karen" language mapping back to what it was before
https://bugzilla.mozilla.org/show_bug.cgi?id=941470
2013-12-02 20:41:41 -05:00
Behdad Esfahbod f47b921954 Fix unsafe shape_plan->face dependency 2013-12-02 05:57:27 -05:00
Jonathan Kew ca8d96c8ba cache shape plans even if (global) user features are set 2013-12-02 05:22:00 -05:00
Behdad Esfahbod 8ffa528f28 Add note about unsafe shape_plan->face
Will fix by removing shape_plan->face completely.
2013-12-02 05:17:14 -05:00
Behdad Esfahbod aec468f01e [coretext] Add TODO 2013-11-29 19:21:58 -05:00
Behdad Esfahbod 58cc233e8b [coretext] Cleanup 2013-11-29 19:17:42 -05:00
Khaled Hosny c8213c6198 [coretext] Avoid font fallback with CoreText shaper
CoreText does automatic font fallback (AKA "cascading") for  characters
not supported by the requested font, and provides no way to turn it off,
so detect if the returned run uses a font other than the requested one
and fill in the buffer with .notdef glyphs instead of random indices
glyph from a different font.
2013-11-29 19:01:56 -05:00
Behdad Esfahbod 63bae73aef [fallback] Add TODO note 2013-11-26 22:57:24 -05:00
Behdad Esfahbod e1ebf01d0c Minor 2013-11-26 18:00:35 -05:00
Behdad Esfahbod a182dbc9e4 Minor 2013-11-26 17:53:41 -05:00
Behdad Esfahbod 9174a9db5c [myanmar] Allow punctuation clusters
The spec and Uniscribe don't allow these, but UTN#11
specifically says the sequence U+104B,U+1038 is valid.
As such, allow all "P V" sequences.  There's about
eight sequences that match that structure, but Roozbeh
thinks it's fine to allow all of them.

Test case: U+104B, U+1038

https://bugs.freedesktop.org/show_bug.cgi?id=71947
2013-11-25 18:10:38 -05:00
Behdad Esfahbod 096b71e8ef [myanmar] Mark U+104E MYANMAR SYMBOL AFOREMENTIONED as Consonant
The spec and Uniscribe treat it as consonant in the grammar, but
it's not in IndicSyllableCategory.txt, so fix up.

Test sequence: U+1004,U+103A,U+1039,U+104E

https://bugs.freedesktop.org/show_bug.cgi?id=71948
2013-11-25 18:03:34 -05:00
Behdad Esfahbod d2da5e0b4b [myanmar] Relax pwo-tone group a bit
This is broken sequence according to OpenType spec, Uniscribe,
and current HarfBuzz implementation.  But Roozbeh says this
is a valid sequence, so allow it.  There are multiple
"(DB As?)?" constructs in the grammar, but Roozbeh thinks only
this one needs changing.

Test case: 1014,1063,103A

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=71949
2013-11-25 17:50:07 -05:00
Roozbeh Pournader 08c2d27d35 Added support for several new languages
Based on research into latest SIL and Windows fonts, pulling in
the latest OpenType language tag proposal from Microsoft, and updating
to latest language tags and names from ISO 639.
2013-11-25 06:36:20 -05:00
Roozbeh Pournader 05511acd19 Added language tags for S'gaw Karen and Khamti
Tags based on support in Windows 8.1's 'Myanmar Text' font.
2013-11-25 06:36:13 -05:00
Behdad Esfahbod 0bb31e4497 Bug 71845 - Use 64-bit cmpexch on ARM64 iOS 2013-11-20 14:21:07 -05:00
Behdad Esfahbod 02c6c8cd6e Set buffer content type to INVALID in hb_buffer_set_length(0)
Previously we were only setting this in hb_buffer_clear_contents(),
but set_length(0) is a valid way to reinitialize buffer to use with
new text.
2013-11-15 13:07:03 -05:00
Behdad Esfahbod 061cb46493 Use long alignment for scratch buffer
Fixes last of scratch alignment warnings in hb-coretext.
2013-11-13 14:50:25 -05:00
Behdad Esfahbod 68c372ed2e More scratch-buffer cleanup 2013-11-13 14:45:43 -05:00
Behdad Esfahbod 8fcadb9cf9 [coretext] More scratch buffer fixes 2013-11-13 14:33:57 -05:00
Behdad Esfahbod 16f175cb2e Fix scratch-buffer alignment warnings 2013-11-12 17:22:49 -05:00
Behdad Esfahbod 83408cf804 Fix llvm warnings on Mac
Patch from Scott Fleischman.  Warnings were:

harfbuzz/src/hb-font-private.hh:121:42: Implicit conversion loses
integer precision: 'long long' to 'hb_position_t' (aka 'int')
harfbuzz/src/hb-font-private.hh:126:42: Implicit conversion loses
integer precision: 'long long' to 'hb_position_t' (aka 'int')
harfbuzz/src/hb-font-private.hh:400:85: Implicit conversion loses
integer precision: 'long long' to 'hb_position_t' (aka 'int')
harfbuzz/src/hb-ot-layout-common-private.hh:1115:37: Implicit conversion
loses integer precision: 'long long' to 'int'
harfbuzz/src/hb-ft.cc:421:97: Implicit conversion loses integer
precision: 'unsigned long long' to 'int'
harfbuzz/src/hb-ft.cc:422:97: Implicit conversion loses integer
precision: 'unsigned long long' to 'int'
2013-11-06 14:46:04 -05:00
Behdad Esfahbod 333cc6e2d1 [otlayout] Remove unused is_inplace()
Patch from Jonathan Kew.
2013-10-30 17:30:11 +00:00
Behdad Esfahbod 176fd17d02 Bug 70971 - Signed/unsigned compiler warnings on windows
Patch from Emil Eklund.
2013-10-30 17:27:24 +00:00
Behdad Esfahbod 3d436d325e [otlayout] Reset ccc when marking glyph as letter 2013-10-28 21:00:37 +01:00
Behdad Esfahbod 6ffc007b61 [otlayout] Optimize inplace
See thread started by Jonathan with subject "an optimization for complex
fonts".
2013-10-28 19:26:02 +01:00
Behdad Esfahbod 71b4c999a5 Revert "Zero marks by GDEF for Tibetan"
This reverts commit d5bd0590ae.

The reasoning behind that logic was flawed and made under
a misunderstanding of the original problem, and caused
regressions as reported by Jonathan Kew in thread titled
"tibetan marks" in Oct 2013.  Apparently I have had fixed
the original problem with this commit:

  7e08f1258d

So, revert the faulty commit and everything seems to be in good
shape.
2013-10-28 00:43:27 +01:00
Behdad Esfahbod c2bc818706 Work with old and new glib
Avoids "deprecated" warnings.
2013-10-27 23:37:14 +01:00
Behdad Esfahbod 46a863d91d [indic] Adjust pref reordering logic
For Javanese (pref_len == 1) only reorder if it didn't ligate.  That's
sensible, and what the spec says.  For other Indic (pref_len > 1)
only reorder if ligated.

Doesn't change any test numbers.
2013-10-27 23:28:12 +01:00
Behdad Esfahbod 6b03e3c724 Optimize fallback kerning
Patch from Jonathan Kew.  "These changes seem to yield a small but
just-about-measurable improvement with old fonts that lack GPOS
kerning."
2013-10-27 21:04:55 +01:00
Behdad Esfahbod 133eeba6a3 Minor
See:
https://github.com/prezi/harfbuzz-js/pull/1/files#r7032397
2013-10-27 00:24:59 +02:00
Behdad Esfahbod a74f0de225 [indic] Fix CM2, really
Followup from 6e613f3365.
2013-10-24 11:46:33 +02:00
Behdad Esfahbod 6e613f3365 Fix "shift count >= width of type" issue 2013-10-23 23:34:13 +02:00
Behdad Esfahbod ac8cd51191 Refactor 2013-10-18 19:33:09 +02:00
Behdad Esfahbod 0f3fe37fcc Comment 2013-10-18 19:14:22 +02:00
Behdad Esfahbod ddce2d8df6 [indic] Improve positioning of post-base bells and whistles
Bug 58714 - Kannada u+0cb0 u+200d u+0ccd u+0c95 u+0cbe does not provide
same results as Windows8
https://bugs.freedesktop.org/show_bug.cgi?id=58714

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

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

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

This is useful for Javanese which has an atomically encoded pre-base
reordering Ra which should only be reordered if it was substituted
by the pref feature.
2013-10-18 11:25:24 +02:00