Commit Graph

7018 Commits

Author SHA1 Message Date
Michiharu Ariza 9ae954f43a Merge branch 'master' into cff-subset 2018-11-30 15:00:52 -08:00
Behdad Esfahbod fedd8e6c17 One more.........
I wonder if there's something better to do about these :(.

In file included from hb-ot-color.cc:31:
hb-ot-color-cpal-table.hh: In member function 'unsigned int OT::CPAL::get_size() const':
hb-ot-color-cpal-table.hh:118: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
2018-11-30 16:50:30 -05:00
Behdad Esfahbod bc5db9b080 One more....
hb-ot-vorg-table.hh:96: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
hb-vector.hh:87: note: candidate 1: const Type& hb_vector_t<Type, PreallocedCount>::operator[](unsigned int) const [with Type = OT::VertOriginMetric, unsigned int PreallocedCount = 8u]
hb-ot-vorg-table.hh:96: note: candidate 2: operator[](const T*, int) <built-in>
2018-11-30 16:04:52 -05:00
Behdad Esfahbod d39760cabf One more...
Sigh.

hb-ot-kern-table.hh: In member function 'int OT::KernSubTableFormat3<KernSubTableHeader>::get_kerning(hb_codepoint_t, hb_codepoint_t) const':
hb-ot-kern-table.hh:59: error: ambiguous overload for 'operator[]' in 'kernValue[kernIndex[i]]'
hb-ot-kern-table.hh:59: note: candidates are: operator[](T*, int) <built-in>
hb-dsalgs.hh:574: note:                 Type& hb_array_t<Type>::operator[](unsigned int) const [with Type = const OT::IntType<short int, 2u>]
2018-11-30 15:55:30 -05:00
Behdad Esfahbod 9c6921c08c More...
hb-ot-layout-gsubgpos.hh:1707: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
...
2018-11-30 15:16:57 -05:00
Behdad Esfahbod f998bb2086 More weird fixes
In file included from hb-ot-name.cc:29:
hb-ot-name-table.hh: In member function 'unsigned int OT::name::get_size() const':
hb-ot-name-table.hh:157: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
hb-open-type.hh:354: note: candidate 1: const Type& OT::UnsizedArrayOf<Type>::operator[](unsigned int) const [with Type = OT::NameRecord]
hb-ot-name-table.hh:157: note: candidate 2: operator[](const T*, int) <built-in>
hb-ot-name-table.hh: In member function 'void OT::name::accelerator_t::init(hb_face_t*)':
hb-ot-name-table.hh:196: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
hb-dsalgs.hh:574: note: candidate 1: Type& hb_array_t<Type>::operator[](unsigned int) const [with Type = const OT::NameRecord]
hb-ot-name-table.hh:196: note: candidate 2: operator[](T*, int) <built-in>
hb-ot-name-table.hh:197: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
hb-dsalgs.hh:574: note: candidate 1: Type& hb_array_t<Type>::operator[](unsigned int) const [with Type = const OT::NameRecord]
hb-ot-name-table.hh:197: note: candidate 2: operator[](T*, int) <built-in>
hb-ot-name-table.hh:198: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
hb-dsalgs.hh:574: note: candidate 1: Type& hb_array_t<Type>::operator[](unsigned int) const [with Type = const OT::NameRecord]
hb-ot-name-table.hh:198: note: candidate 2: operator[](T*, int) <built-in>
make[4]: *** [libharfbuzz_la-hb-ot-name.lo] Error 1
make[3]: *** [all-recursive] Error 1
2018-11-30 12:52:21 -05:00
Behdad Esfahbod abd81ed4f5 Umm. Cryptic, yes
In file included from hb-face.cc:35:
hb-ot-cmap-table.hh: In member function 'void OT::CmapSubtableFormat4::_compiles_assertion_on_line_388() const':
hb-ot-cmap-table.hh:388: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
hb-open-type.hh:354: note: candidate 1: const Type& OT::UnsizedArrayOf<Type>::operator[](unsigned int) const [with Type = OT::IntType<short unsigned int, 2u>]
hb-ot-cmap-table.hh:388: note: candidate 2: operator[](const T*, int) <built-in>
hb-ot-cmap-table.hh: In member function 'void OT::CmapSubtableFormat4::_instance_assertion_on_line_388() const':
hb-ot-cmap-table.hh:388: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
hb-open-type.hh:354: note: candidate 1: const Type& OT::UnsizedArrayOf<Type>::operator[](unsigned int) const [with Type = OT::IntType<short unsigned int, 2u>]
hb-ot-cmap-table.hh:388: note: candidate 2: operator[](const T*, int) <built-in>
hb-face.cc: In function 'hb_blob_t* _hb_face_builder_data_reference_blob(hb_face_builder_data_t*)':
hb-face.cc:650: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
hb-vector.hh:81: note: candidate 1: Type& hb_vector_t<Type, PreallocedCount>::operator[](unsigned int) [with Type = hb_face_builder_data_t::table_entry_t, unsigned int PreallocedCount = 32u]
hb-face.cc:650: note: candidate 2: operator[](T*, int) <built-in>
hb-face.cc:650: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
hb-vector.hh:81: note: candidate 1: Type& hb_vector_t<Type, PreallocedCount>::operator[](unsigned int) [with Type = hb_face_builder_data_t::table_entry_t, unsigned int PreallocedCount = 32u]
hb-face.cc:650: note: candidate 2: operator[](const T*, int) <built-in>
hb-face.cc:651: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
hb-vector.hh:81: note: candidate 1: Type& hb_vector_t<Type, PreallocedCount>::operator[](unsigned int) [with Type = hb_face_builder_data_t::table_entry_t, unsigned int PreallocedCount = 32u]
hb-face.cc:651: note: candidate 2: operator[](T*, int) <built-in>
hb-face.cc:651: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
hb-vector.hh:81: note: candidate 1: Type& hb_vector_t<Type, PreallocedCount>::operator[](unsigned int) [with Type = hb_face_builder_data_t::table_entry_t, unsigned int PreallocedCount = 32u]
hb-face.cc:651: note: candidate 2: operator[](const T*, int) <built-in>
2018-11-30 11:52:41 -05:00
Behdad Esfahbod 0f32c95e14 Fix a few more sizeof(vector[0]) errors with weird compilers 2018-11-30 11:31:39 -05:00
Behdad Esfahbod 88630a458b Fix build for realz 2018-11-30 01:11:04 -05:00
Behdad Esfahbod 346286d04e Fix build 2018-11-30 00:44:40 -05:00
Behdad Esfahbod 31f39cb41e [post] Rename v2 to v2X 2018-11-30 00:38:08 -05:00
Behdad Esfahbod e3dd47e602 Move things 2018-11-30 00:32:12 -05:00
Behdad Esfahbod 27a6b0a2f7 Fix build for realz 2018-11-29 16:29:30 -05:00
Behdad Esfahbod e2af4dd1ec [uniscribe] Fix build 2018-11-29 16:03:24 -05:00
Ebrahim Byagowi e7bd29ea11
Limit __builtin_bswap16 to GCC >= 5 as it was implemented on 4.8 2018-11-29 23:47:20 +03:30
Behdad Esfahbod ac0264717b [coretext] Fix compile
Fingers crossed.
2018-11-29 15:07:44 -05:00
Behdad Esfahbod 5c4fead734 Convert "static const hb_tag_t" constants to enum 2018-11-29 15:05:47 -05:00
Behdad Esfahbod 9e4138c825 Convert misc "static const" constants to enum 2018-11-29 15:01:10 -05:00
Behdad Esfahbod 44cbd2ea3d Convert "static const bool" constants to anonymous enum 2018-11-29 14:56:27 -05:00
Behdad Esfahbod 861bc75349 [vector] Make pointer cast explicit
Too bad this doesn't help MSVC 2008 build, as explicit operators are
C++11.
2018-11-29 14:34:44 -05:00
Behdad Esfahbod 72955e6825 Hand-hold older compilers 2018-11-29 14:28:44 -05:00
Behdad Esfahbod 000d4b128e Make shaper's override_features() override user features as well
The override_features is used to override features that are normally
discretionary features, but in a specific shaper are for various
reasons desired to be bolted on or off, because they've been used
for inherent shaping.  As such, it makes sense that they also
override user features.  Ie. if user turned 'liga' on, we don't
want Khmer shaping to become broken...  Or turn 'clig' off...

Fixes https://github.com/harfbuzz/harfbuzz/issues/1310
2018-11-29 12:32:47 -05:00
Behdad Esfahbod a95d9d8c84 [khmer] Move 'clig' to overrides
Prerequisite for https://github.com/harfbuzz/harfbuzz/issues/1310
2018-11-29 12:32:04 -05:00
Behdad Esfahbod 282ce7230b Fix "typename outside template" issues
Nothing an extra template class wouldn't fix...

Fixes https://github.com/harfbuzz/harfbuzz/issues/1419
2018-11-29 12:18:14 -05:00
Behdad Esfahbod dc41ecef85 2.2.0 2018-11-29 11:53:53 -05:00
Behdad Esfahbod 7b85081be4 [icu] Minor 2018-11-29 11:34:22 -05:00
Behdad Esfahbod 0bcb1de126
Merge pull request #1418 from gvictor/replace_icu_deprecated
Replace @Deprecated ICU API - USCRIPT_CODE_LIMIT
2018-11-29 10:39:18 -05:00
Michiharu Ariza 471db3aa6f workaround for issue #1417 2018-11-28 17:06:11 -08:00
Michiharu Ariza 32d291ae89 Merge branch 'master' into cff-subset 2018-11-28 16:27:45 -08:00
Behdad Esfahbod 42a2b496e4 [kerx] Fix Format2 index calc again 2018-11-28 15:24:30 -05:00
Behdad Esfahbod a3267cf803 [kern] Fix kern table Format2 offsetToIndex
Fixes https://github.com/harfbuzz/harfbuzz/issues/1421
2018-11-28 15:06:01 -05:00
Behdad Esfahbod f9a9c0fd1e [kerx] Fix ClassTable implementation for 'kern' table Format 2 2018-11-28 14:51:56 -05:00
Behdad Esfahbod 5b4a789ca8 [aat] Towards adding two ClassTable's 2018-11-28 14:49:45 -05:00
Behdad Esfahbod 987f418772
Merge pull request #1398 from Adenilson/bigInt01
Optimize harfbuzz big integer conversions
2018-11-27 17:40:32 -05:00
Behdad Esfahbod 4e2a03b6b6
Comment 2018-11-27 17:40:09 -05:00
Adenilson Cavalcanti 4a719a7f4c Optimize harfbuzz big integer conversions
Profiling showed that type conversions were adding considerable cycles in time
spent doing text shaping.

The idea is to optimize it using native processor instructions to help Blink
layout performance.

Doing further investigation revelead that compilers may not use the
proper instruction on ARM 32bits builds (i.e. REV16).

One way to insure that the generated ASM was ideal for both gcc/clang
was using __builtin_bswap16.

Added bonus is that we no longer need to test for CPU architecture.
2018-11-27 13:43:05 -08:00
Victor Chang a85886fc77 Replace @Deprecated ICU API - USCRIPT_CODE_LIMIT
Use of the deprecated API USCRIPT_CODE_LIMIT prevents harfbuzz
using the ICU4C as a shared library.

The API has been replaced by u_getIntPropertyMaxValue(UCHAR_SCRIPT)
2018-11-27 11:51:45 +00:00
Behdad Esfahbod 574d888c8a [aat] Ignore GSUB table of Muthu Foundry if they have morx table
Fixes https://github.com/harfbuzz/harfbuzz/issues/1410
2018-11-25 16:51:22 -05:00
Behdad Esfahbod 4151c2848d [GDEF] Move more code 2018-11-25 16:38:36 -05:00
Behdad Esfahbod 4f21703f22 [GDEF] Move code around 2018-11-25 15:59:18 -05:00
Behdad Esfahbod 4ed9fb1a00 [GDEF] Minor 2018-11-25 15:53:20 -05:00
Behdad Esfahbod 926f512f35 [aat.feat] Rework API and implementation
Fixes https://github.com/harfbuzz/harfbuzz/pull/1346
2018-11-25 01:16:02 -05:00
Behdad Esfahbod 84dacbca7e [aat.feat] Add _MAX_VALUE to enums 2018-11-25 01:16:02 -05:00
Behdad Esfahbod 3922aae162 [aat.feat] Minor 2018-11-25 01:16:02 -05:00
Behdad Esfahbod 0f8e98eca2 [aat.feat] Whitespace 2018-11-25 01:16:02 -05:00
Behdad Esfahbod c225606833 [aat.feat] Port to SortedUnsizedArrayOf.bsearch() 2018-11-25 01:16:02 -05:00
Behdad Esfahbod 52ae9867ef [AAT.feat] Use lsearch for looking up SettingName's
They are not sorted.
2018-11-25 01:16:02 -05:00
Behdad Esfahbod 44b9331f66 [aat] Fix include issues 2018-11-25 01:16:02 -05:00
Behdad Esfahbod b206133d1f [aat] Move contents of hb-aat.h to hb-aat-layout.h
Since it was pages and pages...
2018-11-25 01:16:02 -05:00
Behdad Esfahbod 2cb235d021 [aat.feat] Fix enum namespace 2018-11-25 01:16:02 -05:00
Behdad Esfahbod 712762cabb Minor 2018-11-25 01:16:02 -05:00
Behdad Esfahbod e20f81f4fa [aat] Rename feat API a bit more 2018-11-25 01:16:02 -05:00
Ebrahim Byagowi 54f4c17f0a [feat] Rename API uses of setting to selector 2018-11-25 01:16:02 -05:00
Ebrahim Byagowi 9c64b216ec [feat] Apply renamings and add documentation 2018-11-25 01:16:02 -05:00
Ebrahim Byagowi a8726cb483 [feat] Use bsearch 2018-11-25 01:16:02 -05:00
Ebrahim Byagowi 4009a05ca7 [feat] Address Behdad comments 2018-11-25 01:16:02 -05:00
Ebrahim Byagowi 19b6025534 [feat] Address @behdad comments 2018-11-25 01:16:02 -05:00
Ebrahim Byagowi 9212ec203c [feat] Complete feature types list 2018-11-25 01:16:02 -05:00
Ebrahim Byagowi fbad794bd2 [feat] Add feature iteration API 2018-11-25 01:16:02 -05:00
Ebrahim Byagowi 7a0471aa35 [feat] Turn AAT feature id into enum 2018-11-25 01:16:02 -05:00
Ebrahim Byagowi b233fa4bc9 [feat] Rename records to selectors as @drott 2018-11-25 01:16:02 -05:00
Ebrahim Byagowi a157b3e4eb [feat] Apply @behdad comments 2018-11-25 01:16:02 -05:00
Ebrahim Byagowi 3aff3f822f [feat] Apply @drott and @jfkthame comments 2018-11-25 01:16:02 -05:00
Ebrahim Byagowi b791bbbae4 [feat] Apply @jfkthame reviews 2018-11-25 01:16:01 -05:00
Ebrahim Byagowi 95abd53758 [feat] Expose public API
* hb_aat_get_feature_settings
2018-11-25 01:16:01 -05:00
Behdad Esfahbod 9326912941 [kerx] Fix crash 2018-11-25 00:27:23 -05:00
Behdad Esfahbod 6ee401049d Simplify sanitize set_object() / fix bots 2018-11-25 00:21:13 -05:00
Behdad Esfahbod c5a6b355e1 [kerx] Port to hb_sanitize_with_object_t 2018-11-24 23:49:23 -05:00
Behdad Esfahbod c405ed0509 [morx] Port to hb_sanitize_with_object_t 2018-11-24 23:46:15 -05:00
Behdad Esfahbod 1e8994221f Add hb_sanitize_with_object_t
Context manager.
2018-11-24 23:38:06 -05:00
Behdad Esfahbod b3c5affc05 Simplify sanitize set_object() 2018-11-24 23:34:34 -05:00
Behdad Esfahbod 3d30972699 [aat] Skip terminator in VarSizedBinSearchArray<>
Fixes shaping with Apple Chancery on 10.13 again.  In that font,
there was a terminator segment, that was tripping off sanitize().
2018-11-24 23:12:28 -05:00
Behdad Esfahbod 4202a3cde3 Minor 2018-11-24 22:49:50 -05:00
Behdad Esfahbod 1c2302bbf1 [debug] Print function in return_trace() 2018-11-24 22:32:17 -05:00
Behdad Esfahbod 748198a671 Revert "[aat.morx] Remove set_object() business"
This reverts commit ae8ed58a6e.

