src/hb-ot-cff-common.hh


Log

Author Commit Date CI Message
Behdad Esfahbod a220479f 2025-07-26T06:10:31 Remove std::forward inside loops (#5424) * [iter,cff] Remove std::forward from inside loops Was moving multiple times, if args were movable. * [CPAL] Handle an error * [serialize] Remove another std::forward in a loop * [bit-page] Fix a static-analysis out-of-range warning Code was safe. Just rewrite. * [ot-layout] Remove another std::forward from inside a loop
Behdad Esfahbod 7a890c2e 2024-09-22T13:19:02 Add hb_barrier() to switches of unions https://github.com/harfbuzz/harfbuzz/pull/4864#issuecomment-2366923736
Behdad Esfahbod fa9dc530 2024-02-06T14:44:56 Move CFF Index types to open-type https://github.com/harfbuzz/boring-expansion-spec/blob/main/VARC.md#cff2indexof
Behdad Esfahbod 5b325c0a 2023-12-13T15:27:47 [cff] Fix late sanitize Last summer I changed sanitizer->check_struct() to only check the trailing point of the struct on 64bit machines. This works mostly because offsets are always positive. Not anymore. Recently we introduced negative offsets in CFF, and this was causing sanitize() for such structs pass while the struct's leading edge was out of range. Fix that. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64859
Behdad Esfahbod bf84135e 2023-12-05T11:58:21 [cff] Support negative offsets Fixes https://github.com/harfbuzz/harfbuzz/issues/4508
Garret Rieger c6884377 2023-11-06T20:21:46 [subset] Add HB_SUBSET_FLAGS_IFTB_REQUIREMENTS flag. When enabled the output subset conforms to the requirements for a base font to be patched by IFTB patches. IFTB is a proposed incremental font transfer patch. This new flag is set as experimental. Currently, setting this flag causes the output subset to also use long offsets for outline data in loca/glyf, gvar, CFF, and CFF2. This change is a version of https://github.com/skef/harfbuzz/commit/3ae2fe2084d96f61d8ad1bbe42a6ef4e62ec830a rebased onto head w/ tests added.
Behdad Esfahbod 3a9262cc 2023-11-04T12:52:46 [sanitize] More hb_barrier() annotations
Behdad Esfahbod e60ec9dc 2023-07-08T20:47:34 [subset/cff2] Speedup retaingids serialize 10% speedup in subset_glyphs/SourceHanSans-VF.otf/retaingids/10
Behdad Esfahbod d1660eaf 2023-06-29T11:59:03 [subset/cff] Minor use HB_OPTIMIZE_SIZE_VAL
Behdad Esfahbod 62f5ed46 2023-06-28T12:02:52 [subset/cff] Fix an infinite loop Fixes https://oss-fuzz.com/testcase-detail/5419002026131456
Behdad Esfahbod 73a82af1 2023-06-27T17:05:22 [subset/cff] Remove stale wrong code With my recent rewrite of serialize_header, this seems to work now.
Behdad Esfahbod 158eba66 2023-06-27T16:22:54 [subset/cff] Fix compiler error About variable with internal linkage with no definition.
Behdad Esfahbod b0472199 2023-06-27T16:07:54 [subset/cff1] Micro-optimize code Let compiler see whether optional argument is present.
Behdad Esfahbod 1cabb65b 2023-06-27T16:01:17 [subset/cff] Micro-optimize CFFIndex::serialize_header Unfortunately hb_array_t::begin/end are faster than its _begin/_end. As such, a range loop on array itself is faster than range loop on pipeline starting with array. Rework code to loop on the array always.
Behdad Esfahbod c2bab073 2023-06-26T16:34:53 [subset/cff] Minor optimization
Behdad Esfahbod 570fb4df 2023-06-26T16:26:12 [subset/cff] Add a vector pre-alloc
Behdad Esfahbod 81e2db7c 2023-06-26T14:17:44 [subset/cff1] Speed up plan_subset_charset
Behdad Esfahbod d3f90a8c 2023-06-26T14:02:26 [subset/cff] Use a typedef for glyph_to_sid_map_t
Behdad Esfahbod d4bbe3f4 2023-06-23T18:13:30 [subset/cff] Reuse a calculate index total data size
Behdad Esfahbod da2e2c8c 2023-06-08T17:16:53 [subset/cff] Speed up offset writing
Behdad Esfahbod a67a7867 2023-06-07T20:24:02 [cff] Tweak CFFIndex accessors again Faster; avoiding multiply.
Behdad Esfahbod 04c5e46a 2023-06-07T19:18:04 [subset/cff] Fix comment
Behdad Esfahbod 8832da83 2023-06-07T18:58:52 [subset/cff] Comment
Behdad Esfahbod 092373f3 2023-06-07T17:49:13 [subset/cff] Comment
Behdad Esfahbod 138461be 2023-06-07T14:07:39 [susbet/cff] Minor remove one indirection
Behdad Esfahbod 41369b66 2023-06-07T14:04:42 Revert "[subset/cff1] Optimize writing of consecutive names" This reverts commit 3b25a630403b65eb5608d10c3b8d082a141bd5c8. Not worth it. Shows 0.5% speedup only on SourceSansPro/retaingids/10 Doesn't have code size increase though.
Behdad Esfahbod 3b25a630 2023-06-07T14:04:25 [subset/cff1] Optimize writing of consecutive names
Behdad Esfahbod 5fe96213 2023-06-07T12:05:57 [subset/cff] Micro-optimize CFFIndex writing
Behdad Esfahbod b80b6a4f 2023-06-06T18:11:55 [cff] Remove unused types
Behdad Esfahbod 26ac1d4b 2023-06-06T18:08:59 [cff] Remove unused method
Behdad Esfahbod c6ce1f81 2023-06-06T17:17:29 [cff] Micro-optimize CFFIndex::operator[]
Behdad Esfahbod 35e152b9 2023-06-06T16:21:14 [subset/cff] Micro-optimize CFFIndex for empty strings
Behdad Esfahbod 5676adef 2023-06-05T15:56:19 [subset/cff1] Remove an unneeded copy method Same as serializer embed().
Behdad Esfahbod 7d969812 2023-06-05T15:44:50 [subset/cff1] Micro-optimize Is ugly but shows speedup.
Behdad Esfahbod 1636e112 2023-06-05T13:44:00 [cff] Micro-optimize
Behdad Esfahbod 27299e0d 2023-06-05T13:41:04 [subset/cff] Minor use hb_len()
Behdad Esfahbod 377ccb31 2023-06-05T13:38:06 [subset/cff] Speed up set_offset_at
Behdad Esfahbod 6188a3f5 2023-06-04T15:12:56 [subset/cff] Minor signedness change
Behdad Esfahbod 887f2993 2023-06-04T15:11:17 [susbet/cff] Reuse iterator
Behdad Esfahbod f5b82846 2023-06-04T15:10:08 [subset/cff1] Minor use hb_len
Behdad Esfahbod 70638170 2023-06-04T15:03:16 [subset/cff1] Speed up writing 1byte charstrings As in the holes of retaingids.
Behdad Esfahbod b1522239 2023-06-04T13:58:10 [cff] Minor type change
Behdad Esfahbod 9cdc0b64 2023-06-04T11:18:56 [subset/cff] Speed up subset_cff_fdselect
Behdad Esfahbod 858a0223 2023-06-04T10:55:41 Revert "[cff] Optimize writing out Index offsets" This reverts commit 78ba23c58766c16992ddc4e3af403824aa845fe2. Not enough gain, and bloats code size.
Behdad Esfahbod 78ba23c5 2023-06-04T10:52:19 [cff] Optimize writing out Index offsets
Behdad Esfahbod 82741304 2023-06-04T09:41:41 [subset] start_embed never returns nullptr Remove checks.
Behdad Esfahbod 36e1a633 2022-12-01T16:52:29 [cff] Add total_size to INDEX
Behdad Esfahbod a2681c37 2022-12-01T16:09:03 [cff-subset] Simplify INDEX serialize() more
Behdad Esfahbod c4b05878 2022-12-01T15:56:37 [subset-cff] Remove INDEX unused serialize() methods
Behdad Esfahbod b3ad4d72 2022-12-01T15:46:00 [cff] Another no-memset in INDEX
Behdad Esfahbod 70ac6dfb 2022-12-01T14:56:28 [subset-cff] Don't memset 0 INDEX and other serialize methods Not necessary.
Behdad Esfahbod 2dc2e016 2022-11-30T11:25:50 [cff] Enable an unlikely
Behdad Esfahbod 582a87ef 2022-11-30T11:20:19 [cff] Speed up FDSelect0 sanitize
Behdad Esfahbod ded9de9c 2022-11-28T13:31:40 [cff] bsearch in fdselect Saves 8% in NotoSansCJK / 10000 subset benchmark.
Behdad Esfahbod 59c45f6d 2022-11-22T12:54:50 Use hb_memcpy instead of memcpy consistently
Behdad Esfahbod a2984a29 2022-11-21T18:40:01 [cff] Remove unnecessary namespacing
Behdad Esfahbod b238578a 2022-11-21T14:36:57 [cff] Optimize INDEX operator[]
Behdad Esfahbod 5ee6d5d7 2022-11-21T11:00:29 [cff] Add memory-barrier to INDEX Like we do for ArrayOf.
Garret Rieger 19a8db85 2022-05-13T18:05:05 [subset] fix potential integer overflow in gname_t::cmp.
Behdad Esfahbod 2d2f66e1 2022-05-13T13:53:17 [cff-common] In INDEX, return empty bytes if length is zero Before it was possible to return non-null arrayZ.
Behdad Esfahbod 9033c7f9 2022-05-10T14:58:53 [cff-common] Optimize INDEX::operator[] Previous try showed slowdown in benchmarks, suprisingly. Rewrite it keeping the function, hopefully allowing better optimization.
Behdad Esfahbod 3aace243 2022-05-10T14:54:04 Revert "[cff-common] Optimize INDEX::operator[]" This reverts commit 9edb03ac7ac4b4d0814f3fd1f20cc8d2be99e971.
Behdad Esfahbod 9edb03ac 2022-05-10T14:25:08 [cff-common] Optimize INDEX::operator[]
Behdad Esfahbod 64d63ceb 2022-05-09T16:16:07 [cff-common] Use existing types for str_buff_vec_t
Behdad Esfahbod e1838ec1 2022-05-09T16:14:13 [cff-common] Remove unused method
Behdad Esfahbod 8aa54aac 2022-05-09T16:09:56 [cff] Replace byte_str_t with hb_bytes_t use
Behdad Esfahbod c8a5f1e3 2022-05-09T15:49:47 [cff-common] Indent
Behdad Esfahbod be7b2905 2022-05-09T15:48:18 [cff-common] Remove unused INDEX::serialize() method
Behdad Esfahbod 60390169 2022-05-09T15:44:09 [cff-common] Write str_buf_t::total_size() as dagger
Behdad Esfahbod 258afb45 2022-05-09T15:40:55 [cff-common] Use range-based loop in str_buff_vec_t
Behdad Esfahbod 8bb1a3ce 2022-05-09T15:38:40 [cff-common] Write INDEX offset-size calc using hb_bit_storage()
Behdad Esfahbod 2ccfe84e 2022-05-09T15:35:04 [cff-common] Add assert to INDEX::set_offset_at()
Behdad Esfahbod 4bcab9e9 2022-05-09T15:30:42 [cff-common] Use byte_str_t() instead of Null(byte_str_t)
Behdad Esfahbod 94f7a263 2022-05-09T15:29:14 [cff-common] Fix get_size() for Null object The special-casing didn't make sense.
Behdad Esfahbod c9cc7d5d 2022-05-09T15:27:27 [cff-common] Inline once-used method in INDEX
Behdad Esfahbod 11482a3a 2022-05-09T15:25:21 [cff-common] Remove unused method from INDEX
Behdad Esfahbod d1bb3b08 2022-05-09T15:23:59 [cff-common] Hide more INDEX internals
Behdad Esfahbod d3b21387 2022-05-09T15:22:55 [cff-common] Remove redundant operator implementation
Behdad Esfahbod a96b408d 2022-05-09T15:20:16 [cff-common] Hide INDEX internals
Behdad Esfahbod 335b1d83 2022-05-06T13:37:11 [cff-common] No need to check max-offset in INDEX The length_at() function makes sure out-of-range offsets are discarded. We just need to check the last offset.
Behdad Esfahbod 2884eb97 2022-05-06T12:54:02 [cff-common] Remove special-casing of count=0 in INDEX serialize The generic code-path now can handle count=0.
Behdad Esfahbod fc7f51ae 2022-05-06T12:53:19 [cff-common] Reduce iterator calls
Behdad Esfahbod c857b8e3 2022-05-06T12:50:37 [cff-common] Set INDEX min_size to 2 That is what it is, for an empty INDEX.
Behdad Esfahbod d8292b84 2022-04-27T12:38:35 [CFF] Fix parsing of empty Index https://github.com/harfbuzz/harfbuzz/issues/3545#issuecomment-1111047941
Behdad Esfahbod 035f0334 2022-01-18T09:26:30 [str_buff_vec_t] Remove unused fini method
Behdad Esfahbod 6d555ce8 2021-11-02T00:18:22 [meta] Use std::forward instead of hb_forward()
Behdad Esfahbod f0a1892f 2021-07-28T17:36:22 [serialize] Remove unnecessary pointer indirection
Behdad Esfahbod 6d941944 2021-02-19T17:08:10 Use auto in range-for-loop more
Ebrahim Byagowi 08428a15 2020-04-24T23:45:17 minor, spacing
Ebrahim Byagowi 2be859d2 2020-04-20T23:48:23 minor, replace nullptr checks with implicit ones
Ebrahim Byagowi 2dda6dd7 2020-04-20T14:12:45 minor, tweak spacing turn 8 spaces to tab, add space before Null/Crap
Ebrahim Byagowi a224f417 2020-03-13T08:33:34 Turn more of simple dagger chains to foreach Less noise, as was agreed before and applied 385741d also
blueshade7 4c3af7d4 2020-03-05T15:40:44 add "add_link()" with bias arg issue #2227
ariza e8f010d7 2020-03-04T16:54:27 removed unused code & data; rename
ariza c05458ec 2020-03-02T16:51:19 update cff & cff2 subsetters
ariza 002f0e20 2020-02-27T17:34:26 reimplment serialize_int using check_assign()
Ebrahim Byagowi ce114d6b 2019-12-31T15:53:02 minor, tweak spaces
Ebrahim Byagowi 2d7221a0 2019-10-01T15:05:02 [cff] minor
Ebrahim Byagowi 0558413f 2019-10-01T13:49:55 Minor, tweak spaces
Behdad Esfahbod 0e294c45 2019-09-06T16:54:27 Rename VAR to HB_VAR_ARRAY