Commit Graph

6402 Commits

Author SHA1 Message Date
Michiharu Ariza 0b952e6026 more leak fixes 2018-12-04 10:22:35 -08:00
Michiharu Ariza 9473463f5c fix attempt for oss-fuzz 11662 leak 2018-12-04 09:58:48 -08:00
Michiharu Ariza 04f2ca9421 removed assert 2018-12-04 09:24:07 -08:00
Behdad Esfahbod c968869f21
Merge pull request #1441 from harfbuzz/cff-doublenum
use double as CFF Number implementation
2018-12-04 04:14:13 -05:00
Michiharu Ariza c48f53d309 more double changes 2018-12-03 16:59:41 -08:00
Michiharu Ariza 5fff6ab002 additional precision made a difference in extents test 2018-12-03 16:06:58 -08:00
Michiharu Ariza 9e5180cd44 more double changes 2018-12-03 15:32:42 -08:00
Michiharu Ariza 9af33d7a2a Number to use double for all types 2018-12-03 14:48:46 -08:00
Ebrahim Byagowi 01f628cf55 [aat] Expose hb_aat_layout_has_tracking API 2018-12-03 22:27:26 +03:30
Behdad Esfahbod d19b1680b5 [aat] Expose a couple APIs
New API:
+hb_aat_layout_has_substitution()
+hb_aat_layout_has_positioning()
2018-12-03 10:41:37 -05:00
Behdad Esfahbod 84efe0438e [aat] Fix division sign fallout
Happened after 11d2f49af8
since now nClasses is unsigned int...
2018-12-02 12:39:14 -05:00
Behdad Esfahbod 2087f5a2a7 Add casts to hb_array_t<> 2018-12-01 20:04:45 -05:00
Behdad Esfahbod 58d4d19947 Simplify build source list 2018-12-01 19:34:18 -05:00
Behdad Esfahbod 11d2f49af8 New approach to change BigEndian casts to be int-sized
Fixes spurious warnings like:
Fixes https://github.com/harfbuzz/harfbuzz/issues/1436
2018-12-01 13:12:21 -05:00
Behdad Esfahbod 50e0273ab1 Change hb_assert_unsigned_t<> to hb_is_signed<> 2018-12-01 13:07:49 -05:00
Behdad Esfahbod c3a8b047aa Revert "Change BigEndian casts to be int-sized"
This reverts commit eb5ddd32bf.

Broke tests, badly.  To be investigated and reenabled.
2018-12-01 00:26:39 -05:00
Behdad Esfahbod be45677ab6 Minor 2018-12-01 00:04:29 -05:00
Behdad Esfahbod eb5ddd32bf Change BigEndian casts to be int-sized
Fixes spurious warnings like:
Fixes https://github.com/harfbuzz/harfbuzz/issues/1436
2018-12-01 00:03:01 -05:00
Behdad Esfahbod e8860fdcaa Fix more warning 2018-11-30 23:38:24 -05:00
Behdad Esfahbod af349ee348 Fix warning 2018-11-30 23:20:50 -05:00
Behdad Esfahbod 825df6dbc7 [CFF] Change spaces to tabs 2018-11-30 23:04:59 -05:00
Behdad Esfahbod 592f39b3c4 [CFF] Whitespace 2018-11-30 22:54:57 -05:00
Behdad Esfahbod a2e8d1d455 Minor 2018-11-30 22:54:20 -05:00
Behdad Esfahbod 5e64e0f532
Merge pull request #1113 from harfbuzz/cff-subset
CFF/CFF2 subsetter
2018-11-30 22:40:54 -05:00
Bruce Mitchener 09096aa89f Use nullptr instead of 0/NULL. (#1435)
* Use nullptr instead of 0/NULL.

* Update test-name-table.cc
2018-11-30 22:22:49 -05:00
Michiharu Ariza d8c6913765 undo 0u 2018-11-30 18:58:14 -08:00
Michiharu Ariza 2c859b3880 Merge branch 'master' into cff-subset 2018-11-30 18:47:34 -08:00
Behdad Esfahbod fb05908213 Revert ugly fixes
Now that we have 6daf45e0, revert cryptic hacks...

This reverts commit abd81ed4f5.
This reverts commit 9c6921c08c.
This reverts commit d39760cabf.
This reverts commit fedd8e6c17.

Fixes https://github.com/harfbuzz/harfbuzz/issues/1374
2018-11-30 20:56:15 -05:00
Behdad Esfahbod dfad19ad5a Make operator [] take signed int
The built-in operator takes signed int.  So, match it, such that
the built-in is never a better or equally-good match to our operator.
Fixes "ambiguous overload" errors from gcc 4.2 and VS 2008.

See https://github.com/harfbuzz/harfbuzz/issues/1374
2018-11-30 20:56:14 -05:00
Michiharu Ariza 9483da145d redo fixes 2018-11-30 16:59:41 -08:00
Michiharu Ariza 291da44823 yet another 2018-11-30 16:50:46 -08:00
Michiharu Ariza b1821b9d09 some more 2018-11-30 16:31:01 -08:00
Michiharu Ariza 9784cff556 fix another pesky gcc error 2018-11-30 16:07:08 -08:00
Michiharu Ariza 23a797b443 silence picky gcc errors 2018-11-30 15:15:31 -08:00
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