src/hb-open-type.hh


Log

Author Commit Date CI Message
Behdad Esfahbod a0bde1e1 2022-11-16T21:27:12 [open-type] Remove (Sorted)ArrayOf.sub_array()
Behdad Esfahbod c7d57dcf 2022-11-16T21:21:31 [vector/array] Simplify qsort()
Behdad Esfahbod 5769d422 2022-10-13T12:12:24 [type] Add HBFixed template
Behdad Esfahbod 8c29dcae 2022-10-13T12:04:32 s/HBFixed/F16DOT16/g
Behdad Esfahbod b57ea3b0 2022-08-05T14:29:27 Revert "[iter] Use && in uses of is_source_of" This reverts commit ccbba667a9bdc096f0053d5e3ee951a8b6298e8a.
Behdad Esfahbod ccbba667 2022-08-05T11:51:51 [iter] Use && in uses of is_source_of
Behdad Esfahbod 91c60802 2022-07-18T22:24:28 [open-type] Fix overflow check Without the cast, the compiler is within its rights to reason that overflow didn't happen and optimize away the check, as clang was.
Behdad Esfahbod f0707e23 2022-07-17T16:47:16 [atomic] Add compiler memory_r_barrier https://github.com/harfbuzz/harfbuzz/issues/3728
Behdad Esfahbod f3151b65 2022-07-17T16:19:28 [ArrayOf family] Use memory barrier before accessing array Without it, the compiler was reordering and batching the read of array length and array[0] if the 0'th member was accessed constantly and function was inlined. This felt safe to the compiler because HB_VAR_ARRAY is 1, but could be unsafe actually. The memory barrier disallows that. This was found by afl/honggfuzz address sanitizers. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=49187
Behdad Esfahbod 9843f076 2022-07-15T16:03:55 [OffsetTo] Try catching nullable offsets to unbounded types Doesn't catch all cases; if type is not fully defined at OffsetTo time, we can't know. Fixes https://github.com/harfbuzz/harfbuzz/issues/1300 to the best we can do.
Behdad Esfahbod 9ef9fc01 2022-07-11T13:29:23 [>64k:layout] Templatize GSUBGPOSFormat1
Behdad Esfahbod f6c2aaee 2022-07-11T13:06:48 [>64k:layout] Add List16OfOffsetTo
Behdad Esfahbod 7c4e9080 2022-07-11T14:01:52 [sanitize] Minor trace format fixup This likely() is unlikely to make a difference, and obscures the return_trace() message by writing out "something" instead of the true/false value.
Behdad Esfahbod 2c672617 2022-07-06T12:26:16 [open-type] Add HBGlyph24
Behdad Esfahbod 486555c6 2022-07-05T17:12:59 [open-type] Add Array24Of<> and SortedArray24Of<>
Thomas Devoogdt c657c4e1 2022-05-10T10:00:06 [meta] fix type traits on gcc 4.9 #3526 Signed-off-by: Thomas Devoogdt <thomas.devoogdt@barco.com>
Behdad Esfahbod 7a078c39 2021-11-02T00:44:51 [meta] Use std::conditional instead of hb_conditional()
Behdad Esfahbod 943921cf 2021-11-02T00:26:46 [meta] Use more std type_traits
Behdad Esfahbod 6d555ce8 2021-11-02T00:18:22 [meta] Use std::forward instead of hb_forward()
Behdad Esfahbod be42800f 2021-11-02T00:04:18 [meta] Use std::is_trivially_... instead of internal copies
Behdad Esfahbod 14a2df7b 2021-09-19T23:06:09 Add stub HBUINT15
Behdad Esfahbod c852b868 2021-09-19T16:30:12 Rename HBGlyphID to HBGlyphID16
Behdad Esfahbod f0a1892f 2021-07-28T17:36:22 [serialize] Remove unnecessary pointer indirection
Behdad Esfahbod 03cd9c5c 2021-07-22T11:27:33 Align lfind() API to match bfind()
Behdad Esfahbod 29c9833e 2021-07-09T11:58:36 Remove Offset::serialize() Finishing https://github.com/harfbuzz/harfbuzz/pull/2355
Garret Rieger 0da9158f 2021-06-29T14:23:37 [subset] Remove OffsetTo::serialize(). Convert remaining uses of it to serialize_serialize() which correctly uses the object packer.
Garret Rieger 35458b6b 2021-06-11T13:14:51 [subset] Add serialize_serialize to OffsetTo. Similar to serialize_subset() this will serialize the new object and then link it to the offset.
Behdad Esfahbod 70110f6a 2021-03-31T17:04:02 Modify OffsetTo<>::sanitize() overflow check The code in question was introduced in 70eb2ff682. Rewrite it to not call sanitizer check_range() as we want to use check_range() for byte accounting. Part of https://github.com/harfbuzz/harfbuzz/pull/2923
Behdad Esfahbod 4dba749d 2021-03-31T16:09:39 Add SortedArray{16,32}Of<>
Behdad Esfahbod 5639e253 2021-03-31T16:04:43 Add Array16Of<>
Behdad Esfahbod 2520a82d 2021-03-31T15:34:26 s/LArrayOf/Array32Of/g
Behdad Esfahbod 5efe3609 2021-03-31T15:33:22 Rename (Unsized)OffsetListOf
Behdad Esfahbod 6c4e0491 2021-03-31T15:31:32 s/OffsetArrayOf/Array16OfOffset16To/g
Behdad Esfahbod 1fc6b69a 2021-03-31T15:30:35 s/UnsizedOffsetArrayOf/UnsizedArray16OfOffsetTo/g
Behdad Esfahbod 2a54c9f7 2021-03-31T15:26:42 .
Behdad Esfahbod 9b4b5849 2021-03-31T13:27:21 Fixup for recent OffsetTo<> changes
Behdad Esfahbod ad28f973 2021-03-31T12:49:14 Rename offset types to be explicit about their size Add Offset16To<>, Offset24To<>, and Offset32To<> for most use-cases.
Behdad Esfahbod 9ffc46b8 2021-03-31T11:26:18 Add VarIdx
Behdad Esfahbod 2179281c 2021-03-31T11:20:21 Add Offset24
Behdad Esfahbod 23976893 2021-03-29T17:34:23 Remove hb_success_t Was not rolled-out yet. So just expand.
Behdad Esfahbod 7a2eda78 2021-03-29T17:32:29 Move code around
Behdad Esfahbod bcb57dcc 2021-03-29T17:31:09 [sanitize] Add short-circuit to ArrayOfM1 Like the sibling ArrayOf types.
Garret Rieger b14475d2 2021-03-18T10:51:26 [subset] further changes to serializer error handling. - Rename enum type and enum members. - in_errors() now returns true for any error having been set. hb-subset now looks for offset overflow only errors to divert to repacker. - Added INT_OVERFLOW and ARRAY_OVERFLOW enum values.
Garret Rieger 73ed59f7 2021-03-17T15:53:10 [subset] store errors in the serializer as a flag set. Make check_assign/check_equal specify the type of error to set.
Behdad Esfahbod 486da35c 2021-02-23T13:58:14 m Add comments to IntType cast out operator Okay, bots seem to be happy. Merging.
Behdad Esfahbod d6bd00a4 2021-02-22T22:42:50 Revert back IntType out cast to signed/unsigned Previous commit didn't fix the bots. Putting it back now that I understand why I initially did the "Wide" casts. But only doing it for out-cast this time. This causes "narrowing" warnings whenever we are converting signed/unsigned to smaller HBUINT16 etc. But those are valuable warnings. We should address those separately instead of ignoring. Maybe we should start using uint16_t more liberally in the internal subsetter function signatures then.
Behdad Esfahbod 09836013 2021-02-22T22:33:17 Add back wider cast to IntType My local clang12 is fine, but many bots are not: ../src/hb-ot-cff1-table.hh: In instantiation of ‘bool CFF::Charset1_2<TYPE>::sanitize(hb_sanitize_context_t*, unsigned int) const [with TYPE = OT::IntType<unsigned char>]’: ../src/hb-ot-cff1-table.hh:554:13: required from here ../src/hb-ot-cff1-table.hh:377:60: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] if (unlikely (!ranges[i].sanitize (c) || (num_glyphs < ranges[i].nLeft + 1))) ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ Enabling the extra cast operator mentioned in previous commit to see if that fixes this case. Again, I'd be happy to say "use 1u instead of 1" if this was universally erred on. But since some compilers happily compile this while others err, it would be a huge headache. Let's see... https://github.com/harfbuzz/harfbuzz/pull/2875
Behdad Esfahbod 567cedcc 2021-02-22T22:09:15 Narrow down cast operators on IntType Say for USHORT, we were implementing casts from and to unsigned. With this change, we cast from and to uint16_t only. This allows compiler more opportunities to catch possible narrowing issues in the code. It needed a couple of fixes in the codebase though, because previously, if a USHORT was participating in arithmetic with signed numbers, eg. "u + 1", the result would have been unsigned. With this change, it would be signed. The correct fix is to update the code to read "u + 1u". That said, I think about conditionally adding back the cast out to signed/unsigned, to facilitate better type deduction. But I couldn't think of a real situation where that would help with anything. So I didn't add. Here's what it was: template <typename Type2 = hb_conditional<hb_is_signed (Type), signed, unsigned>, hb_enable_if (sizeof (Type) < sizeof (Type2))> operator hb_type_identity_t<Type2> () const { return v; } https://github.com/harfbuzz/harfbuzz/pull/2875
Behdad Esfahbod cc16b26e 2021-02-22T17:55:47 [constexpr] IntType See https://github.com/harfbuzz/harfbuzz/pull/2875
Behdad Esfahbod 8b2f9adf 2021-02-22T17:42:24 m Simplify Tag operator char*
Behdad Esfahbod e5b7bc42 2020-06-29T01:24:02 m Add default value to BEInt<> Size template parameter
Behdad Esfahbod 98374ceb 2021-02-05T13:40:10 Conditionalize IntType::cmp() so it never fails to compile Useful with lfind() since that calls hb_equal() which SFINAEs which cmp() to use.
Behdad Esfahbod 25c0a792 2020-12-10T14:29:47 Remove unused+wrong UnsizedArrayOf<> operators Said compiler is wrong to err since they are unused. But yeah, they didn't make sense and were copy/paste leftover. Fixes https://github.com/harfbuzz/harfbuzz/issues/2763
Ebrahim Byagowi 7e3edfa4 2020-07-18T19:03:36 minor
Ebrahim Byagowi 08d57d9e 2020-06-28T13:13:25 Add hb_array_t::lfind
Ebrahim Byagowi 385d64ee 2020-05-07T09:59:01 Add a not discardable bool type, hb_success_t
Ebrahim Byagowi 07acd1a0 2020-03-08T23:39:24 [subset] Rename src_base args to base to match sanitize methods So it will become easier to follow that serialize methods signatures should match with their sanitize methods counterparts.
ariza 188a0a47 2020-03-07T11:02:36 removed default base; replaced w/ bias if required
ariza 4aa354be 2020-02-20T05:03:15 chain second OffsetTo::serialize_copy() to first
ariza 4ca8e0d9 2020-02-19T12:52:18 re-implement Tail; rewrote name table with it
Qunxin Liu 82afc758 2020-02-04T13:24:37 [subset] GPOS4 MarkBase subsetting support
Behdad Esfahbod b1dc676e 2019-12-10T11:41:24 [algs] Reduce one more bsearch() impl Ouch, there were three more left. Down one. Two to go.
Ebrahim Byagowi 0558413f 2019-10-01T13:49:55 Minor, tweak spaces
Ebrahim Byagowi d512087e 2019-09-14T10:36:29 Rename GlyphID to HBGlyphID Avoid collision with macOS's ATSUnicodeTypes.h GlyphID
Behdad Esfahbod 229ef1d2 2019-09-10T10:31:07 Rename Fixed to HBFixed Fixes(!!) https://github.com/harfbuzz/harfbuzz/issues/1966
Behdad Esfahbod 0e294c45 2019-09-06T16:54:27 Rename VAR to HB_VAR_ARRAY
Behdad Esfahbod dc2c9aa0 2019-08-28T15:05:49 Rename
Behdad Esfahbod 42d887bd 2019-08-28T14:47:14 Beef up HeadlessArrayOf<> Should be merged with ArrayOf... https://github.com/harfbuzz/harfbuzz/issues/1937
Behdad Esfahbod 3ca809e3 2019-08-28T13:49:35 Add ArrayOf::pop()
Behdad Esfahbod 307bd6d7 2019-08-28T13:49:17 Add arithmetic operators to IntType<>
Behdad Esfahbod 062cad5e 2019-08-28T13:33:08 Add ArrayOf::serialize_append
Ebrahim Byagowi a0b4ac4d 2019-08-24T17:57:14 Turn 8 spaces to tab across the project According to the current code style of the project
Ebrahim Byagowi aab8e084 2019-07-26T02:19:22 minor spacing fix (#1869)
Behdad Esfahbod 6492b234 2019-06-17T14:19:13 Minor
Behdad Esfahbod 8938dd23 2019-06-17T14:12:11 Use injected class name
Behdad Esfahbod 1834cf86 2019-05-31T14:39:32 [serialize] Pass offset to serialize_subset()
Behdad Esfahbod 92604416 2019-05-31T14:34:34 [serialize] Pass offset to serialize_copy()
Behdad Esfahbod dfa5e429 2019-05-15T21:18:14 Add back symmetric OffsetTo<>::friend operator+ Finally seems to be working now.
Behdad Esfahbod 203ea58b 2019-05-15T16:14:40 More adjustment to OffsetTo<>::friend opeator+ Let's see if I break any bots. But yeah, it wasn't accepting a non-const pointer. It just happens that we don't use that in the code it seems.
Behdad Esfahbod 763ea422 2019-05-15T01:15:11 Another try
Behdad Esfahbod e1b2edb0 2019-05-15T01:12:04 Completely revert the thing back
Behdad Esfahbod c58eeb5f 2019-05-15T01:10:31 Another try at fix Fails locally. Trying to understand. Sigh
Behdad Esfahbod 004edf3b 2019-05-15T01:02:50 Ugh. How was the Travis bot happy before, but isn't now?! :(
Behdad Esfahbod e01c7b16 2019-05-15T00:52:17 Move OffsetTo operator+ back out of class Apparently there's different overload resolution rules that apply, at least with some (older?) version of gcc. hb-ot-name-table.hh: In member function ‘void OT::name::accelerator_t::init(hb_face_t*)’: hb-ot-name-table.hh:244:62: error: ambiguous overload for ‘operator+’ (operand types are ‘hb_blob_ptr_t<OT::name>’ and ‘OT::NNOffsetTo<OT::UnsizedArrayOf<OT::IntType<unsigned char, 1u> > > {aka const OT::OffsetTo<OT::UnsizedArrayOf<OT::IntType<unsigned char, 1u> >, OT::IntType<short unsigned int, 2u>, false>}’) this->pool = (const char *) (const void *) (this->table+this->table->stringOffset); ^ hb-ot-name-table.hh:244:62: note: candidates are: hb-ot-name-table.hh:244:62: note: operator+(const C*, long int) <built-in> hb-ot-name-table.hh:244:62: note: operator+(const char*, long int) <built-in>
Behdad Esfahbod b213042f 2019-05-15T00:50:48 Revert "Revert symmetric OffsetTo overloads" This reverts commit 01912efb74fc554a81c8cfe572145ce45b8fa58b. Actually this didn't break things. Fixing
Behdad Esfahbod 01912efb 2019-05-15T00:42:47 Revert symmetric OffsetTo overloads Reverts 57f65ae9355004044325dd6441cde761bca5e0a3 Caused ambiguous-overload on some gcc...
Behdad Esfahbod 57f65ae9 2019-05-14T22:52:59 Add symmetric friend operator+ for OffsetTo
Behdad Esfahbod 71208e50 2019-05-14T22:51:59 Move OffsetTo<> deref operators in-class as friends
Behdad Esfahbod 9bfe22af 2019-05-10T22:44:19 [sanitize] Fix previous commit
Behdad Esfahbod 4dcf6532 2019-05-10T22:23:24 [sanitize] Simplify
Behdad Esfahbod 23168c39 2019-05-10T22:11:51 [sanitize] Use hb_is_trivially_copyable()
Behdad Esfahbod 707ff5b5 2019-05-10T20:31:20 Minor
Behdad Esfahbod ed972d5d 2019-05-09T16:58:28 [iter] Rewrite test functions Notably, add hb_is_source_of(,) and hb_is_sink_of(,) to replace most uses of hb_is_iterator_of(,).
Behdad Esfahbod e2a51ff7 2019-05-08T16:41:39 Remove unused var
Behdad Esfahbod e8b45c19 2019-05-08T16:37:38 [array] Add .copy()
Behdad Esfahbod 7166bd56 2019-05-08T14:24:57 Minor
Behdad Esfahbod dfc57802 2019-05-07T23:26:09 Fix more double-promotion errors WHy do only some of the clang bots catch this I have no idea :(.
Behdad Esfahbod af571dbf 2019-05-07T21:39:20 [meta] Replace most hb_enable_if with hb_requires They do absolutely same thing. hb_requires is to encode constraints, whereas hb_enable_if is for more conditional enabling.
Behdad Esfahbod 83e3eabd 2019-05-07T20:58:43 Whitespace
Behdad Esfahbod 41248cce 2019-05-07T20:54:31 Remove MIN/MAX in favor of hb_min/hb_max