Commit Graph

52 Commits

Author SHA1 Message Date
Behdad Esfahbod 997d9cc466 [map] Make unique_ptr hashable 2022-06-02 18:47:42 -06:00
Behdad Esfahbod 371e14d99c Combine uses of map has() then get() with has(.., &..) 2022-05-28 13:40:30 -06:00
Garret Rieger b051f3fa83 [subset] Fix cpal subsetting when there are partial palette overlaps.
The existing code doesn't correctly handle the case where palettes partially overlap in the color record array. This changes the subsetting to only share entries in the color record array when palettes have the same first color index. Partially overlapping palettes will be converted to disjoint segments in the color record array.

Updates one of the color tests to use multiple palettes.

Also fixes fuzzer: https://oss-fuzz.com/testcase-detail/5568200165687296.
2022-05-09 12:25:05 -06:00
Garret Rieger 280366ba6a Add TODO to update NN offsets to allow nulls. 2021-08-18 16:52:45 -06:00
Garret Rieger dc31920bbe Don't serialize null offsets in CPAL.
Fixes https://oss-fuzz.com/testcase-detail/5443213648330752
2021-08-18 16:52:45 -06:00
Qunxin Liu 7416faceeb [subset] fuzzer fix: https://oss-fuzz.com/testcase-detail/5715464591376384 2021-07-08 09:09:30 -07:00
Qunxin Liu f739e1dc6a [subset] subset both CPAL and COLRv1 2021-05-26 15:39:42 -06:00
Behdad Esfahbod ad28f973f3 Rename offset types to be explicit about their size
Add Offset16To<>, Offset24To<>, and Offset32To<> for most use-cases.
2021-03-31 13:00:07 -06:00
Ebrahim Byagowi b2d0dba5ef [cpal] Port to dagger 2020-06-20 22:06:19 +04:30
Ebrahim Byagowi 2dda6dd744 minor, tweak spacing
turn 8 spaces to tab, add space before Null/Crap
2020-04-20 16:18:29 +04:30
Ebrahim Byagowi 0558413f27 Minor, tweak spaces 2019-10-01 13:50:11 +03:30
Ebrahim Byagowi a0b4ac4dce Turn 8 spaces to tab across the project
According to the current code style of the project
2019-08-27 02:40:41 +04:30
Ebrahim Byagowi 521c7013ab
[cpal] revert port to dagger
It has a different semantic, maybe we should just do a zero memset,
letting Behdad to decide.
2019-07-30 18:10:40 +04:30
Ebrahim Byagowi 8014ce198a
[cpal] port to dagger (#1887) 2019-07-30 17:31:34 +04:30
Behdad Esfahbod 41248cce0e Remove MIN/MAX in favor of hb_min/hb_max 2019-05-07 20:54:31 -07:00
Ebrahim Byagowi 92588782d7
Remove space between right angle brackets now that we have C++11 (#1689) 2019-04-30 13:05:10 -07:00
Behdad Esfahbod ef00654962 Convert tag enum class consts to static constexpr
Part of https://github.com/harfbuzz/harfbuzz/issues/1553
2019-01-22 12:17:26 +01:00
Behdad Esfahbod b1152d5e66 Use NNOffsetTo<> 2019-01-17 18:17:04 -05:00
Ebrahim Byagowi e412008599 Remove redundant void from C++ sources (#1486) 2018-12-17 13:01:01 -05:00
Ebrahim Byagowi b2ebaa9afa Remove redundant 'inline' from methods (#1483) 2018-12-16 14:08:10 -05:00
Ebrahim Byagowi 7ee5c52345
minor style fix, use void in methods on no argument 2018-12-12 15:14:37 +03:30
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 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 5c4fead734 Convert "static const hb_tag_t" constants to enum 2018-11-29 15:05:47 -05:00
Behdad Esfahbod 72462eb765 Add UnsizedArrayOf::as_array() instead of hb_array() template 2018-11-02 11:46:42 -04: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
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 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 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 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 228f96c9d0 [color] Finish reviewing / revamping CPAL
Now to hb_color_t.
2018-10-22 16:55:12 -07:00
Behdad Esfahbod 14474d2104 [color] Rely on CPALV1Tail Null object 2018-10-22 16:31:13 -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
Behdad Esfahbod 3b3668acc8 [color] Rename / reorder a bit
Implement has_data() for realz.
2018-10-22 14:21:23 -07:00
Ebrahim Byagowi 37ba2413c1 Minor 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 456978d408 Address COLR/CPAL reviews and revive cpal_v1 tests 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 10642b3fbf Disallow null-enabled offsets to unsized structures...
...like UnsizedArrayOf<>.

This fixes a class of crasher bugs, mostly with color and AAT tables.  We
cannot use nullable offsets to varsized data that does not declare min_size,
because it's nost safe to use our fixed-size null pool for types that have
their size external.  So, use non_null'able offsets for these.

A further enhancement would be to make use of min_size in Null<> itself.
Will try that after.
2018-09-15 19:43:33 +02:00
Behdad Esfahbod c77ae40852 Rename hb-*private.hh to hb-*.hh
Sorry for the noise, downstream custom builders.  Please adjust.
2018-08-25 22:36:36 -07:00
Ebrahim Byagowi a47070cd40
Minor, annotate the added tables with likely/unlikely (#997) 2018-04-18 12:09:37 +04:30
Ebrahim Byagowi a02c3ee70f Add or update tables specifications links 2018-04-12 13:44:32 +04:30
Ebrahim Byagowi f8bb582bcc
[ot-color] Cosmetic changes (#962) 2018-04-11 17:13:20 +04:30
Ebrahim Byagowi a62554af89
[colr/cpal] Improvements and add a sample renderer (#927) 2018-04-10 00:53:50 +04:30
Behdad Esfahbod 23a9ac9938 Remove hb-ot-color.h
So I can make a release.
2018-03-07 15:51:42 +01:00