Apparently this broke Apple Chancery from OS X 10.12 :(.
Investigating...
2018-11-24 22:16:59 -05:00
Behdad Esfahbod c8a2dc820e Revert "[aat.kerx] Remove kerx subtable boundary enforcement"
This reverts commit 15905a2a29.
2018-11-24 22:16:53 -05:00
Behdad Esfahbod 9eeebd8dde Revert "[sanitize] Remove now-unused set_object() machinery"
This reverts commit bbdb6edb3e.
2018-11-24 22:16:47 -05:00
Behdad Esfahbod f47c5da0aa [arrays] Use hb_array_t<> in all places with sub_array() 2018-11-24 21:36:57 -05:00
Behdad Esfahbod 3246a8ebbd [arrays] Merge ArrayOf's sub_array into hb_array_t's 2018-11-24 21:32:00 -05:00
Behdad Esfahbod bbdb6edb3e [sanitize] Remove now-unused set_object() machinery 2018-11-24 17:15:38 -05:00
Behdad Esfahbod 15905a2a29 [aat.kerx] Remove kerx subtable boundary enforcement
Have not encountered fonts needing this, but same reasoning as
for morx (see previos commit.)
2018-11-24 17:14:39 -05:00
Behdad Esfahbod ae8ed58a6e [aat.morx] Remove set_object() business
With OS X 10.13 Apple Chancery fails to ligate if we limit each morx
sub-chain to its declared length.  Perhaps their newer compiler does
object-sharing across sub-chains.  Anyway, since that's a valid, if
unspecified, way to compile tables, remove enforcement.

Probably do the same with kern/kerx.
2018-11-24 17:14:09 -05:00
Behdad Esfahbod 20edc70d53 [morx/kerx] Fix sanitize regression
Broke in 8dcc1913a1

If sanitizer is left with another object, it wouldn't work.

Better fix coming soon.
2018-11-24 14:53:05 -05:00
Behdad Esfahbod ae96c98dfa [color] Use SortedUnsizedArrayOf<> 2018-11-24 10:25:10 -05:00
Behdad Esfahbod 4a3b20738f [trak] Coment 2018-11-24 10:17:59 -05:00
Behdad Esfahbod 918b1ee54d [arrays] Add not_found to reference bsearch as well 2018-11-24 10:09:17 -05:00
Behdad Esfahbod d77a098b73 [arrays] Improve bfind() interface
Much more useful now. :)
2018-11-24 10:06:13 -05:00
Behdad Esfahbod 8dcc1913a1 [kerx/morx] Make sure object length is sanitized before accessing it 2018-11-24 09:48:06 -05:00
Behdad Esfahbod 70d80c90fe [arrays] Port ArrayOf.qsort() and hb_vector_t.qsort() to hb_array_t 2018-11-24 09:48:06 -05:00
Behdad Esfahbod 073d837aa2 [arrays] Port ArrayOf.qsort() to hb_array_t's 2018-11-24 09:48:06 -05:00
Behdad Esfahbod ad5c871d80 [arrays] Add copy-constructor to hb_array_t and hb_sorted_array_t 2018-11-24 09:48:06 -05:00
Behdad Esfahbod 61de55bf49 [arrays] Port hb_vector_t.qsort() to hb_array_t's 2018-11-24 09:48:06 -05:00
Behdad Esfahbod e3face8e79 [arrays] Remove one flavor of hb_vector_t.qsort() 2018-11-24 09:48:06 -05:00
Behdad Esfahbod 7c1600dcd9 [arrays] Add (unused) SortedUnsizedArrayOf<> 2018-11-24 09:48:06 -05:00
Behdad Esfahbod e700392f5c [arrays] Port SortedArrayOf.bsearch/bfind to hb_sorted_array_t's 2018-11-24 09:48:06 -05:00
Behdad Esfahbod e604306f28 [arrays] Port hb_vector_t.bsearch/bfind to (new) hb_sorted_array_t's 2018-11-24 09:48:06 -05:00
Behdad Esfahbod 268eca2492 [arrays] Port (unused) ArrayOf.lsearch() to hb_array_t's 2018-11-24 09:48:06 -05:00
Behdad Esfahbod 830856ba6b [arrays] Port hb_vector_t.lsearch() to hb_array_t's 2018-11-24 09:48:06 -05:00
Behdad Esfahbod 96cf088980 [arrays] More 2018-11-24 09:48:06 -05:00
Behdad Esfahbod 3e26c8d2b1 [arrays] Update ArrayOf.lsearch()
Currently unused apparently
2018-11-24 09:48:06 -05:00
Behdad Esfahbod 22e1857b01 [arrays] Change argument type of cmp called by hb_vector_t.bsearch()
Towards consolidating all array bsearch/...
2018-11-24 09:48:06 -05:00
Behdad Esfahbod 30cb45b3ea Change ArrayOf.bsearch() return semantics
Towards consolidating all array bsearch/...
2018-11-24 00:48:26 -05:00
Behdad Esfahbod 5cd9546ba7 Minor 2018-11-24 00:46:07 -05:00
Behdad Esfahbod fd94e729cb Whitespace 2018-11-24 00:46:07 -05:00
Behdad Esfahbod bb2a206508 Assert that item-type of arrays have static size 2018-11-24 00:31:40 -05:00
Behdad Esfahbod 690d9eb83d [vector] Rename 2018-11-24 00:29:22 -05:00
Behdad Esfahbod ba38378fd4 [aat] Minor 2018-11-24 00:27:57 -05:00
Behdad Esfahbod 39b9d63b01 Add hb_static_size(T) 2018-11-24 00:25:40 -05:00
Behdad Esfahbod f99abcc379 Add template-function convenience macros 2018-11-24 00:24:01 -05:00
Behdad Esfahbod ec83b2228e Add null bytes for CmapSubtableLongGroup 2018-11-23 19:59:31 -05:00
Behdad Esfahbod e2ffb33a53 Remove lsearch for small TableDirectorys 2018-11-23 16:24:28 -05:00
Behdad Esfahbod 04f7e55369 [arrays] Add as_array() to hb_vector_t<> 2018-11-23 16:07:43 -05:00
Behdad Esfahbod c514f65181 [arrays] Add as_array() to ArrayOf<> 2018-11-23 16:04:56 -05:00
Behdad Esfahbod 9552f4ef0d [kern] Don't enforce length of last subtable 2018-11-23 15:24:17 -05:00
David Corbett 018ba46e4d Don't canonicalize '@' to '-' in language tags
Fixes #1406.
2018-11-23 13:21:22 -05:00
Behdad Esfahbod 748962264a [aat] Disable mark advance zeroing if kern table has state-machines
Geeza Pro for example, relies on that for fancy mark positioning.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1405
2018-11-23 11:10:17 -05:00
Behdad Esfahbod 3d2b98ef14 Minor 2018-11-23 10:58:43 -05:00
Behdad Esfahbod 22798e93c4 [use] Minor clarification 2018-11-22 22:47:51 -05:00
Behdad Esfahbod a2d6c1075a Minor tweak to FLAG64 2018-11-22 22:40:57 -05:00
Behdad Esfahbod 8280459e74
Merge pull request #1291 from harfbuzz/use-reordering
[use] Fix reordering
2018-11-22 22:39:12 -05:00
Behdad Esfahbod e4a4555d1e [cmap] Move code around 2018-11-22 22:17:49 -05:00
Behdad Esfahbod 758c9d68e2 [morx/kerx] Limit range to subtable when sanitizing 2018-11-22 22:16:12 -05:00
Behdad Esfahbod a9fe787a11 [sanitizer] Add reset_object(), make set_object() do bounds-check
Affects morx/kerx run-time only currently.  Will adjust their sanitize next.
2018-11-22 22:12:36 -05:00
Behdad Esfahbod 2c8188bf59 [kerx] Make sure subtables are non-zero-length
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11400
2018-11-22 22:02:19 -05:00
Behdad Esfahbod a9e0bdc35d [GSUB] Don't flush glyphset during recursion in closure()
See comment.

Supercedes https://github.com/harfbuzz/harfbuzz/pull/1401
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11366
2018-11-22 21:30:04 -05:00
Behdad Esfahbod d0e81b2cc8 [set] Rename 2018-11-22 21:20:39 -05:00
Behdad Esfahbod e866910579 Enforce requiring null_size even if min_size is 0
This concludes null-size enforcement changes
2018-11-22 18:07:59 -05:00
Behdad Esfahbod 4d4fd64ff4 Allow non-nullable OffsetTo<> to non-Null'able objects 2018-11-22 18:07:36 -05:00
Behdad Esfahbod fa9f585ec5 [glyf] Don't mark structs UNBOUNDED
See comments.
2018-11-22 17:56:51 -05:00
Behdad Esfahbod f47a60a754 Mark UnsizedArrayOf<> as UNBOUNDED
Since min_size is 0, Null() still accepts this type.
2018-11-22 17:53:29 -05:00
Behdad Esfahbod 199a0f7b41 [ot-shape] Simplify logic 2018-11-22 17:31:07 -05:00
Behdad Esfahbod 014e4980ed Move 2018-11-22 16:21:49 -05:00
Behdad Esfahbod 62890dee18 [aat] Zero mark advances if decided so even if there's cross-kerning
Cross-kerning can only take care of positioning vertically.  It doesn't
adjust mark advance...
2018-11-22 16:20:29 -05:00
Behdad Esfahbod a201fa74cd [aat] Tweak fallback positioning logic when applying morx
Such that for Indic-like scripts (eg. Khmer), we don't do any fallback mark
advance-zeroing / positioning, but we do for Latin, etc.  Reuses preferences
of our script-specific OpenType shapers for those.

Fixes regression: https://github.com/harfbuzz/harfbuzz/issues/1393
Which means, fixes again: https://github.com/harfbuzz/harfbuzz/issues/1264
While not regressing: https://github.com/harfbuzz/harfbuzz/issues/1357
2018-11-22 15:52:29 -05:00
Behdad Esfahbod fa0bd8964d [myanmar] Minor move 2018-11-22 14:46:39 -05:00
Behdad Esfahbod 7dc561984b [myanmar] If there's no GSUB table, pick myanmar shaper
Needed for morx+kern mark-zeroing interaction.  All other scripts
work this way.
2018-11-22 14:45:46 -05:00
Behdad Esfahbod 25f52f58c2 [myanmar] Remove myanmar_old shaper
Over time it has become the same as default shaper.  So, remove.
2018-11-22 14:41:01 -05:00
Behdad Esfahbod eeed802b1d Fix spurious gcc warnings
../../src/hb-null.hh:53:39: warning: enum constant in boolean context [-Wint-in-bool-context]
2018-11-22 01:53:36 -05:00
Behdad Esfahbod b96ecb9971 More
This makes more of the gcc spurious warning:

../../src/hb-null.hh:53:39: warning: enum constant in boolean context [-Wint-in-bool-context]

But not going to let that defeat correct code.  Type to switch to clang
as my main compiler...
2018-11-22 01:49:12 -05:00
Behdad Esfahbod 2737aa81e5 Fix up recent change
Fixes https://github.com/harfbuzz/harfbuzz/issues/1300
2018-11-22 01:44:27 -05:00
Behdad Esfahbod fffea5aff7 Minor 2018-11-22 01:25:34 -05:00
Behdad Esfahbod 209b58ef73 Minor 2018-11-22 01:22:33 -05:00
Behdad Esfahbod 3b9fd176e8 Disallow taking Null() of unbounded structs
Not sure I've marked all such structs.  To be done as we discover.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1300
2018-11-22 01:18:55 -05:00
Behdad Esfahbod f2b91d6510 Use Type::null_size for our structs in Null(), sizeof() for other types 2018-11-22 01:10:22 -05:00
Behdad Esfahbod 7dd945a876 One more time.. 2018-11-22 01:05:17 -05:00
Behdad Esfahbod d062ad10de Fix bots happy again, hopefully
So, our fallback static_assert cannot be had more than once per line
of source.
2018-11-22 00:39:14 -05:00
Behdad Esfahbod fb10c021c8 Revert alignof() == 1 check
Bots not happy with using "this" inside assertion...

This reverts 2656644887
2018-11-22 00:21:49 -05:00
Behdad Esfahbod 8d778877b8 .. 2018-11-21 23:46:09 -05:00
Behdad Esfahbod 8cfeed9948 Minor 2018-11-21 23:42:31 -05:00
Behdad Esfahbod e5d954a2fb Minor 2018-11-21 23:30:50 -05:00
Behdad Esfahbod e987059c61 Minor 2018-11-21 23:25:06 -05:00
Behdad Esfahbod a2b6d308a4 Remove DEFINE_SIZE_ARRAY2 2018-11-21 23:23:49 -05:00
Behdad Esfahbod 2656644887 Check alignof() structs are 1 2018-11-21 23:23:21 -05:00
Behdad Esfahbod 6321fdf704 Whitespace 2018-11-21 23:19:00 -05:00
Behdad Esfahbod ecdceea861
Merge pull request #1399 from harfbuzz/sharada-sandhi-mark
Fix USE categories for U+111C9 SHARADA SANDHI MARK
2018-11-21 16:12:32 -05:00
Behdad Esfahbod b89c7fd3dc Allow defining HB_USE_ATEXIT to 0
That's better use of that value than requiring extra macro HB_NO_ATEXIT
2018-11-21 12:32:48 -05:00
David Corbett b3d5b0a5d9 Fix USE categories for U+111C9 SHARADA SANDHI MARK 2018-11-21 11:35:44 -05:00
Behdad Esfahbod f48bb9a393 [var] Deprecated axis enumeration API and add new version
New version has axis flags.

