Behdad Esfahbod
c6368e014d
[map] Return const reference from operator()
...
Like we do in operator[].
2023-06-01 20:51:17 -06:00
Behdad Esfahbod
b04ca1c188
Revert "[subset/glyf] Exact allocation"
...
This reverts commit a830f085c8
.
Weirdly enough in a benchmark I'm running I see this show
some slowdown. Makes zero sense.
2023-06-01 20:43:07 -06:00
Behdad Esfahbod
a830f085c8
[subset/glyf] Exact allocation
2023-06-01 20:41:46 -06:00
Behdad Esfahbod
ff0b85cf57
[subset/glyf] Empty .notdef only if old-gid was also 0
...
Otherwise it wasn't a .notdef, even if new-gid is 0.
2023-06-01 20:30:56 -06:00
Behdad Esfahbod
65a7d8c6f0
[glyf] Empty glyphs need no padding
2023-06-01 20:20:00 -06:00
Behdad Esfahbod
73c18d1d42
[glyf] Micro-optimize padded_offsets
2023-06-01 20:11:22 -06:00
Behdad Esfahbod
88d8a6d69f
[BEInt] Use packed-int trick for writing as well
2023-06-01 19:49:44 -06:00
Behdad Esfahbod
4d853b8ba6
[subset/regaingid/glyf] Add a fastpath for empty glyphs
...
Mplus benchmark:
Comparing before to after
Benchmark Time CPU Time Old Time New CPU Old CPU New
-----------------------------------------------------------------------------------------------------------------------------------------------------------
BM_subset/subset_glyphs/Mplus1p-Regular.ttf/retaingids/10 -0.1764 -0.1771 0 0 0 0
BM_subset/subset_glyphs/Mplus1p-Regular.ttf/retaingids/64 -0.1394 -0.1394 0 0 0 0
BM_subset/subset_glyphs/Mplus1p-Regular.ttf/retaingids/512 -0.0644 -0.0645 0 0 0 0
BM_subset/subset_glyphs/Mplus1p-Regular.ttf/retaingids/4096 +0.0132 +0.0131 1 1 1 1
BM_subset/subset_glyphs/Mplus1p-Regular.ttf/retaingids/10000 -0.0029 -0.0034 3 3 3 3
BM_subset/subset_glyphs/Mplus1p-Regular.ttf/10 +0.0364 +0.0362 0 0 0 0
BM_subset/subset_glyphs/Mplus1p-Regular.ttf/64 +0.0346 +0.0343 0 0 0 0
BM_subset/subset_glyphs/Mplus1p-Regular.ttf/512 +0.0271 +0.0268 0 0 0 0
BM_subset/subset_glyphs/Mplus1p-Regular.ttf/4096 +0.0193 +0.0193 1 1 1 1
BM_subset/subset_glyphs/Mplus1p-Regular.ttf/10000 -0.0240 -0.0243 2 2 2 2
OVERALL_GEOMEAN -0.0305 -0.0307 0 0 0 0
2023-06-01 19:24:36 -06:00
Behdad Esfahbod
6ec7629fba
[subset/glyf] Add a const
2023-06-01 18:18:30 -06:00
Behdad Esfahbod
9f54ab922f
[subset-plan] Keep a reverse-gid vector
...
To speed up iteration.
2023-06-01 18:07:59 -06:00
Garret Rieger
6b0d386797
[subset] in subset benchmarks switch nohinting with retaingids.
...
retain gids is a more interesting case than no hinting for performance.
2023-06-01 18:04:21 -06:00
Qunxin Liu
1ae99d1a10
bug fix
2023-06-01 16:41:08 -06:00
Behdad Esfahbod
aa7dd70a86
[hmtx] Reduce map usage slightly
2023-06-01 14:24:33 -06:00
Garret Rieger
f41c5ec961
[map] update map benchmark to also test lookups that hit.
2023-06-01 12:39:58 -06:00
Qunxin Liu
4acf6a82bf
[instancer-solver] port solver fix from fonttools
...
See https://github.com/fonttools/fonttools/issues/3139
2023-05-30 18:58:22 +02:00
Garret Rieger
f3b4d35f36
[subset] Fix fuzzer crash.
...
https://oss-fuzz.com/testcase-detail/6608005089853440
2023-05-30 18:56:48 +02:00
Garret Rieger
ff326fbe8f
[repacker] check the result of add_buffer() in other places where it's called.
2023-05-30 01:40:57 +02:00
Behdad Esfahbod
66a84355ab
[hash] Use unsigned types
...
Hopefully ubsan wouldn't complain about overflows now.
2023-05-29 17:17:15 -06:00
Behdad Esfahbod
4a93576bca
Revert "[map] Speedup for int types"
...
This reverts commit c1b75f5ff0
.
I was seeing very long chains (140) and a 17% slowdown in
BM_subset/subset_codepoints/RobotoFlex-Variable.ttf/512
Bummer.
2023-05-28 13:24:02 -06:00
Behdad Esfahbod
c1b75f5ff0
[map] Speedup for int types
...
Since our int hash is now good, we don't need the modulo prime
here, so forgo it. Major speedup:
Comparing before to after
Benchmark Time CPU Time Old Time New CPU Old CPU New
-------------------------------------------------------------------------------------------------------------------
BM_MapInsert/16 -0.4136 -0.4137 6 4 6 4
BM_MapInsert/64 -0.4442 -0.4441 6 3 6 3
BM_MapInsert/512 -0.5382 -0.5383 8 4 8 4
BM_MapInsert/4096 -0.4160 -0.4162 8 5 8 5
BM_MapInsert/32768 -0.3256 -0.3258 12 8 12 8
BM_MapInsert/262144 -0.1723 -0.1727 11 10 11 9
BM_MapInsert/1048576 -0.2310 -0.2309 28 22 28 22
BM_MapLookup/16 -0.0247 -0.0247 3 3 3 3
BM_MapLookup/64 -0.1039 -0.1038 3 3 3 3
BM_MapLookup/512 -0.1076 -0.1079 4 3 4 3
BM_MapLookup/4096 -0.3729 -0.3732 9 6 9 6
BM_MapLookup/32768 +0.2467 +0.2468 9 12 9 12
BM_MapLookup/262144 -0.1862 -0.1868 14 11 14 11
BM_MapLookup/1048576 +0.1159 +0.1160 15 17 15 17
OVERALL_GEOMEAN -0.2414 -0.2416 0 0 0 0
2023-05-28 13:03:04 -06:00
Behdad Esfahbod
7f111787e4
[benchmark-map] Remove overhead
2023-05-27 12:41:33 -06:00
Behdad Esfahbod
5666807328
[benchmark-map] Improve Insert benchmark
...
Previously it was enlarging the map depending on whatever
number of runs the benchmark-runner decided to run the loop.
That wasn't very useful...
2023-05-27 12:37:36 -06:00
Behdad Esfahbod
00900f761f
[hash] Enable better hash for integers
...
https://github.com/harfbuzz/harfbuzz/pull/4228#issuecomment-1565079537
2023-05-27 10:14:09 -06:00
Garret Rieger
20c564bc76
[repacker] Fix fuzzer memory leak.
...
https://oss-fuzz.com/testcase-detail/6419865171525632
2023-05-27 01:16:46 +02:00
Behdad Esfahbod
5abe713203
[map] Resize map on long chain probes
2023-05-27 00:49:20 +02:00
Garret Rieger
a652281ed6
[subset] Fix fuzzer timeout.
...
Fixes https://oss-fuzz.com/testcase-detail/5979721620652032 . Timeout was caused by degenerate map insert behaviour due to poor integer hash function. Presize the map to avoid it. Also fixes collect_mapping() for cmap format 13.
2023-05-27 00:25:47 +02:00
Behdad Esfahbod
208c9490cb
[VarComposite] Limit number of axes that are copied
...
Bandaid for https://oss-fuzz.com/testcase-detail/4591122882887680
2023-05-26 12:03:34 -06:00
Behdad Esfahbod
5872bdf64d
[vector] Add copy-constructor for array_t's
2023-05-26 11:44:18 -06:00
Chun-wei Fan
42aba5ff30
harfbuzz-config.cmake.in: Support Windows usage
...
Apply the appropriate library prefix/suffix by whether we are building
as a statib build in Meson, or by using
${CMAKE_[SHARED|IMPORT]_LIBRARY_PREFIX} and
${CMAKE_[SHARED|IMPORT]_LIRBARY_SUFFIX} as appropriate according to
the target platform for shared builds.
2023-05-25 18:24:20 +03:00
Behdad Esfahbod
84354d3f23
[cff] When max-ops is reached return false
...
Slight speedup too.
2023-05-23 11:57:53 -06:00
Behdad Esfahbod
2655b7607c
[map] Micro-optimize
...
This shows a speedup.
2023-05-23 10:57:58 -06:00
Behdad Esfahbod
12b0680e60
[map] Fix set()
...
This was broken in 2133aa2407
.
We have to keep probing over tombstones.
2023-05-23 10:49:41 -06:00
Behdad Esfahbod
4056315c86
[font] Remove redundant avar mapping line
...
The avar mapping happens in hb_ot_var_normalize_coords() call.
2023-05-22 14:17:40 -06:00
Behdad Esfahbod
592a3d0e96
Merge pull request #4237 from harfbuzz/layout-font-extents
...
[layout] Add hb_ot_layout_get_font_extents()
2023-05-21 22:00:53 +02:00
Khaled Hosny
0d354e0442
[layout] Add tests for baseline 2 APIs
2023-05-21 19:01:04 +03:00
Behdad Esfahbod
e047b1abbc
[layout] Improve docs
2023-05-20 10:27:31 -06:00
Behdad Esfahbod
132391ad62
[layout] Add test for font_extents
2023-05-19 16:10:21 -06:00
Behdad Esfahbod
6996e64f72
[BASE] Sanitize and get_min_max fixups
...
Seems to work now.
2023-05-19 14:22:13 -06:00
Behdad Esfahbod
02e0e9394b
[layout] Fetch default font extents if localized extents not found
2023-05-19 13:18:06 -06:00
Behdad Esfahbod
8ccc1ff21e
[layout] Mark language as nullable
...
GI needs it apparently.
2023-05-19 13:15:58 -06:00
Behdad Esfahbod
792ca22ca3
[layout] Document new API
2023-05-19 11:42:20 -06:00
Behdad Esfahbod
0894813a38
[layout] Add "2" version of BASE table API
...
...that do the script/language resolution.
Part of https://github.com/harfbuzz/harfbuzz/pull/4237
Ref https://github.com/harfbuzz/harfbuzz/issues/3439
2023-05-19 11:35:33 -06:00
Behdad Esfahbod
3e110c69c4
[layout] Add hb_ot_layout_get_font_extents()
...
Untested.
Fixes https://github.com/harfbuzz/harfbuzz/issues/3290
2023-05-19 11:06:26 -06:00
Simon Cozens
2f21dc23b5
[wasm] [docs] Improve build flags information
2023-05-18 07:14:28 +01:00
Simon Cozens
134cc8edfa
[wasm] [docs] How to build
2023-05-17 16:58:49 +01:00
Behdad Esfahbod
5543d05885
[subset] Use vector instead of map for glyph bounds ( #4232 )
...
* [subset] Use vector instead of map for glyph bounds
Is faster.
Part of https://github.com/harfbuzz/harfbuzz/issues/4231
* [subset] initialize bounds_vec value to 0xFFFFFFFF
Some non-EMPTY glyph might have 0 bounds width/height
---------
Co-authored-by: Qunxin Liu <qxliu@google.com>
2023-05-17 09:29:44 -06:00
Behdad Esfahbod
ccfd7ef08c
Merge pull request #4131 from harfbuzz/wasm
...
[wasm] WebAssembly shaper
2023-05-17 16:00:33 +02:00
Behdad Esfahbod
6ed792ef4b
[meson] Report WebAssembly build
2023-05-17 07:58:27 -06:00
Simon Cozens
56af88d048
[wasm] More thorough API docs
2023-05-17 14:32:17 +01:00
Behdad Esfahbod
c248fd9133
[hash] Comment
2023-05-16 10:12:02 +02:00