New API:
+hb_ot_var_axis_info_t
+hb_ot_var_find_axis_info()
+hb_ot_var_get_axis_infos()

Deprecated API:
-HB_OT_VAR_NO_AXIS_INDEX
-hb_ot_var_axis_t
-hb_ot_var_find_axis()
-hb_ot_var_get_axes()
2018-11-20 20:46:14 -05:00
Behdad Esfahbod b2d803cef6 Remove newly-added -hb_ot_var_axis_get_flags() 2018-11-20 20:46:14 -05:00
Behdad Esfahbod 736897d7a1 [var] Make sure hb_ot_var_axis_flags_t is int-sized 2018-11-20 20:46:14 -05:00
Behdad Esfahbod eab5d15f61 [var] Move code 2018-11-20 20:46:14 -05:00
Michiharu Ariza 1ecbf4d3e3 Merge branch 'master' into cff-subset 2018-11-20 17:19:05 -08:00
David Corbett 8295118279 Shrink the emoji table by merging adjacent ranges 2018-11-20 15:41:45 -05:00
Behdad Esfahbod be1828daaa [var] Fix type of coords returned
Ouch.  Wonder how none of the bots caught the float->int truncation.
2018-11-20 11:16:23 -05:00
Behdad Esfahbod 831ba74382 Fix Codacy "issues" 2018-11-20 01:16:08 -05:00
David Corbett 3c7792ca32 [use] Fix reordering
Fixes #1235.
2018-11-19 16:49:40 -05:00
Behdad Esfahbod 587d49fc65 [fvar] Add named-instance API
Fixes https://github.com/harfbuzz/harfbuzz/issues/1241
2018-11-19 14:51:34 -05:00
Behdad Esfahbod 46c0da820f Fix build 2018-11-19 13:32:48 -05:00
Behdad Esfahbod 56c9238d3d [fvar] Rewrite sanitize 2018-11-19 13:09:53 -05:00
Behdad Esfahbod 4a6a692e3e [fvar] Use hb_array_t for axes 2018-11-19 13:06:44 -05:00
Behdad Esfahbod e009739601 [fvar] Minor 2018-11-19 12:53:53 -05:00
Behdad Esfahbod 1a2eb108b8 [ot-var] Add hb_ot_var_axis_get_flags()
Part of https://github.com/harfbuzz/harfbuzz/issues/1241

New API:
+hb_ot_var_axis_flags_t
+hb_ot_var_axis_get_flags
2018-11-19 12:36:56 -05:00
Behdad Esfahbod bd6b2ba1d3 [ot-var] Add flags
Unfortunate that we don't have room in hb_ot_var_axis_t to expose flags :(.
2018-11-19 11:34:56 -05:00
Behdad Esfahbod c076c7b85c [ot-var] Use hb_ot_name_id_t 2018-11-19 11:30:40 -05:00
Michiharu Ariza 515f1a1614 Merge branch 'master' into cff-subset 2018-11-16 17:38:47 -08:00
Michiharu Ariza a6da9b9415 fixed Charset format selection 2018-11-16 17:29:03 -08:00
Behdad Esfahbod e3a1a8350a 2.1.3 2018-11-16 16:53:25 -08:00
Behdad Esfahbod 9714e114b8 Fix recent commits 2018-11-16 16:52:42 -08:00
Behdad Esfahbod 0328a1ce41 Revert b4c6113032
Was causing more trouble than it solved.  We use unsigned for indexing,
and it's not helpful to allow that wrapping to negative integers on
32bit machines.  The only way we could work around it would have been
by accepting int64_t arg, but that's overkill.

Ignore the MSVC 2008 build issue.  We don't support that compiler.
2018-11-16 16:48:28 -08:00
Behdad Esfahbod 52f61cdb87 Detect over/under-flow in UnsizedArray::operator[]
Was causing bad substitutions in mort table because of WordOffsetToIndex()
producing negative numbers that were cast to unsigned int and returned as
large numbers (which was desirable, so they would be rejected), but then
they were cast to int when passed to this operator and acting as small
negative integers, which was bad...

Detect overflow.  Ouch, however, now I see this still fails on 32-bit.
Guess I'm going to revert an earlier change.
2018-11-16 16:41:59 -08:00
Behdad Esfahbod 6910ff03e6 [aat] Fix mort shaping
Ouch!
2018-11-16 16:11:02 -08:00
Behdad Esfahbod fdb29ab2b0 2.1.2 2018-11-16 15:38:11 -08:00
Behdad Esfahbod cff4c6087f Fix vertical fallback space sign
Ouch!

Follow-up to cf203af8a3

Fixes https://github.com/harfbuzz/harfbuzz/issues/1343
2018-11-16 15:04:41 -08:00
Behdad Esfahbod 7a97f70740 Don't apply GPOS if applying morx
That's what Apple does, and it wouldn't degrade our OpenType performance.

Part of https://github.com/harfbuzz/harfbuzz/issues/1348
2018-11-16 14:46:40 -08:00
Behdad Esfahbod eafd515639 Prefer morx table if GSUB is empty (no scripts)
Fixes https://github.com/harfbuzz/harfbuzz/issues/1348
2018-11-16 14:45:56 -08:00
Behdad Esfahbod aa06574823 Minor 2018-11-16 14:31:05 -08:00
Michiharu Ariza b6903bd6c4 ensure fdmap initialized as identity for single-FD (non-CID) fonts 2018-11-16 13:46:58 -08:00
Michiharu Ariza b403be8ad9 Merge branch 'master' into cff-subset 2018-11-16 12:29:18 -08:00
Michiharu Ariza b67a7c731f drop dotsection as hint along with test case 2018-11-16 12:28:24 -08:00
Behdad Esfahbod 50d1a41c08 [coretext] Hopefully the last one 2018-11-16 08:52:57 -05:00
Behdad Esfahbod 0aab861f9c [coretext] Another round 2018-11-16 08:43:25 -05:00
Behdad Esfahbod 0809b76a9a [coretext] One more try.. 2018-11-16 08:29:47 -05:00
Behdad Esfahbod 78bd447594 [coretext] One more try 2018-11-16 04:10:53 -05:00
Behdad Esfahbod fd27a23c82 [coretext] Another build fix attemt 2018-11-16 03:57:12 -05:00
Behdad Esfahbod 729aedf0da [directwrite] Fix build 2018-11-16 03:26:46 -05:00
Behdad Esfahbod cfb9771a3b [coretext] Try to fix 2018-11-16 03:25:07 -05:00
Behdad Esfahbod e3e9547365 [coretext] Unbreak build 2018-11-16 02:55:29 -05:00
Behdad Esfahbod ce5da0f36a [shaper] Rewrite shaper data code to be more template-driven than macro-driven 2018-11-16 02:52:20 -05:00
Behdad Esfahbod cb4bf85b14 [hdmx] Fix bounds checking
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11351
2018-11-16 02:02:24 -05:00
Behdad Esfahbod af727b4e62 [hdmx] Minor 2018-11-16 01:55:39 -05:00
Behdad Esfahbod 9e9f16c92d [subset] Remove invalid glyphs from glypset to retain
Fixes https://github.com/harfbuzz/harfbuzz/pull/1388
2018-11-16 01:48:26 -05:00
Michiharu Ariza 072c7aba92 use 2-byte offset instead of 4-byte for local subrs
more than enough since local subrs immediately follow its corresponding private dict, as the result 2-byte redunction for each font dict with local subrs
updated api test expected subset fonts accordingly
2018-11-15 15:41:46 -08:00
Michiharu Ariza 9d0231cfe7 fixed a subset bug when no font dicts reduce 2018-11-15 15:39:43 -08:00
Ebrahim Byagowi 11aa0468ac [subset] minor, adjust spaces 2018-11-16 00:02:47 +03:30
Ebrahim Byagowi d7c50ff0d6 [math] minor, adjust spaces 2018-11-16 00:02:47 +03:30
Michiharu Ariza 13735570f0 reject nested seac 2018-11-15 12:10:23 -08:00
Michiharu Ariza c37aecd41c Merge branch 'master' into cff-subset 2018-11-15 11:03:46 -08:00
Michiharu Ariza ecdb77f0ae fixed CFF1 subset of std encoding & non-std charset combo 2018-11-15 10:54:15 -08:00
Behdad Esfahbod cabe433fbb [base] Add TODO items 2018-11-15 02:48:50 -05:00
Behdad Esfahbod 3bf1ce748f [shaper] Rename 2018-11-14 21:08:54 -05:00
Behdad Esfahbod c221dc0ba7 [ot-shape] Move code around 2018-11-14 19:57:19 -05:00
Michiharu Ariza 892ab37e7c Merge branch 'master' into cff-subset 2018-11-14 13:54:07 -08:00
Michiharu Ariza 3787c07856 Implemented seac for extents & subset along with API tests 2018-11-14 13:38:03 -08:00
Ebrahim Byagowi 7867c2bad0
[STAT] Add table parsing (#1384) 2018-11-14 22:13:50 +03:30
Behdad Esfahbod 48d16c2ab2 [hmtx] Fix signedness issue
Fixes https://github.com/harfbuzz/harfbuzz/issues/1248#issuecomment-438689499
2018-11-14 09:57:05 -05:00
Ebrahim Byagowi 29db2a44a6
[ot-color/svg] Note that it can be gzipped 2018-11-14 12:13:16 +03:30
Behdad Esfahbod 3c3eb5ea9c [aat] Disable fallback mark advance zeroing and positioning if morx applied
Fixes https://github.com/harfbuzz/harfbuzz/issues/1357
2018-11-13 21:10:10 -05:00
Behdad Esfahbod dc4225ccd1 Don't retry creating again and again in lazy_loader if create failed
Still does that if get_null() returns nullptr.  Our shaper data objects
are like that.  Shrug.
2018-11-13 20:48:46 -05:00
Behdad Esfahbod 086235f593
Merge pull request #1382 from punchcutter/master
Change USE Category for Grantha Virama
2018-11-13 19:50:25 -05:00
Behdad Esfahbod 2092f595c7
Merge pull request #1380 from kbrow1i/cygwin
Don't use Win32 API on Cygwin
2018-11-13 19:49:06 -05:00
punchcutter c565fc3fb3 Change USE Category for Grantha Virama
https://github.com/harfbuzz/harfbuzz/issues/1379
2018-11-13 12:51:10 -08:00
Behdad Esfahbod 475be9d5c6 Fix Windows build 2018-11-13 13:01:13 -05:00
Behdad Esfahbod fc44dea341 Use atomic ints for upem and num_glyphs on face 2018-11-13 11:54:33 -05:00
Behdad Esfahbod 9579ed9755 Make atomic types' internal values non-mutable
This resulted from confusion previously...
2018-11-13 11:46:20 -05:00
Behdad Esfahbod c52d5bcd94 [ot-face] Add 'head' table 2018-11-13 11:41:29 -05:00
Ken Brown eee5b5ed04 Don't use Win32 API on Cygwin
Cygwin is a Posix platform to the extent possible.  It should use the
Posix API except in special circumstances.
2018-11-12 21:07:34 -05:00
Behdad Esfahbod 56f541d000 [shape-plan] Remove unused code 2018-11-12 19:46:37 -05:00
Behdad Esfahbod 6c22f3fd95 [shape-plan] Implement fine-grained caching plans with user-features
Only tag, value, and global-ness of features are considered, not their
start/end offsets.
2018-11-12 19:26:01 -05:00
Behdad Esfahbod cc8428756a [shape-plan] Cache shape plans with variations based on variation indices 2018-11-12 18:48:10 -05:00
Behdad Esfahbod 8284cb9fb3 [shape-plan] Refactor more 2018-11-12 18:18:20 -05:00
Behdad Esfahbod 1082338525 [shape-plan] Only use shape-plan key to initialize hb_ot_shape_plan_t
Such that we don't accidentally use info not in the cache key.
2018-11-12 18:05:02 -05:00
Behdad Esfahbod 7ac03f88a2 [shape-plan] Minor 2018-11-12 17:50:30 -05:00
Behdad Esfahbod c7be933439 [shape-plan] Refactor some more 2018-11-12 17:49:15 -05:00
Behdad Esfahbod fc27777833 [shape-plan] Refactor more 2018-11-12 17:27:34 -05:00
Behdad Esfahbod 566612295b [shape-plan] Turn hb_shape_plan_proposal_t into hb_shape_plan_key_t
And include it in hb_shape_plan_t itself.
2018-11-12 17:19:45 -05:00
Behdad Esfahbod af123bd1b8 Add hb_memcmp() 2018-11-12 16:27:08 -05:00
Behdad Esfahbod 65456bff37 [shape-plan] Minor 2018-11-12 16:21:21 -05:00
Behdad Esfahbod 1db672a5e9 [shaper] Rename 2018-11-12 16:05:46 -05:00
Behdad Esfahbod 274f4c726f Rename check_array2() to check_array() 2018-11-12 14:24:36 -05:00
Behdad Esfahbod e014405a21 Rename check_array(array, a, b) to check_range() 2018-11-12 14:23:31 -05:00
Behdad Esfahbod c8f4cc4927 [kerx] Fix integer overflow in multiply
Fixes https://oss-fuzz.com/v2/testcase-detail/5754863779053568
2018-11-12 14:11:29 -05:00
Behdad Esfahbod 1300f027a9 [kerx] Minor tweak on previous commit 2018-11-12 13:56:48 -05:00
Behdad Esfahbod d6666b3866 [fuzzing] Remove limited-edition build of libraries
Use normal, production, shared libraries.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1237
2018-11-12 13:21:14 -05:00
Behdad Esfahbod a549aa14a0 [kerx] Protect against stack underflow
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11367
2018-11-12 13:02:39 -05:00
Michiharu Ariza 41a8bc7fd9 Merge branch 'master' into cff-subset 2018-11-12 08:49:00 -08:00
Michiharu Ariza 0dfa584cb4 changed Adobe company name 2018-11-12 08:47:07 -08:00
Behdad Esfahbod 3e284e02c2 [shape-plan] Minor 2018-11-11 22:51:34 -05:00
Behdad Esfahbod 420c9de644 [shape-plan] Minor rename 2018-11-11 22:50:37 -05:00
Behdad Esfahbod 77bd0a6458 Add variation coords to shape_plan proposal
This is the root cause of bug worked around in 19e77e01bc.

Still no shape plan caching for variations though.
2018-11-11 22:08:48 -05:00
Behdad Esfahbod 9c767d075d Minor 2018-11-11 22:03:15 -05:00
Behdad Esfahbod f521a28b4a Embed hb_ot_shape_plan_t into hb_shape_plan_t
No other shaper will need shape_plan_data, by definition.  So, remove
abstraction layer and always create hb_ot_shape_plan_t as part of
hb_shape_plan_t.
2018-11-11 21:54:10 -05:00
Behdad Esfahbod fabb012104 Remove wrong comment 2018-11-11 17:10:23 -05:00
Behdad Esfahbod 1fd183ee1c Finish off eecccc919c 2018-11-11 16:47:52 -05:00
Behdad Esfahbod 1beacdded9 Minor 2018-11-11 16:35:28 -05:00
Behdad Esfahbod e88d47b7f2 Minor 2018-11-11 16:25:43 -05:00
Behdad Esfahbod 55c66c7c56 Revert "Declare Null() constexpr"
This reverts commit 442a72d95a.

Doesn't make sense.  No idea how my local compilers where happy with it!
2018-11-11 16:09:38 -05:00
Behdad Esfahbod 98c6f03ccd Minor 2018-11-11 15:54:20 -05:00
Behdad Esfahbod 442a72d95a Declare Null() constexpr 2018-11-11 15:51:23 -05:00
Behdad Esfahbod eecccc919c Don't store to null object
Ouch :).
2018-11-11 15:48:47 -05:00
Behdad Esfahbod 903856ab50 Remove unused function 2018-11-11 15:45:58 -05:00
Behdad Esfahbod 0e0af11c62 [hdmx] Renames 2018-11-11 12:54:16 -05:00
Behdad Esfahbod da6aa3b033 Add hb_blob_ptr_t.destroy() 2018-11-11 11:40:57 -05:00
Behdad Esfahbod bb9abb4efd [hmtx/port] Use hb_blob_ptr_t 2018-11-11 00:42:23 -05:00
Behdad Esfahbod 0e2680a6e8 [cmap] Port to hb_blob_ptr_t
Although didn't need it...
2018-11-11 00:28:47 -05:00
Behdad Esfahbod 0b0fad3ea8 [color] Port to hb_blob_ptr_t
Fix hb_blob_ptr_t::get_length () as well.
2018-11-11 00:26:55 -05:00
Behdad Esfahbod 925b7a214f Comment 2018-11-11 00:17:30 -05:00
Behdad Esfahbod dcb6386833 [shape-plan] Remove use of custom null object 2018-11-11 00:16:17 -05:00
Behdad Esfahbod 109891d498 [shape-plan] Make null object all zeros
To remove custom null object next..
2018-11-11 00:15:08 -05:00
Behdad Esfahbod 34185ff3bc [blob] Use default null object 2018-11-11 00:12:30 -05:00
Behdad Esfahbod 2ee1d9f555 [blob] Change null object memory mode to DUPLICATE
We never rely on that being equal to readonly.  Just not being
writable.  Maybe not even that given that the object is inert.

In prep for next commit, using default null pool.
2018-11-11 00:11:28 -05:00
Behdad Esfahbod 5d0078a48b Add hb_blob_ptr_t
Use in a couple of places.  Push to bots to see how many unhappy before
I convert the rest.
2018-11-10 23:52:15 -05:00
Behdad Esfahbod e44046ec49 Minor 2018-11-10 22:41:35 -05:00
Behdad Esfahbod 752bd8a192 [kerx] Fix Format1 tupleKern sanitization
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11312
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11305
2018-11-10 21:13:32 -05:00
Behdad Esfahbod f9e0552deb [fuzzing] Make "make lib" faster and more usable 2018-11-10 21:06:56 -05:00
Behdad Esfahbod 4674655841 Minor 2018-11-10 20:11:10 -05:00
Behdad Esfahbod a953b64750 Revert parts of previous commit that made clang unhappy 2018-11-10 20:10:03 -05:00
Behdad Esfahbod 1d66cdcf77 Better fix for MSVC 2008
Follow up on b4c6113032

Fixes https://github.com/harfbuzz/harfbuzz/issues/1374
2018-11-10 19:57:51 -05:00
Michiharu Ariza fb2a037f54 Merge branch 'master' into cff-subset 2018-11-10 16:23:11 -08:00
Behdad Esfahbod b4c6113032 Try fixing MSVC 2008 build
Fixes https://github.com/harfbuzz/harfbuzz/issues/1374
2018-11-10 16:35:39 -05:00
Behdad Esfahbod f2e942f302 Fix hb_bytes_t's unused template array constructor 2018-11-10 16:11:14 -05:00
Behdad Esfahbod 6213a75b68 Add trivial casts to hb_bytes_t 2018-11-10 16:09:21 -05:00
Behdad Esfahbod 8bb97d2ce1 Revert back hb_bytes_t.cmp() to the scheme it was
But fix UBSan complaint.

There's nothing in hb_bytes_t that guarantees lexical ordering, and
ordering by length first is much faster.
2018-11-10 16:00:51 -05:00
Behdad Esfahbod 534e1d7694 Fix hb_bytes_t.cmp() for realz this time 2018-11-10 15:45:31 -05:00
Behdad Esfahbod 929f07dbfc Fix hb_bytes_t.cmp()
Ouch!
2018-11-10 15:39:07 -05:00
Ebrahim Byagowi 1d82b4761d [colr/feat/trak] minor 2018-11-10 19:31:12 +03:30
Behdad Esfahbod 3a9fa8c026 [qsort] Fix O(N^2) behavior if all array elements are the same
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11327

Reported as https://github.com/noporpoise/sort_r/issues/7
2018-11-10 01:58:26 -05:00
Behdad Esfahbod b308aaccf0 [post] Minor 2018-11-10 01:58:26 -05:00
Behdad Esfahbod 4111c3b8cd [post] Move sanitize close to data fields 2018-11-10 01:58:26 -05:00
Behdad Esfahbod e26e6dbb33 [post] Remove unnecessary hb_nonnull_ptr_t<> 2018-11-10 01:58:26 -05:00
Ebrahim Byagowi 6b8178c649
[glyf] minor 2018-11-10 02:42:08 +03:30
Michiharu Ariza 8798416587 fixed vstem handling (lack thereof) in check_width
bug exposed by U+2261 equivalence in SourceCodePro-Regular.otf
2018-11-09 08:59:18 -08:00
Behdad Esfahbod 5f97fe9956 Fix a few MSVC 2008 warnings
https://github.com/harfbuzz/harfbuzz/issues/1374
2018-11-09 10:01:50 -05:00
Behdad Esfahbod f51bb6ee7b
Merge pull request #1358 from ebraminio/lcar
Hook AAT's lcar to _get_ligature_carets
2018-11-08 14:42:40 -05:00
Ebrahim Byagowi b986fead0a Hook AAT's lcar to _get_ligature_carets 2018-11-08 23:06:26 +03:30
Ebrahim Byagowi 2d987110c0
[aat] Minor 2018-11-08 21:46:26 +03:30
Ebrahim Byagowi b989507fa6
[aat] Minor (#1369) 2018-11-08 20:48:54 +03:30
Michiharu Ariza 26c291aaa0 Merge branch 'master' into cff-subset 2018-11-08 09:06:49 -08:00
Michiharu Ariza 417963dd9f got rid of Remap::fullset() as incorrect, redundant, inefficient 2018-11-08 09:01:20 -08:00
Ebrahim Byagowi f90423847b
[just] Initial table implementation (#1364)
A starting point, its sanitization is not tested however
2018-11-08 19:17:02 +03:30
Ebrahim Byagowi b8b00fb3c6
[aat] Support Lookup<OffsetTo<>>, needed by just and lcar (#1368) 2018-11-08 18:53:14 +03:30
Behdad Esfahbod 15326826bf [aat] Ignore cross-stream offset of deleted-glyphs
I think it makes sense to accumulate it, but Ned tells me that's
what CoreText does.
2018-11-07 21:58:04 -05:00
Michiharu Ariza 636a6833c5 fixed ends_in_hint bug
subr ends in hint itself should be regarded as hint
this flag should propagate to its caller if the call itself is at the end of the caller
2018-11-07 17:58:45 -08:00
Behdad Esfahbod 517a1bac97
Merge pull request #1362 from harfbuzz/cross-kern
Vastly improve kern/kerx tables, including cross-stream "kerning"
2018-11-07 18:40:48 -05:00
Behdad Esfahbod b18a56a290 [kerx] Comment 2018-11-07 18:13:22 -05:00
Michiharu Ariza 4d74020694 Merge branch 'master' into cff-subset 2018-11-07 15:09:30 -08:00
Michiharu Ariza e0c30b961d merge with cff-subset branch 2018-11-07 15:08:55 -08:00
Behdad Esfahbod 006386be3a [kern] Implement negative state numbers
Let the fuzzing bots rip this code apart...
2018-11-07 18:04:53 -05:00
Michiharu Ariza 0996c0ff62 implented no-desubroutinize with CFF2 along with API test
replaced AdobeVFPrototype.abc.otf with a hinted (maually) & subroutinized copy
replaced expected results as well
2018-11-07 14:48:37 -08:00
Behdad Esfahbod 29c5302376 [morx] Minor 2018-11-07 17:29:37 -05:00
Behdad Esfahbod 385f78b312 [aat] Remove deleted-glyhs after applying kerx/kern
Finally:  Fixes https://github.com/harfbuzz/harfbuzz/issues/1356

Test case:
$ ./hb-shape GeezaPro.ttc -u U+0628,U+064A,U+064E,U+0651,U+0629
[u0629.final.tehMarbuta=4+713|u064e_u0651.shaddaFatha=1@0,-200+0|u064a.medial.yeh=1+656|u0628.initial.beh=0+656]

The mark positioning (kern table CrossStream kerning) only works if deleted
glyph (as result of ligation) is still in stream and pushed through the
state machine.
2018-11-07 17:20:47 -05:00
Behdad Esfahbod 1909072235 [aat] Add debug info to state machine 2018-11-07 16:42:16 -05:00
Behdad Esfahbod ca23567f41 Disable fallback mark positioning if kern table has cross-stream kerning
Happens even if the cross-stream kerning is for cursive attachment only.  Oh well..
2018-11-07 16:19:51 -05:00
Behdad Esfahbod 5cf6f94dfd Don't apply both kerx and kern
Ouch!
2018-11-07 16:07:22 -05:00
Behdad Esfahbod 41cff7afc9 Minor 2018-11-07 16:05:36 -05:00
Behdad Esfahbod 9af983af24 [kern] Switch to dispatch 2018-11-07 16:03:09 -05:00
Behdad Esfahbod bc06e2805a [kerx/kern] Add has_cross_stream() 2018-11-07 16:02:40 -05:00
Behdad Esfahbod ea579f9ccc [kerx] Fix peculiar indexing that was needed previously
Not needed now that we use GPOS attachment for cursive kerx.
2018-11-07 15:50:23 -05:00
Behdad Esfahbod 6ee6cd93d8 [GPOS] Only mark unsafe-to-break if kerning happened
Fixes https://github.com/harfbuzz/harfbuzz/issues/1365
2018-11-07 15:40:55 -05:00
Behdad Esfahbod 501a364d9b [GPOS] Add TODO item 2018-11-07 15:02:16 -05:00
Behdad Esfahbod 7a9629f2f1 [kerx] Implement CrossStream kerning for non-state-machine subtables
Untested.
2018-11-07 14:52:57 -05:00
Behdad Esfahbod 0eb4157011 [kerx] Disable backwards-kerning for non-state-machine tables
That's what the spec says for Backwards flag, only applicable to
formats 1 and 4.
2018-11-07 14:42:15 -05:00
Behdad Esfahbod b2f687c256 [kerx] Use GPOS attachment facilities for CrossStream kerning 2018-11-07 14:38:29 -05:00
Behdad Esfahbod e10a856eb2 [kerx] Format 2018-11-07 14:11:48 -05:00
Behdad Esfahbod 649cc3ef27 [kerx] Don't disable crossKerning if kern feature is off 2018-11-07 14:07:13 -05:00
Behdad Esfahbod 0c3b061ac2 [kern] Apply erlier, where GPOS/kerx are applied 2018-11-07 13:58:41 -05:00
Behdad Esfahbod f4bad0086e [kerx] Implement tupleKerning for Format1
Untested.
2018-11-07 13:51:17 -05:00
Behdad Esfahbod 39b4ef6f18 [kerx] Better sanitize tupleKerning 2018-11-07 13:48:45 -05:00
Behdad Esfahbod 14772da06f [kern/kerx] Share KernTable, renamed to KerxTable 2018-11-07 13:40:22 -05:00
Behdad Esfahbod c038f5be6b [fallback] Minor 2018-11-07 13:35:06 -05:00
Behdad Esfahbod db6e658e8c [kern/kerx] More towards sharing KernTable 2018-11-07 13:33:23 -05:00
Behdad Esfahbod 89ec095979 [kern] Disable Format1 and Format3 for OT-style tables 2018-11-07 13:10:05 -05:00
Behdad Esfahbod ab57bcae0f [kern] Minor 2018-11-07 13:04:21 -05:00
Behdad Esfahbod 30af5b4a4c [kern] Move code 2018-11-07 12:57:10 -05:00
Behdad Esfahbod 1ff300464a [kern] Massage more 2018-11-07 12:51:49 -05:00
Behdad Esfahbod 8e9f6cd0fd [kerx] More minor 2018-11-07 12:49:20 -05:00
Behdad Esfahbod f8c3df7d4a [kern/kerx] Minor 2018-11-07 12:48:06 -05:00
Behdad Esfahbod f5e0a63a22 [kern/kerx] Towards sharing KernTable 2018-11-07 12:32:51 -05:00
Behdad Esfahbod 330508497d [kern/kerx] Minor 2018-11-07 12:27:44 -05:00
Behdad Esfahbod 1a5ef84900 [kern/kerx] Share Format2
This, enables Format2 for kern table, which was disabled before.
2018-11-07 12:19:52 -05:00
Behdad Esfahbod 8faec4e334 [kerx] Towards merging Format2 2018-11-07 12:16:38 -05:00
Michiharu Ariza ae8fd0dbfb clear stack after vsindex op 2018-11-07 09:16:12 -08:00
Michiharu Ariza 7fed7d80f7 fixed off-by-one error in CFF1 Encoding lookup 2018-11-07 09:09:13 -08:00
Behdad Esfahbod d5c0ca210f [aat] Minor 2018-11-07 12:08:44 -05:00
Behdad Esfahbod e72e041c3c [kerx] Rename 2018-11-07 11:56:36 -05:00
Behdad Esfahbod 241ba7da51 [morx/kerx] Rename types 2018-11-07 11:51:40 -05:00
Behdad Esfahbod c808e444da [kern/kerx] Share Format1 subtable 2018-11-07 11:47:12 -05:00
Behdad Esfahbod a244190afa [kerx] Minor 2018-11-07 11:47:12 -05:00
Behdad Esfahbod 2a72091196 [kerx] Minor 2018-11-07 11:26:57 -05:00
Behdad Esfahbod f5f4ca7871 [kern/kerx] Enable crossStream kerning in vertical
CoreText doesn't, but no reason we shouldn't do.
2018-11-07 11:21:09 -05:00
Behdad Esfahbod d5c88af4a2 [kerx] More towards sharing Format1 2018-11-07 11:20:14 -05:00
Behdad Esfahbod b693fd0dc6 [morx] Simplify 2018-11-07 11:10:24 -05:00
Behdad Esfahbod ce3451dc2a [kerx] Towards sharing Format1 2018-11-07 11:02:04 -05:00
Behdad Esfahbod e890753ebb [morx] Minor 2018-11-07 10:59:53 -05:00
Behdad Esfahbod 5b17853547 [kern/kerx] Share Format0 2018-11-07 10:45:25 -05:00
Behdad Esfahbod c97dde5d55 [kern/kerx] Towards merge more 2018-11-07 10:39:39 -05:00
Behdad Esfahbod 540ccc38b0 [kern/kerx] More towards sharing 2018-11-07 10:33:46 -05:00
Behdad Esfahbod d0f8f4c200 [kern] Move kern machine to hb-kern.hh 2018-11-07 10:25:25 -05:00
Behdad Esfahbod a6acff252c [kerx] Towards sharing subtables with kern 2018-11-07 10:19:57 -05:00
Behdad Esfahbod befac337ca [kern] Remove Override business
Not used in any fonts.  Not well-specified when mixing kerning with
Cross-Stream positioning.
2018-11-07 09:53:50 -05:00
Behdad Esfahbod 9d5027696e [post] Return true on truncation
Client can check that buffer was completely filled out and reallocate.
2018-11-07 09:16:53 -05:00
Behdad Esfahbod 7d91f07edf [post] Protect against huge empty tables 2018-11-07 09:14:42 -05:00
Behdad Esfahbod 5ed816ab59 [post] Minor 2018-11-07 09:13:51 -05:00
Behdad Esfahbod 64f0becd89 [post] Fix bound checking 2018-11-07 09:10:55 -05:00
HinTak 7ec694ddf2 Use non-GRID-fitted values for metrics (#1363)
* Use non-GRID-fitted values for metrics

See freetype/src/base/ftobjs.c:ft_recompute_scaled_metrics() and
the usage of GRID_FIT_METRICS inside.

Fixes https://github.com/behdad/harfbuzz/issues/1262

* Update hb-ft.cc
2018-11-07 08:19:36 -05:00
Behdad Esfahbod 59e04e4231 [kern/kerx] Fix cursive joining
Tested with Waseem TTC:

$ hb-shape Waseem.ttc جحخج
[F1Jeem_R2=3@0,180+479|M1Khah_L2_R2=2@0,682+403|M1Hah_L2_R2=1@0,1184+403|I1Jeem_L2=0@0,1184+744]
2018-11-07 00:27:20 -05:00
Behdad Esfahbod 8d0f797139 [kern/kerx] Fix "reset" magic value 2018-11-07 00:05:10 -05:00
Behdad Esfahbod 0123976a0c [kerx] Adjust CrossStream kern to match 'kern' table 2018-11-06 21:46:14 -05:00
Behdad Esfahbod 80a33b9ac3 [kern] More tweaks
Solves a mystery or two.  I'm fairly confident this is what CoreText does now.
2018-11-06 21:46:14 -05:00
Behdad Esfahbod 564e8ac046 [kern] Adjust some more
Getting closer.  So many open questions still...
2018-11-06 21:46:14 -05:00
Behdad Esfahbod 4d003b8503 [kern] Add TODO 2018-11-06 21:46:14 -05:00
Behdad Esfahbod 9810f0b80e [kern] Minor 2018-11-06 21:46:14 -05:00
Behdad Esfahbod 9c04b60583 [kern] In Format1, adjust how kerning is done
In a series of kerns in one action, kern all but last glyph forward,
and the last one backward.  Seems to better match what CoreText is doing.

Test cases, with GeezaPro Arabic:

$ ./hb-shape GeezaPro_10_10.ttc -u U+0631,U+0628
[u0628.beh=1+1415|u0631.reh=0@-202,0+700]

$ ./hb-shape GeezaPro_10_10.ttc -u U+0628,U+064F
[u064f.damma=0@0,-250+-250|u0628.beh=0@250,0+1665]

In a later change, I'll make kern machine avoid producing negative kerns.
2018-11-06 21:46:14 -05:00
Behdad Esfahbod e8c4772463 [kern] XXX Negate CrossKerning sign
Not sure why, but seems to better match GeezaPro Arabic w CoreText.

Quite possibly I'm doing something very wrong...
2018-11-06 21:46:14 -05:00
Behdad Esfahbod 01bf43ac01 [kern] Implement CrossStream kerning 2018-11-06 17:59:31 -05:00
Behdad Esfahbod b11830c09e [kern] Improve Format 2
Still disabled.
2018-11-06 17:59:31 -05:00
Behdad Esfahbod c0383c6bb7 Minor 2018-11-06 17:59:31 -05:00
Behdad Esfahbod 10e6f708f3 [kern] Minor 2018-11-06 17:16:23 -05:00
Behdad Esfahbod 164eedd918 [kern] Minor 2018-11-06 17:16:23 -05:00
Behdad Esfahbod 220a5991ba [kern/kerx] Fix trace numbering 2018-11-06 17:16:23 -05:00
Michiharu Ariza 7b21319edf don't reject empty Dict 2018-11-06 13:59:07 -08:00
Michiharu Ariza 43ee0e4d00 Merge branch 'master' into cff-subset 2018-11-06 09:57:17 -08:00
Behdad Esfahbod bfafe208da [kern] Switch to dispatch 2018-11-06 12:13:20 -05:00
Behdad Esfahbod 213fa3bf71 [kern] Refactor to include header in each subtable type 2018-11-06 12:13:20 -05:00
Behdad Esfahbod b0da2cd0b9 [kern] Some more 2018-11-06 12:13:20 -05:00
Behdad Esfahbod 75b00b51c8 [kern] Renames 2018-11-06 12:13:20 -05:00
Behdad Esfahbod 37f421c951 Minor 2018-11-06 10:03:38 -05:00
Ebrahim Byagowi 9139cc23ea
Fix link issue of some of the bots
e.g. https://circleci.com/gh/harfbuzz/harfbuzz/52410
2018-11-06 11:17:14 +03:30
Ebrahim Byagowi 98b37f0c10
[mort] Fix table detection logic
mort really needs some initial tests at least.
2018-11-06 09:16:28 +03:30
Behdad Esfahbod fa3ebf845f Simplify some more 2018-11-05 23:34:07 -05:00
Behdad Esfahbod 61f52231f4 [math] Shorten names a bit 2018-11-05 23:28:52 -05:00
Behdad Esfahbod 737efbe655 [ot-layout] Simplify GSUB/GPOS access
This concludes simplifying table access to face->table.XXXX.
2018-11-05 23:26:29 -05:00
Behdad Esfahbod 5e68cec179 [ot-layout] Simplify GDEF access 2018-11-05 23:23:57 -05:00
Behdad Esfahbod 33b006cc51 [ot-layout] Simplify some access 2018-11-05 23:19:04 -05:00
Behdad Esfahbod db35409f0d [ot-layout] Remove ensures 2018-11-05 23:11:46 -05:00
Behdad Esfahbod 9198de7b9b [ot-font] Remove ensure 2018-11-05 23:10:37 -05:00
Behdad Esfahbod ea6d9b661f [ot-face] Remove a few ensures 2018-11-05 23:10:21 -05:00
Behdad Esfahbod 0fe7a745c9 [ot-face] Simplify more table access 2018-11-05 23:10:18 -05:00
Behdad Esfahbod a35c92cbe7 [ot-face] Simplify table access
Yoohoo!
2018-11-05 23:10:16 -05:00
Behdad Esfahbod 914b595f25 [ot-face] Include hb-ot-face directly in hb_face_t
Simplifying access coming next.
2018-11-05 23:10:12 -05:00
Behdad Esfahbod 56ba998cdd [cmap] Push get_nominal_glyphs down into cmap accelerator 2018-11-05 19:49:54 -05:00
Behdad Esfahbod 36d85dce25 [cmap] Use hb_nonnullptr_t 2018-11-05 19:46:29 -05:00
Behdad Esfahbod 8be74d8553 2.1.1 2018-11-05 18:47:22 -05:00
Behdad Esfahbod 252632c477 [uniscribe] Fix use of deprecated API 2018-11-05 14:33:41 -05:00
Behdad Esfahbod bb380ec183 [cmap] Make null accelerator safe
Fixes https://github.com/harfbuzz/harfbuzz/issues/1146
2018-11-05 13:47:30 -05:00
Behdad Esfahbod f6fc5574d3 Add pointer magic operators to hb_atomic_ptr_t 2018-11-05 13:23:54 -05:00
Behdad Esfahbod f6e7cb51b1 Fix const-confusion in hb_array_t as well 2018-11-05 13:23:07 -05:00
Behdad Esfahbod 0da22fb0ad [null] Tweak hb_nonnull_ptr_t some more 2018-11-05 13:20:06 -05:00
Behdad Esfahbod 03348ce005 Minor 2018-11-05 12:59:32 -05:00
Michiharu Ariza b721fdae66 fixed leaks in CFF subr subset 2018-11-04 16:19:15 -08:00
Michiharu Ariza 85f5644e8e added missing switch breaks 2018-11-04 14:17:30 -08:00
Michiharu Ariza 1682d1bbec Merge branch 'master' into cff-subset 2018-11-04 13:25:41 -08:00
Behdad Esfahbod b605db2f65 [aat] Clean up ankr table include mess 2018-11-04 12:58:02 -05:00
Behdad Esfahbod 17335a8161 Clean up buffer->swap_buffers() calls
That function checks for buffer->successful already.  No need
to check at call site.
2018-11-04 02:25:07 -05:00
Michiharu Ariza 191ca0f15b CFF1 no-desubr fixes
make sure charstring/subrs not ending with endchar/return handled correctly
if no local subrs, skip serializing Subrs op in Private
misc fixes
2018-11-03 22:42:22 -07:00
Behdad Esfahbod 4eb52460c8 Fix >> 2018-11-03 21:45:39 -04:00
Behdad Esfahbod ae9ad1076e Fix "Warning: extra ";" ignored." 2018-11-03 21:41:50 -04:00
Behdad Esfahbod d0163afb7b Revert "Add operator char * to the naked array types as well"
This reverts commit db889c182e.

Was resulting in ambigious overloads...
2018-11-03 21:38:30 -04:00
Behdad Esfahbod c8f94a1ca6 Minor 2018-11-03 21:08:13 -04:00
Michiharu Ariza 1da4de7e7b fix for subset fuzzer failure
A called subr must be freshly parsed or completely parsed. otherwise the prevoius parse must have terminated prematurely
2018-11-03 15:41:29 -07:00
Behdad Esfahbod 0b0b38ec1e Fix null accelerator's
Fixes all except for cmap.  To be done separately.

Part of https://github.com/harfbuzz/harfbuzz/issues/1146
2018-11-03 16:16:31 -04:00
Behdad Esfahbod db889c182e Add operator char * to the naked array types as well 2018-11-03 16:04:19 -04:00
Behdad Esfahbod d6fdae310f Add operator char * to hb_nonnull_ptr_t 2018-11-03 16:02:03 -04:00
Behdad Esfahbod 7430ff604a Template casts in hb_nonnull_ptr_t 2018-11-03 15:59:13 -04:00
Behdad Esfahbod da408fce98 [blob] Allow null parent in create_sub_blob()
Like font and unicode.
2018-11-03 15:49:37 -04:00
Behdad Esfahbod fb0f30f55a Add hb_nonnull_ptr_t
Towards fixing https://github.com/harfbuzz/harfbuzz/issues/1146
2018-11-03 15:41:32 -04:00
Behdad Esfahbod 8d98c51d13 [kern] Third try fix access violation in Format3
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11245
2018-11-03 15:14:57 -04:00
Behdad Esfahbod f074da8c2b [kern] Really fix access violation in Format3
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11245
2018-11-03 15:07:39 -04:00
Behdad Esfahbod 93ef20a83b Replace most uses of is_inert with is_immutable 2018-11-03 15:03:06 -04:00
Behdad Esfahbod 0589787ff5 [kern] Fix access violation in Format3
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11245
2018-11-03 14:59:40 -04:00
Behdad Esfahbod 5570c87f21 Port objects to use header.writable instead of immutable
Saves 4 or 8 bytes per object on 64bit archs.
2018-11-03 14:59:40 -04:00
Behdad Esfahbod ee351a38ec [object] Add "writable" 2018-11-03 14:59:40 -04:00
Ebrahim Byagowi b8a78ce201
[BASE] Improvements (#1347) 2018-11-03 22:28:30 +03:30
Michiharu Ariza 34b06d994a fixed FDSelect size calcluation 2018-11-02 16:40:20 -07:00
Michiharu Ariza 481fdfdc23 Merge branch 'cff-subset' of https://github.com/harfbuzz/harfbuzz into cff-subset 2018-11-02 15:28:09 -07:00
Michiharu Ariza 1bc710a8c9 added CFF1 desubr api test cases & bug fixes 2018-11-02 15:28:01 -07:00
Khaled Hosny 2c68f34bdd [os2] Capitalize table tag and struct
Other tables follow the case of the OT tag, except this one.
2018-11-02 17:17:54 -04:00
Behdad Esfahbod 8034d1dda0 [kern] Implement Format1
Also, implement backwards kerning for Format1 in kern and kerx.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1350
2018-11-02 14:48:04 -04:00
Behdad Esfahbod 46b3885c1a [kern] Set subtable on sanitizer 2018-11-02 14:43:38 -04:00
Behdad Esfahbod 74c7a2c6c8 [kern] Respect more flags 2018-11-02 14:26:04 -04:00
Behdad Esfahbod 9f880bad0d [kern] Minor
We like check_struct() more.
2018-11-02 13:57:41 -04:00
Behdad Esfahbod 04b82b181d Remove pointer cast operators from ArrayOf<>
ArrayOf<>, unlike UnsizedArrayOf<>, has data before the array.
This was confusing.  Remove.
2018-11-02 13:47:33 -04:00
Behdad Esfahbod f1df441bed [kern] Comment 2018-11-02 13:26:15 -04:00
Behdad Esfahbod 095f5add0b [kern] Push apply loop to each subtable 2018-11-02 13:23:54 -04:00
Behdad Esfahbod 949dad89a8 [kern] Remove accelerator
It wasn't doing anything.
2018-11-02 12:47:55 -04:00
Behdad Esfahbod 0382b7184a Use as_array in more places 2018-11-02 12:23:26 -04:00
Behdad Esfahbod 91de9dfcf3 Fix &array_of<> 2018-11-02 12:16:51 -04:00
Behdad Esfahbod 9b7cb13794 Fixup 2018-11-02 12:00:55 -04:00
Behdad Esfahbod 6e06fe162e [kern] Implement Format3
Untested.
2018-11-02 11:56:55 -04:00
Behdad Esfahbod c6ef5dbd5c Add cast operators to hb_array_t 2018-11-02 11:51:21 -04:00
Behdad Esfahbod 72462eb765 Add UnsizedArrayOf::as_array() instead of hb_array() template 2018-11-02 11:46:42 -04:00
Behdad Esfahbod 1cf075ecb6 Add get_size to UnsizedArrayOf 2018-11-02 11:38:00 -04:00
Behdad Esfahbod a4a7a62389 [kern] Add buffer message 2018-11-02 11:16:43 -04:00
Michiharu Ariza 0b2870085d removed unused code 2018-11-01 22:43:17 -07:00
Michiharu Ariza 6186dbf1be added hb_subset_input_set_desubroutinize API
hooked up with CFF1 subroutinizer
a renaming
2018-11-01 17:25:23 -07:00
Michiharu Ariza b1d0c58915 removed extraneous ;s 2018-11-01 16:33:46 -07:00
Michiharu Ariza 2840a104c1 tweaks to build with new merge 2018-11-01 16:18:13 -07:00
Michiharu Ariza e600e5440b Merge branch 'master' into cff-subset 2018-11-01 16:13:56 -07:00
Behdad Esfahbod de96e5c81c [Crap] Avoid operator= 2018-11-01 18:14:41 -04:00
Behdad Esfahbod f9353bd68c [aat] Rely on vector auto initialization 2018-11-01 18:05:22 -04:00
Behdad Esfahbod 5a18d97b35 [aat] Remove unused forward declaration 2018-11-01 18:01:26 -04:00
Michiharu Ariza 82248b9287 fix leak attempt ^2 2018-11-01 10:36:50 -07:00
Michiharu Ariza a9c305c2b0 fix leaks 2018-11-01 10:31:21 -07:00
Michiharu Ariza 049ce078e5 fix bogus width with --no-hinting 2018-11-01 08:46:21 -07:00
Behdad Esfahbod 07ec792212 Warning fix 2018-11-01 10:31:19 -04:00
Ebrahim Byagowi c32280b30f
[ot-layout] minor 2018-11-01 15:31:14 +03:30
Michiharu Ariza d56e338a90 CFF1 no-desubroutinize + no-hinting
no-desubroutinize option is disabled for now
code cleanup (esp. CFF1 width handling)
bug fixes & renaming
2018-10-31 22:30:34 -07:00
Behdad Esfahbod 52a00cd87f [aat] Implement 'aalt' mapping
Fixes https://github.com/harfbuzz/harfbuzz/issues/1160
2018-10-31 19:06:08 -07:00
Behdad Esfahbod 6e3ea269fa [aat] Add 'afrc' feature mapping
https://github.com/harfbuzz/harfbuzz/issues/1342#issuecomment-434829028
2018-10-31 19:00:11 -07:00
Behdad Esfahbod 40b19fd469 [aat] Fallback to old style "Letter Case" small caps
Fixes https://github.com/harfbuzz/harfbuzz/issues/1342
2018-10-31 18:51:45 -07:00
Behdad Esfahbod cf203af8a3 Implement space fallback in vertical direction
Fixes https://github.com/harfbuzz/harfbuzz/issues/1343
2018-10-31 18:27:09 -07:00
Behdad Esfahbod e01250230b [hmtx/vmtx] Fix a crasher 2018-10-31 18:14:00 -07:00
Behdad Esfahbod 36e90ef56e [mort] Massage some more 2018-10-31 15:09:09 -07:00
Behdad Esfahbod cbaff4ef19 [mort] Some more 2018-10-31 15:06:12 -07:00
Behdad Esfahbod 3087046d31 [mort] Refactor offset-to-index mapping 2018-10-31 14:59:14 -07:00
Behdad Esfahbod b9db610add Minor 2018-10-31 14:22:31 -07:00
Behdad Esfahbod 995bf6c6f8 [sbix] Rely on blob->as<> checking size against Type::min_size 2018-10-31 13:21:33 -07:00
Behdad Esfahbod 4d4e526b5c Improve blob->as<>
It's true that blob->as<> should only be called on null or sanitized
data.  But this change is safe, so keep it.
2018-10-31 13:19:42 -07:00
Behdad Esfahbod 5854d3fa25 [set] Warning fix with gcc 8.1
https://github.com/harfbuzz/harfbuzz/pull/1334
2018-10-31 10:42:49 -07:00
Ebrahim Byagowi 850a7af3a4
[ot-color-test] Remove the non-working exact strike size storing (#1339) 2018-10-31 14:20:23 +03:30
Ebrahim Byagowi 2e639c47c9
[aat] Fix older compilers by not referencing enum directly (#1340) 2018-10-31 14:20:14 +03:30
Ebrahim Byagowi 642c9dcf1b
[aat] Minor, remove extra semicolons 2018-10-31 14:02:37 +03:30
Behdad Esfahbod c962d5e714 [mort] Make ligatures work
./hb-shape Apple_Chancery_10_12.ttf  "Th th ll te to tr fr fu fj"
[T_h=0+2308|space=2+569|t_h=3+1687|space=5+569|l_l=6+1108|space=8+569|t_e=9+1408|space=11+569|t_o=12+1531|space=14+569|t_r=15+1385|space=17+569|f_r=18+1432|space=20+569|f_u=21+1733|space=23+569|f_j=24+1098]

Part of https://github.com/harfbuzz/harfbuzz/issues/1331
2018-10-31 01:18:21 -07:00
Behdad Esfahbod c077989600 [mort] More Ligature work 2018-10-31 00:36:03 -07:00
Behdad Esfahbod 431c6e496b [mort] Some Ligature work 2018-10-31 00:15:00 -07:00
Behdad Esfahbod 28b68cffe4 [mort] Implement / adjust Contextual substitution 2018-10-30 23:54:29 -07:00
Behdad Esfahbod 11dbf0f129 [mort] More fixes] 2018-10-30 21:49:59 -07:00
Behdad Esfahbod e1552af95b [maxp] Minor 2018-10-30 21:09:05 -07:00
Behdad Esfahbod 0cf282a32e [mort] Grind some more 2018-10-30 20:52:12 -07:00
Behdad Esfahbod 90667b31bc [mort] Hook up more 2018-10-30 20:15:28 -07:00
Behdad Esfahbod 9346b1f158 [morx] Remove stale comment 2018-10-30 20:04:13 -07:00
Behdad Esfahbod f864ef215e [mort] More massaging towards mort 2018-10-30 19:42:21 -07:00
Behdad Esfahbod 2d9467340b [mort] Fix version check in sanitize 2018-10-30 19:33:42 -07:00
Behdad Esfahbod c2527a1bc2 [mort] Make it compile / hook it up
Untested.
2018-10-30 19:26:39 -07:00
Behdad Esfahbod 933babdc07 [mort] Fixup on previous commit 2018-10-30 19:22:43 -07:00
Ebrahim Byagowi b053cabacd [mort] Bring back mort generalizations
Started by reverting https://github.com/harfbuzz/harfbuzz/commit/1f1c85a5

Just a starting point, if we agree even mort can come back.
2018-10-30 19:18:06 -07:00
Behdad Esfahbod 5cd544a621 Fix build
Fixes https://github.com/harfbuzz/harfbuzz/issues/1338
2018-10-30 19:16:00 -07:00
Behdad Esfahbod 1019391046 2.1.0 2018-10-30 15:52:26 -07:00
Behdad Esfahbod bfd549daaa Fix everything-bot 2018-10-30 14:47:27 -07:00
Garret Rieger 0e1ad5a075 [subset] Limit the number of scripts and langsys' that should be checked when collecting features. 2018-10-30 14:15:58 -07:00
Behdad Esfahbod a7aba99baa [name] Rename hb_name_id_t to hb_ot_name_id_t
https://github.com/harfbuzz/harfbuzz/pull/1254
2018-10-30 14:04:09 -07:00
Simon Tooke 881e1054bc fix various GCC function pointer warnings 2018-10-30 13:17:54 -07:00
Behdad Esfahbod dc9bd29fea [CBDT] Implement Format18 get_extens
Part of https://github.com/harfbuzz/harfbuzz/issues/1327
2018-10-30 13:16:07 -07:00
Behdad Esfahbod a2a7422aaf [CBDT] Bound checks in reference_png 2018-10-30 13:14:56 -07:00
Khaled Hosny 0af3d176a6 [sbix] Fix memory leak in early return
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11210
2018-10-30 17:05:28 +02:00
Behdad Esfahbod 138f9e0f25 Minor 2018-10-30 01:31:13 -07:00
Ebrahim Byagowi f7a08cd41d
Fix extra semicolon issues and test that on CI (#1330) 2018-10-30 11:29:09 +03:30
Behdad Esfahbod 7e998d193a Fix spurious warning re uninitialized use 2018-10-30 00:52:22 -07:00
Behdad Esfahbod b186274362 [set/map] Fix uninitialized memory
I keep forgetting that primitive types are NOT initialized during construction. :|
2018-10-29 23:21:14 -07:00
Behdad Esfahbod 4ef671f25f [unicode] Fix a long-standing double-declaration warning 2018-10-29 22:46:19 -07:00
Behdad Esfahbod 166ae8b0aa Remove now unused hb_auto_t<> 2018-10-29 22:40:37 -07:00
Behdad Esfahbod 56e0fd345c Remove last use of hb_auto_t<> 2018-10-29 22:35:44 -07:00
Behdad Esfahbod ca5e5a4979 Port Coverage::Iter off hb_auto_t<> 2018-10-29 22:30:21 -07:00
Behdad Esfahbod 3a4e5dd425 Remove a few unnecessary hb_auto_t<>'s
See a85641446c30247c4e948263f0f8c1147ed4efb9
2018-10-29 22:27:20 -07:00
Behdad Esfahbod 67a22f377d [set/map/vector] Make constructable, but not copy or assignable
Disable copy/assign on them, as they shouldn't.

Make constructor / destructor call init_shallow/fini_shallow,
and make those idempotent.  So, these three can be constructed
on stack now and no init/fini call is needed.  As such,
hb_auto_t<> is not needed anymore.  I'll remove that separately.
2018-10-29 22:23:22 -07:00
Behdad Esfahbod ea0e51d1b1 Add HB_NO_CREATE_COPY_ASSIGN 2018-10-29 16:00:23 -07:00
Behdad Esfahbod 5b563640b2 Remove HB_DISALLOW_COPY_AND_ASSIGN from hb_ot_shape_planner_t
It was arbitrary that this struct had it and not dozens of others.
2018-10-29 15:58:44 -07:00
Behdad Esfahbod 14b353c185 One more iteration 2018-10-29 15:29:13 -07:00
Behdad Esfahbod c7c5df9ffd Try fixing older bots
Older C++ doesn't allow struct-with-constructor in union.
2018-10-29 15:16:52 -07:00
Behdad Esfahbod be87959a67 [cmap] Minor 2018-10-29 15:16:38 -07:00
Behdad Esfahbod 35d410f2ba Remove ASSERT_POD
Newer compilers / language allows structs with constructor in union.
So, this was not actually testing anything.  Indeed, the recent
change in DISALLOW_COPY *is* making some of our types non-POD.
That broke some bots.

Just remove this since it wasn't doing much, and I'd rather have
DISALLOW_COPY.
2018-10-29 14:45:44 -07:00
Behdad Esfahbod 6f0454e176 Fix extra-semicolon warnings 2018-10-29 13:51:15 -07:00
Behdad Esfahbod a256a92b3f Make Array types uncopyable-unassignable
Finally!  Catches hard-to-find errors like this:

-    const SortedArrayOf<SVGDocumentIndexEntry> docs = this+svgDocEntries;
+    const SortedArrayOf<SVGDocumentIndexEntry> &docs = this+svgDocEntries;

We implement this for our array types.  This, in turn, trickles down
into all types that embed the arrays.  So, as long as we define all
open-ended structs in terms of Array types (all can be done using
UnsizedArrayOf), this achieves the goal of making uncopyable all
structs that are variable-sized.  Yay!
2018-10-29 11:40:21 -07:00
Behdad Esfahbod 31cc1f74b7 [svg] Minor 2018-10-29 11:14:37 -07:00
Behdad Esfahbod 1366bb9760 Fix g-i warnings 2018-10-29 11:01:25 -07:00
Ebrahim Byagowi ae802c2c6e
[test-ot-color] Minor 2018-10-29 13:42:14 +03:30
Ebrahim Byagowi 7170e35096
Rename deprecated symbols list file name and clean it up (#1328) 2018-10-29 13:11:01 +03:30
Ebrahim Byagowi 9c692e5b8d [test-ot-color] Use public APIs on the tool 2018-10-29 12:22:39 +03:30
Ebrahim Byagowi fb525f8943 Rename dump-emoji to test-ot-color 2018-10-29 11:40:06 +03:30
Ebrahim Byagowi 81bcf47e9e Revive dump-emoji 2018-10-29 11:40:06 +03:30
Ebrahim Byagowi f10252b4b6
[svg] Fix incorrect array referencing 2018-10-29 10:29:58 +03:30
Behdad Esfahbod 5eb251aab0 [cbdt] Implement strike selection logic 2018-10-28 23:16:13 -07:00
Behdad Esfahbod 98bddbc8ef [sbix] Minor 2018-10-28 23:14:15 -07:00
Behdad Esfahbod 8cffee0577 [cbdt] Simplify more 2018-10-28 23:07:59 -07:00
Behdad Esfahbod 574579d376 [color] Rename get_strike() to choose_strike() 2018-10-28 23:04:37 -07:00
Behdad Esfahbod e2ba96da4c [cbdt] Refactor get_strike() 2018-10-28 23:01:57 -07:00
Behdad Esfahbod 6983cca9c8 [cbdt] Minor 2018-10-28 22:46:18 -07:00
Behdad Esfahbod e998fb9fbf [color] Round extents when scaling 2018-10-28 22:45:53 -07:00
Ebrahim Byagowi c929ccfcea [ot-color/png] Consider strike ppem on scaling 2018-10-28 22:40:40 -07:00
Behdad Esfahbod a8c9facf7a [svg] Cosmetic 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 9c1460e568 [svg] Use SortedArrayOf.bsearch 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 18dd6363a5 [svg] Minor 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 4876c938a2 [sbix] Comment 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 519fca1014 [color] Minor 2018-10-28 18:33:10 -07:00
Behdad Esfahbod e8ff27c208 Minor 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 6562172381 [sbix] Use LOffsetLArrayOf<> 2018-10-28 18:33:10 -07:00
Behdad Esfahbod a3ddd8067f [sbix] Add get_strike 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 95524ed9bc [sbix] Remove sbix_len 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 69e9846452 [sbix] Fix get_glyph_blob() on Null object 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 4e0ee2af09 [sbix] Simplify ppem access
If struct members are simple and needed publicly, we make them public.
2018-10-28 18:33:10 -07:00
Behdad Esfahbod 6ac9a4eaa3 [sbix] Simplify glyph_length calc 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 0730d62385 [sbix] Check glyph data end is in range 2018-10-28 18:33:10 -07:00
Behdad Esfahbod b76dc03108 [sbix] Reduce code 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 50fb02a219 [sbix] Check glyph id before looking into unsafe array
That 'Z' at end of imageOffsetsZ is a reminder that you should check...
2018-10-28 18:33:10 -07:00
Behdad Esfahbod a8cb9c73da [sbix] Simplify 'dupe' handling logic 2018-10-28 18:33:10 -07:00
Behdad Esfahbod d7eb534e59 [sbix] Check offsets before proceeding 2018-10-28 18:33:10 -07:00
Behdad Esfahbod c8380bd3e4 [color] Remove more dump-emoji cruft 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 68f2c832c8 Remove dump-emoji 2018-10-28 18:33:10 -07:00
Behdad Esfahbod b46de42b3a [sbix] Fix order of parameters 2018-10-28 18:33:10 -07:00
Behdad Esfahbod a91cda72ab [sbix] Remove redundant parameter 2018-10-28 18:33:10 -07:00
Behdad Esfahbod c712005f55 [sbix] Add get_strike() 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 400bc3f030 [sbix] Remove a couple of extra checks 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 3770282c83 [sbix] Rename sbix_table to table in accelerator 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 7346841807 [cbdt] Rename reference_blob_for_glyph() to reference_png() 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 1f33b8525d [sbix] Rename ugly reference_blob_for_glyph() to reference_png() 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 946b534419 [sbix] Fix uninitialized variables 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 01c7d53fb7 [sbix] Select best strike based on ppem 2018-10-28 18:33:10 -07:00
Behdad Esfahbod f9f26bff4c [sbix] Move code around. Add get_extents() 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 48bc3039cb [sbix] Check blob length against PNG header leangth 2018-10-28 18:33:10 -07:00
Ebrahim Byagowi d3ec31a57c [ot-color] More on PNGHeader fields 2018-10-28 18:33:10 -07:00
Ebrahim Byagowi 35fa3d3260 [ot-color] Apply Behdad comment 2018-10-28 18:33:10 -07:00
Ebrahim Byagowi 307d61867a [ot-color] Make PNGHeader reading actually work 2018-10-28 18:33:10 -07:00
Ebrahim Byagowi 632e9af862 [ot-color] Implement PNGHeader and test it, it doesn't work however 2018-10-28 18:33:10 -07:00
Ebrahim Byagowi 38706a0746 [ot-color] Preparation for setting PNG width/height in extents 2018-10-28 18:33:10 -07:00
Behdad Esfahbod d6d6f3bc22 [docs] Add comment 2018-10-28 18:33:10 -07:00
Ebrahim Byagowi 3d4c1f6a41 [ot-color] Apply Behdad reviews 2018-10-28 18:33:10 -07:00
Ebrahim Byagowi 8ef0d2ef92 [ot-color] Apply Behdad comment 2018-10-28 18:33:10 -07:00
Ebrahim Byagowi dbd419bede [ot-color] Add public API for CBDT/sbix/SVG color Emojis 2018-10-28 18:33:10 -07:00
Behdad Esfahbod 6ce49a921a [name] Change hb_name_id_t back to unsigned int
d941f66c75 (commitcomment-31076011)
2018-10-28 08:26:30 -07:00
Behdad Esfahbod a4f4f5ba5f [docs] Fix titles here as well 2018-10-28 08:23:36 -07:00
Behdad Esfahbod 213b6dd335 [name] Make sure hb_name_id_t is int-sized
d941f66c75 (commitcomment-31068905)
2018-10-27 18:36:24 -07:00
Behdad Esfahbod 1d40d72f29 [docs] Hook up hb-var 2018-10-27 05:01:01 -07:00
Behdad Esfahbod 80d9a427cf [docs] Document remaining sections 2018-10-27 04:58:32 -07:00
Behdad Esfahbod cf5fa57f00 [docs] Change section titles again
I think I like the uniform "hb-*" more.
2018-10-27 04:51:42 -07:00
Behdad Esfahbod 04981ee05d [docs] More 2018-10-27 04:47:41 -07:00
Behdad Esfahbod 5dd86aa33b [docs] Rename section titles to object names
More useful.
2018-10-27 04:47:41 -07:00
Behdad Esfahbod 524fb70216 [docs] More 2018-10-27 04:47:41 -07:00
Behdad Esfahbod 46072b7cb5 [ot] Fold hb-ot-tag.h into hb-ot-layout.h 2018-10-27 04:47:41 -07:00
Behdad Esfahbod 00cf4e5eb6 [docs] Fill in some sections 2018-10-27 04:47:41 -07:00
Behdad Esfahbod 55a19d73b4 Move HB_EXTERN 2018-10-27 04:47:41 -07:00
Ebrahim Byagowi 524e854c15
Merge pull request #1318 from ebraminio/png
Add a non-hooked _png _svg get emoji blob
2018-10-27 15:04:43 +03:30
Ebrahim Byagowi 8180c37df0 [ot-color] Remove _png and _svg public APIs 2018-10-27 14:54:08 +03:30
Ebrahim Byagowi 9aa6279a2d [ot-color/png] Try to get image blob from sbix first options.aat is set 2018-10-27 14:24:58 +03:30
Ebrahim Byagowi b42661ee91 [ot-color] Add some documentation 2018-10-27 14:15:38 +03:30
Behdad Esfahbod 4ee3c8272c [docs] Fix hb_name_id_t
Yep, was not recognized without this patch!
2018-10-27 03:18:45 -07:00
Ebrahim Byagowi 9435fb24da [ot-color/png] Implement CBDT part 2018-10-27 13:47:11 +03:30
Behdad Esfahbod d941f66c75 [name] Make hb_name_id_t be the enum
This is like hb_script_t.

We had this exposed as unsigned int since 2.0.0 release in two APIs,
as well as hb_ot_layout_get_size_params() from earlier.
But since no one uses those (right?!), let's just fix this now.
2018-10-27 03:06:14 -07:00
Behdad Esfahbod 40496a54a0 [name] Move HB_NAME_ID_INVALID into the enum
Don't know how to document anonymous enum members.
2018-10-27 03:06:14 -07:00
Behdad Esfahbod a8a55b9f89 [name] Move around 2018-10-27 03:06:14 -07:00
Behdad Esfahbod 3b7e5f1313 [name] Rename hb_ot_name_get_names() to hb_ot_name_list_names()
And swap return value positions, so can be annotated for gobject-introspectin.
2018-10-27 03:06:14 -07:00
Behdad Esfahbod 4025ad8043 Document new API 2018-10-27 03:06:14 -07:00
Ebrahim Byagowi 5e2a52f71a [sbix] Remove dump method from sbix accelerator 2018-10-27 12:44:33 +03:30
Ebrahim Byagowi 0353ac6cde
Fix test-name-table on older bots 2018-10-27 12:24:53 +03:30
Ebrahim Byagowi dc11a38107
[sbix] Set num_glyphs on accelerator
dump-emoji was broken without it
2018-10-27 12:15:25 +03:30
Ebrahim Byagowi 6a38fd68a8 [ot-color/png] sbix runtime memory check 2018-10-27 11:17:27 +03:30
Behdad Esfahbod ca645accb9 Comment 2018-10-27 00:39:31 -07:00
Ebrahim Byagowi 265ad408ca [ot-color/png] Implement sbix part 2018-10-27 10:43:46 +03:30
Behdad Esfahbod 7f5941e162 Remove stale comment
Ugliness was fixed in 30eab97a00
But yeah, my smell detector was working.  Ugliness was buggy.
2018-10-27 00:06:48 -07:00
Behdad Esfahbod e7400c0275 [docs] Hook up new symbols 2018-10-26 22:24:40 -07:00
Behdad Esfahbod 6aa019c4af [morx] Fix merge_cluster to end at last ligature component
Don't assume current position was a component in the ligature.
2018-10-26 22:02:17 -07:00
Behdad Esfahbod 00ae4be6bf [morx] Fix bailing out ligation at end-of-text
Check was after a move_to, which wouldn't work.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11147
2018-10-26 21:59:20 -07:00
Behdad Esfahbod 30eab97a00 Fix invalid memory read
Buffer might be relocated inside replace_glyphs().

Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=895117
2018-10-26 21:54:40 -07:00
Behdad Esfahbod 79b2fa62ca [indic] Fix infinite loop
Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=863044
2018-10-26 21:22:26 -07:00
Behdad Esfahbod 39bd07aed5 Fix bunch of unused parameter warnings
Show up with gcc -O0.

There's a few more but those are functions that need to be filled in.

Maybe this is a lost battle...
2018-10-26 21:22:26 -07:00
Behdad Esfahbod b2e1ec374c [subset] Fix warning 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 337ea0b717 [fuzzing] Remove HB_NDEBUG
Not sure why it ever was added.
2018-10-26 21:22:26 -07:00
Behdad Esfahbod c965eeadbc [name] Default to "en" if language is not specified 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 3fd6e5dbef [name] Add pre-defined nameIDs 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 20d0171d20 [name] Fill out most missing language codes 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 622b014faf [name] Skip enumerating names with unknown language 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 2c39f359e4 [utf] Remove unused typedef 2018-10-26 21:22:26 -07:00
Behdad Esfahbod ce81c74298 [utf] Fix ASCII 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 327546e633 [name] Hook up ltag table 2018-10-26 21:22:26 -07:00
Behdad Esfahbod dc9a5f88b4 [name] Do record sanitization at run-time 2018-10-26 21:22:26 -07:00
Behdad Esfahbod a53d301b1c [name] Minor 2018-10-26 21:22:26 -07:00
Behdad Esfahbod c442fd9a10 [name] Add src/test-name-table tool to show all font names 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 7007bd9dff [name] Rebuild language list, include missing entries 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 68f172101c [name] Fix cmp for invalid language 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 888a65615c [name] Fix nul-termination bug 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 9b532e2ed4 [name] Add language mapping 2018-10-26 21:22:26 -07:00
Behdad Esfahbod e2f9b65775 [name] Start adding language support 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 6db6bbe64b [name] Remove unused cmp function 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 4668a05006 [name] Hook things up
Accept Mac Latin name entries as ASCII as well.
2018-10-26 21:22:26 -07:00
Behdad Esfahbod 69f5da0629 [name] More
It assumes all names are encoded in UTF16-BE.  Other than that, and not
listing languages correctly, it's *supposed* to work.
2018-10-26 21:22:26 -07:00
Behdad Esfahbod 64334aff8c [name] Fix check 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 5531bd068e [name] Flesh out UTF-X to UTF-X conversion routines 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 84811a06a2 [name] Fix for rebase changes to hb_array_t 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 1046b1938b [name] Some more 2018-10-26 21:22:26 -07:00
Behdad Esfahbod b4d4d1ea78 [name] Return full string length from API 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 8d304ef7f9 [utf] Add UTF16-BE and UTF32-BE 2018-10-26 21:22:26 -07:00
Behdad Esfahbod a826a8730f [name] Hide internal details from public API 2018-10-26 21:22:26 -07:00
Behdad Esfahbod e7c595a9f0 [name] More 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 75cd8c86bd [name] Add hb_ot_name_get_utf() 2018-10-26 21:22:26 -07:00
Behdad Esfahbod c783d36324 [name] Pre-allocate array 2018-10-26 21:22:26 -07:00
Behdad Esfahbod c2aa409537 [name] Start implementing hb_ot_name_get_utf16() 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 740cde8991 [name] Implement hb_bytes_t get_name() 2018-10-26 21:22:26 -07:00
Behdad Esfahbod c3425f2401 [name] Add hb-ot-name.cc for realz 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 90420ed8cb [name] Implement hb_ot_name_get_names() 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 9a6c87c17d [name] Finish accelerator sorting 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 2157e56b34 [name] Start implementing public API infrastructure 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 0bf93ec0fb [name] Add public API declarations 2018-10-26 21:22:26 -07:00
Behdad Esfahbod 982c2f4a65 [indic/khmer/myanmar/use] Clarify clear_syllable
No logic change.
2018-10-26 15:40:45 -07:00
Ebrahim Byagowi 30f18039b3 [svg] Rename _svg_create_blob to _glyph_reference_blob_svg 2018-10-26 09:34:34 +03:30
Ebrahim Byagowi 5cb1ce8681 [svg] Collapse SVGDocumentIndex into SVG 2018-10-26 09:31:01 +03:30
Ebrahim Byagowi 4ceabb8c21 [svg] Hide start_glyph and end_glyph from API 2018-10-26 09:16:44 +03:30
Ebrahim Byagowi c7a4e3dfb5 [svg] Add public API
* hb_ot_color_has_svg
* hb_ot_color_glyph_svg_create_blob
2018-10-26 09:16:44 +03:30
Behdad Esfahbod e98af6d1ed [layout] Try to speed up collect_lookups some more
Barely made a dent :(.
2018-10-25 22:25:29 -07:00
Behdad Esfahbod eb44bfc864 [layout] Memoize collect_features
Fixes https://github.com/harfbuzz/harfbuzz/pull/1317
Fixes https://oss-fuzz.com/v2/testcase-detail/6543700493598720
2018-10-25 22:15:11 -07:00
Behdad Esfahbod 84098b1639 [layout] Remove unintentionally added code 2018-10-25 21:33:12 -07:00
Behdad Esfahbod 941600a9e0 [layout] Add hb_collect_features_context_t
Towards https://github.com/harfbuzz/harfbuzz/pull/1317
2018-10-25 21:26:56 -07:00
Behdad Esfahbod c237cdfcc7 [lookup] Fold another function inline 2018-10-25 21:17:30 -07:00
Behdad Esfahbod fe5520ddea [layout] More prep work to memoize collect_features() work 2018-10-25 21:14:32 -07:00
Behdad Esfahbod e8e67503ff [lookup] More prep work for memoizing collect_features
https://github.com/harfbuzz/harfbuzz/pull/1317
2018-10-25 20:48:20 -07:00
Behdad Esfahbod 96828b97a8 [layout] Minor
We were returning the accelerator's lookup count.  Returns table's.
They are the same except for OOM cases.  Just shorter code.
2018-10-25 20:34:29 -07:00
Behdad Esfahbod 73449cd213 [layout] Fold one function inline
Preparation for fixing https://github.com/harfbuzz/harfbuzz/pull/1317
2018-10-25 20:32:05 -07:00
Behdad Esfahbod ba5ca6a762 [morx] Use deleted-glyph, instead of actual deletion, in Ligation
Closer to what CoreText does.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1302
2018-10-25 17:46:07 -07:00
Behdad Esfahbod 5c272e3613 [morx] Remove deleted-glyph at the end of processing 2018-10-25 17:39:54 -07:00
Behdad Esfahbod 1bb8ed86d6 [aat] Minor 2018-10-25 17:33:48 -07:00
Behdad Esfahbod 102af615f1 [aat] Start adding support for DELETED-GLYPH
https://github.com/harfbuzz/harfbuzz/issues/1302
2018-10-25 17:29:32 -07:00
Behdad Esfahbod 955aa56b11 [vector] Make it act more like pointer
Add pointer cast operator and plus operator.
2018-10-25 16:50:38 -07:00
Behdad Esfahbod 8d55e2adef [set] Minor 2018-10-25 16:37:53 -07:00
Behdad Esfahbod 64c32edfe1 [set] Make array access more explicit
Follow up on 94e421abbf
2018-10-25 16:35:36 -07:00
Michiharu Ariza be746009e9 dropped support of legacy CFF CharString ops
along with test & font
2018-10-25 13:40:40 -07:00
Behdad Esfahbod 21ede867df Fix possible overflow in bsearch impls
From bungeman.

Fixes https://github.com/harfbuzz/harfbuzz/pull/1314
2018-10-25 13:19:58 -07:00
Michiharu Ariza 2ebf360102 Merge branch 'master' into cff-subset 2018-10-25 13:05:06 -07:00
Ben Wagner 94e421abbf Remove some use of Crap in hb-set.
When hb_set_t::page_for_insert needs to insert at the end of the page_map
it ends up evaluating '&page_map[i + 1]' which has hb_vector return an
lvalue of a Crap so that nothing can be moved to its address. This turns
into issues with ThreadSanitizer on Crap when two threads modify different
hb_set_t instances. This can be avoided by using '&page_map[i] + 1'
instead.
2018-10-25 11:42:20 -07:00
Behdad Esfahbod ae9e8f292b [vowel-constraints] Reset continuation on all dottedcircles
One of the was missed before.  Not intentional.
2018-10-24 16:55:20 -07:00
Behdad Esfahbod 401cdf0792 [ot-font] Fix sign of ascent/descent
Some fonts, like msmincho, have positive number as descent
in vhea table.  That's wrong.  Just enforce sign on ascent/descent
when reading both horizontal and vertical metrics.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1248
2018-10-23 17:00:49 -07:00
Behdad Esfahbod ba502dea1e [morx] Fix cluster-merging when ligating
Only merge when actual ligature happened.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1305
2018-10-23 16:50:31 -07:00
Garret Rieger aa5af8d041 Fix size calculation in DEFINE_SIZE_ARRAY_SIZED. 2018-10-23 16:04:21 -07:00
Michiharu Ariza 36c2c374bf removed unused multi_val from DictVal 2018-10-23 15:11:09 -07:00
Behdad Esfahbod f33ad6d692 [aat] Fix up previous commit and add files 2018-10-23 14:31:51 -07:00
Behdad Esfahbod ffe3478448 [aat] Allow enabling/disabling features
Only works at entire-buffer range, not sub-ranges.

Test with:

$ hb-shape Zapfino.dfont Zapfino
[Z_a_p_f_i_n_o=0+2333]

$ hb-shape Zapfino.dfont Zapfino --features=-dlig
[Z=0+416|a=1@-21,0+264|p_f=2+433|i=4+181|n=5+261|o=6+250]

$ hb-shape Zapfino.dfont Zapfino --features=+dlig
[Z_a_p_f_i_n_o=0+2333]

Fixes https://github.com/harfbuzz/harfbuzz/issues/1303
2018-10-23 14:14:03 -07:00
Behdad Esfahbod 8be0e5fd45 [ot-map] Minor 2018-10-23 13:39:50 -07:00
Behdad Esfahbod e8fccbc36b Minor 2018-10-23 13:25:03 -07:00
Behdad Esfahbod 76324d95ca Shift code around 2018-10-23 13:09:30 -07:00
Michiharu Ariza e1241636d6 Merge branch 'master' into cff-subset 2018-10-23 11:25:51 -07:00
Behdad Esfahbod cf92d6579e [trak] Allow disabling tracking for ranges of text
Fixes https://github.com/harfbuzz/harfbuzz/issues/1303
2018-10-23 03:10:56 -07:00
Behdad Esfahbod 8869436cb8 When parsing feature ranges, accept ';' instead of ':' 2018-10-23 03:07:48 -07:00
Ebrahim Byagowi 22ecefd88e Make tracking optout possible using 'trak' ot feature
So '--features=-trak' or 'font-feature-settings: 'trak' 0;' can prevent
applying of tracking if used.
2018-10-23 02:57:55 -07:00
Behdad Esfahbod 6d40eb8372 Touch up on previous commit
https://github.com/harfbuzz/harfbuzz/pull/1273
2018-10-23 02:51:42 -07:00
David Corbett 205737acdc [use] Prohibit visually ambiguous vowel sequences 2018-10-23 02:25:08 -07:00
Behdad Esfahbod 48ed598a35 [VORG] Hook up to hb-ot-font's v_origin
Fixes https://github.com/harfbuzz/harfbuzz/issues/544

Test added with NotoSansCJK, eg. with U+FF38.
2018-10-23 02:21:27 -07:00
Behdad Esfahbod 097ecfd4a9 [VORG] Add get_y_origin()
Unhooked.
2018-10-23 02:09:42 -07:00
Behdad Esfahbod 6fb24d5e3e [VORG] Add VORG table
Cherry-picked from cff-subset branch.
2018-10-23 01:59:43 -07:00
Behdad Esfahbod 531f9822b2 [morx] Add a few debug messages to Ligature chain 2018-10-23 01:32:08 -07:00
Behdad Esfahbod 0e5bcdef7f [morx] Clear stack upon underflow when acting ligatures 2018-10-23 00:39:44 -07:00
Behdad Esfahbod 792071de40 [morx] Leave ligature on stack after ligating
Test with Apple Color Emoji.ttf of ~66MB and following sequence:

./hb-shape Apple\ Color\ Emoji-old.ttf --font-funcs=ot -u U+1F468,200d,U+1F469,200d,U+1F467,200d,1f466

Should form full family if matching works correctly.  It first makes
family of three, then makes family of four out of that and the last
two characters.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1292
2018-10-22 23:38:34 -07:00
Behdad Esfahbod 8c78ced95b Unbreak builds 2018-10-22 21:49:42 -07:00
Behdad Esfahbod 8d689f8a7b Add hb_array<>() specialization for UnsizedArrayOf
Related https://github.com/harfbuzz/harfbuzz/issues/1301
2018-10-22 21:33:18 -07:00
Behdad Esfahbod abfbba1911 Add hb_array<>()
Simplifies transient object creation.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1301
2018-10-22 21:27:45 -07:00
Behdad Esfahbod 17ffbc070f [color] Use Index for colorIdx
Doesn't matter, but matches the description.
2018-10-22 21:22:25 -07:00
Behdad Esfahbod 07386ea410 Remove const and references when binding Null()
Fixes https://github.com/harfbuzz/harfbuzz/issues/1299

Removes anomaly I was seeing in cpal table trying to use implicit Null(NameID).
2018-10-22 21:21:17 -07:00
Behdad Esfahbod b18acab7bc [color] Add HB_COLOR
Normally I would have added to_string / from_string like other types
have.  But since we don't use hb_color_t much, I'm not going to do that.
Although, if we did, we could use it in hb-view to parse colors...
2018-10-22 18:20:57 -07:00
Behdad Esfahbod 228f96c9d0 [color] Finish reviewing / revamping CPAL
Now to hb_color_t.
2018-10-22 16:55:12 -07:00
Michiharu Ariza 960267fc43 fix build attempt ^4 2018-10-22 16:37:39 -07:00
Behdad Esfahbod 683fad0627 [color] Minor 2018-10-22 16:35:03 -07:00
Behdad Esfahbod 14474d2104 [color] Rely on CPALV1Tail Null object 2018-10-22 16:31:13 -07:00
Behdad Esfahbod d7865107ea Remove const from hb_array_t details
Will come in through <T> if desired.
2018-10-22 16:24:16 -07:00
Behdad Esfahbod f3336580dd [color] Use hb_array_t in CPAL
Doesn't work though, ouch :(.  Need to figure out if it's unreasonable
to expect Null(T) inside hb_array_t<T> to see the later specialization
of Null for NameID.
2018-10-22 16:24:16 -07:00
Behdad Esfahbod 5ae18855d1 [color] Check for null CPAL arrays
We cannot use a nullable offset here though.
2018-10-22 16:24:16 -07:00
Behdad Esfahbod 69ab72e4aa [color] More CPAL rename 2018-10-22 16:24:16 -07:00
Behdad Esfahbod 0befb06c46 [color] More CPAL rename 2018-10-22 16:24:16 -07:00
Behdad Esfahbod 3600d20603 [color] Rename vars in CPAL 2018-10-22 16:24:16 -07:00
Michiharu Ariza b11032afae fix build attempt ^2 2018-10-22 15:52:37 -07:00
Michiharu Ariza 3d3df5575c fix build attempt 2018-10-22 15:23:39 -07:00
Ebrahim Byagowi 0babf761c9
Adopt dump-emoji with latest unreleased APIs changes (#1297) 2018-10-23 01:33:45 +03:30
Behdad Esfahbod 7997144b5f [color] Revamp palette API 2018-10-22 14:22:31 -07:00
Behdad Esfahbod 3bf91bd269 [color] Rewrite colr access
COLR table has one function: return layers for a glyph, and we expose exactly
that, so should just wire it through.  Also use sub_array() for verifiable
safety.

Also, BaseGlyphRecord's null object is enough.  We don't need to special-case
the not-found.
2018-10-22 14:21:23 -07:00
Behdad Esfahbod 1de17bdb80 [colr] Add hb_ot_color_layer_t
We never return parallel arrays from functions.  That's inconvenient
and hard to bind.
2018-10-22 14:21:23 -07:00
Behdad Esfahbod 3b3668acc8 [color] Rename / reorder a bit
Implement has_data() for realz.
2018-10-22 14:21:23 -07:00
Michiharu Ariza 570b77f7d2 Merge branch 'master' into cff-subset 2018-10-22 13:06:47 -07:00
Behdad Esfahbod 9085a72deb [cpal] Touch up palette flags 2018-10-22 13:03:29 -07:00
Behdad Esfahbod ee11fae9d0 [color] Rename "gid" to "glyph"
We don't expose "gid" in API.
2018-10-22 13:03:29 -07:00
Behdad Esfahbod 228fa71bf9 [colr] Move sanitize 2018-10-22 13:03:29 -07:00
Ebrahim Byagowi d440c8d3fb
Add chromacheck Emoji test fonts and minor preparations (#1294) 2018-10-22 22:07:59 +03:30
Michiharu Ariza 857c58279e Merge branch 'master' into cff-subset 2018-10-22 09:57:20 -07:00
Behdad Esfahbod b92b9d7e52 [colr] Move compare function into a static
Not sure if MSVC would be unhappy about this.
2018-10-22 10:17:31 +02:00
Behdad Esfahbod b6b171732a [colr] Minor 2018-10-22 10:17:31 +02:00
Behdad Esfahbod a6ade3471e [colr] Move sanitize() to right place
Sanitize always comes just before data member definitions, so
it's easy to cross-check.
2018-10-22 10:17:31 +02:00
Behdad Esfahbod 24adc15757 [colr] Touch up a bit
When a struct is plain old data with no references, etc, it's okay
to mark its members public.
2018-10-22 10:17:31 +02:00
Khaled Hosny cc6e77ca98 [color] Fix documentation a bit 2018-10-22 10:17:31 +02:00
Ebrahim Byagowi 37ba2413c1 Minor 2018-10-22 10:17:31 +02:00
Ebrahim Byagowi 44f79b4bf8 Remove _palette_entry_count as can be done with _palette_colors 2018-10-22 10:17:31 +02:00
Ebrahim Byagowi 6795dcfc08 [test] Test hb_ot_color_has_{colr,cpal}_data 2018-10-22 10:17:31 +02:00
Ebrahim Byagowi b8ee3a0ec8 [CPAL] Add palette entry and enable palette flag API 2018-10-22 10:17:31 +02:00
Ebrahim Byagowi d4261b4bb6 Add API test for hb_ot_color_get_color_layers 2018-10-22 10:17:31 +02:00
Ebrahim Byagowi 456978d408 Address COLR/CPAL reviews and revive cpal_v1 tests 2018-10-22 10:17:31 +02:00
Ebrahim Byagowi 687f679b80 [color] Fix alpha channel value and adjust spaces 2018-10-22 10:17:31 +02:00
Ebrahim Byagowi 00e94ce24e [dump-emoji] Formatting 2018-10-22 10:17:31 +02:00
Ebrahim Byagowi e8a6f5b803 Add three macros for separating color channels 2018-10-22 10:17:31 +02:00
Khaled Hosny d4e928b142 [color] Minimal API for COLR/CPAL 2018-10-22 10:17:31 +02:00
Behdad Esfahbod 1e39833ba8 [docs] Minor 2018-10-20 16:57:36 -07:00
Behdad Esfahbod a5ad8c658d [docs] More fixes 2018-10-20 16:52:55 -07:00
Behdad Esfahbod 314b1af74f [docs] Fix warning
Fixes https://github.com/harfbuzz/harfbuzz/issues/1260
2018-10-20 16:49:16 -07:00
Behdad Esfahbod b713c13977 [kerx] Implement tuple-kerning in Format0 2018-10-20 14:56:28 -07:00
Behdad Esfahbod 0a3b7a0fb0 2.0.2 2018-10-20 13:14:07 -07:00
Behdad Esfahbod 68b7050768 [kerx] Fix sanitize of KerxSubtableFormat2::array read
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11033
2018-10-20 12:20:57 -07:00
Behdad Esfahbod 00fdbca4f6 [aat] Fix LookupFormat10 sanitize
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11060
2018-10-20 12:20:57 -07:00
Ebrahim Byagowi 1e55e21dea
Merge pull request #1283 from khaledhosny/cygwin
Cygwin fixes and CI build
2018-10-20 07:45:46 +03:30
Behdad Esfahbod 7c2c8ac301 2.0.1 2018-10-19 19:39:58 -07:00