Commit Graph

11745 Commits

Author SHA1 Message Date
Behdad Esfahbod 1024a013fd [glyf] Add CoordSetter 2022-12-09 14:45:29 -07:00
Garret Rieger e66d02126e [subset] replace subset-processing.md reference with link to it on github. 2022-12-08 16:32:24 -07:00
Garret Rieger 27201ed32b [subset] fix up hb_subset_preprocess api comment. 2022-12-08 16:32:24 -07:00
Garret Rieger 13b0388351 [subset] link to preprocessing doc from api comment. 2022-12-08 16:32:24 -07:00
Garret Rieger c097abab52 [subset] set no prune unicode ranges flag in preprocessor.
To avoid modifying the original unicode range values in the source font.
2022-12-08 16:32:24 -07:00
Garret Rieger bc87fe952e [subset] add note about memory management with preprocessed faces. 2022-12-08 16:32:24 -07:00
Garret Rieger 5e713e99bf Revert "[map] Speed up is_real()"
This reverts commit f5307c3ba8.

Found to slow down the benchmarks in some cases.
2022-12-08 16:32:24 -07:00
Garret Rieger eda02c2ebd [subset] Move hb_subset_preprocess to be non-experimental. 2022-12-08 16:32:24 -07:00
Garret Rieger 76d5482a7c [subset] always return a valid face from hb_subset_preprocess. 2022-12-08 16:32:24 -07:00
Garret Rieger 35233d2514 [repacker] fix fuzzer reported stack overflow.
Fixes https://oss-fuzz.com/testcase-detail/6014493291577344.
2022-12-07 10:32:56 -07:00
Garret Rieger f1d3489388 [repacker] bail on failure to alloc assigned_bytes set.
Fixes fuzzer issue https://oss-fuzz.com/testcase-detail/5390364397928448.
2022-12-05 14:13:47 -07:00
Garret Rieger 239a5aca02 [repacker] don't allow references to the null object in graph.
Fixes fuzzer issue https://oss-fuzz.com/testcase-detail/6714085985353728
2022-12-05 14:13:47 -07:00
Behdad Esfahbod 4ce0f08897 [coretext] Clamp variation settings to min/max
Like our native implementation does; CoreText doesn't itself.

Also fix leak of CFNumber's.
2022-12-05 13:18:34 -07:00
Behdad Esfahbod 22b0390e2d Revert "[VarData] Don't clear memory we are going to fill in completely"
This reverts commit e28e2dad03.

This made fuzzer unhappy. I'm not sure how.

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54044
2022-12-05 09:43:36 -07:00
Behdad Esfahbod 3c497e2458 [harfbuzz-subset.cc] Revert accidental change
These extra files are unnecessary, but our generator currently
isn't smart enough to know that. Will fix some time.
2022-12-04 15:35:01 -07:00
Behdad Esfahbod aa7f5e3742 [subset] Conditionalize call to hb_font_set_variations 2022-12-04 15:33:18 -07:00
Behdad Esfahbod ad5588e800 [config] If HB_NO_SHAPER then HB_NO_OT_SHAPE 2022-12-04 15:27:59 -07:00
Behdad Esfahbod 1a5c749581 [config] Flesh out HB_NO_SHAPER a bit more 2022-12-04 15:20:51 -07:00
Behdad Esfahbod 2c0abf0258 Revert "[harfbuzz-subset.cc] Trim down!"
This reverts commit a335458d57.

While this can be vastly trimmed down, what I did is not right.
It still depends on hb-face, hb-font, hb-blob, hb-set, and hb-map.
2022-12-04 15:03:36 -07:00
Behdad Esfahbod a335458d57 [harfbuzz-subset.cc] Trim down! 2022-12-04 14:56:20 -07:00
Behdad Esfahbod 765a3551da [face-builder] Minor cast 2022-12-04 14:48:32 -07:00
Behdad Esfahbod 3fff6d9084 [face-builder] Initialize face orders to -1 2022-12-04 14:47:38 -07:00
Behdad Esfahbod 805ce9ad3d [face-builer] Protect against wrong face
In hb_face_builder_sort_tables.
2022-12-04 14:43:17 -07:00
Behdad Esfahbod 0acfd2b714 [indic-machine] Regenerate line numbers 2022-12-04 14:01:05 -07:00
Behdad Esfahbod 9704f8354e Merge branch 'config-header' 2022-12-04 13:58:52 -07:00
Behdad Esfahbod c1aae14a68 [features.h] Fix autotools build rules 2022-12-04 13:58:39 -07:00
Behdad Esfahbod 0545949f01 [gvar] Minor use array get_size() 2022-12-04 12:44:09 -07:00
Behdad Esfahbod 1bd386515c [bit-set] Micro-optimize page_for 2022-12-04 12:30:20 -07:00
Behdad Esfahbod b182e2808a [bit-set] Don't clear pages when copying set 2022-12-04 12:22:17 -07:00
Behdad Esfahbod f5307c3ba8 [map] Speed up is_real() 2022-12-04 11:54:16 -07:00
Behdad Esfahbod 301f6e4b47 [Coverage] Remove TODO 2022-12-04 11:46:10 -07:00
Behdad Esfahbod dbbb8e8006 Revert "[map] Add hb_map_filter_invalid"
This reverts commit 8d7e921117.

Surprisingly this slowed NotoNastaliqUrdu benchmark down by a couple
percent instead of speeding it up.
2022-12-04 11:13:39 -07:00
Behdad Esfahbod 8d7e921117 [map] Add hb_map_filter_invalid
Use it in one place.
2022-12-04 11:02:15 -07:00
David Corbett 260df1fa32 [indic] Support <U+0A02, U+0A40> 2022-12-04 10:46:47 -07:00
Behdad Esfahbod 8b533763c0 Use hb_len() instead of .len() 2022-12-03 15:58:12 -07:00
Behdad Esfahbod e28e2dad03 [VarData] Don't clear memory we are going to fill in completely 2022-12-03 15:56:43 -07:00
Behdad Esfahbod 0e13b4abbc [VarData] Optimize main loop slightly 2022-12-03 15:50:24 -07:00
Behdad Esfahbod ad17c0acce [VarData] Whitespace 2022-12-03 14:56:57 -07:00
Behdad Esfahbod e7eb445d29 [VarData] Optimize longWord calculation 2022-12-03 14:56:00 -07:00
Behdad Esfahbod f2c980be29 [VarData] Optimize wordCount calculation
6% speedup in RobotoFlex-Variable/900 benchmark.
2022-12-03 14:49:38 -07:00
Behdad Esfahbod 3641b0e01e [VarData] Optimize serialize() 2022-12-03 14:26:21 -07:00
Behdad Esfahbod e155f12307 [VarData] Minor save a variable 2022-12-03 14:14:39 -07:00
Behdad Esfahbod 5596a73087 [layout] Speed up ClassDefFormat2 intersects 2022-12-03 13:33:48 -07:00
Behdad Esfahbod 85e7263b38 [VariationStore] Minor access array directly 2022-12-03 13:28:02 -07:00
Behdad Esfahbod 41a8597f38 [layout] Simplify CoverageFormat2 intersects_coverage() 2022-12-03 13:23:26 -07:00
Behdad Esfahbod 1f4d8ccaed [CoverageFormat2] Optimize intersects() 2022-12-03 13:17:15 -07:00
Behdad Esfahbod c482b06108 [gpos] Optimize PairPosFormat1::intersects 2022-12-03 13:14:31 -07:00
Behdad Esfahbod 58e9df132f [Device] Serialize VariationDevice zerocopy 2022-12-03 13:04:00 -07:00
Behdad Esfahbod 071a2bb4f7 [serialize] Support zerocopy while sharing 2022-12-03 13:03:38 -07:00
Behdad Esfahbod 44a5de3a97 [Device] Save a snap/revert 2022-12-03 12:50:32 -07:00
Behdad Esfahbod 93328cedfc [Device] Save a map get() 2022-12-03 12:49:26 -07:00
Behdad Esfahbod 630b874ae6 [gsubgpos] Add a cache to intersected_class_glyphs
30% gain on subset_codepoints/NotoNastaliqUrdu-Regular.ttf/nohinting/1400.
2022-12-03 12:13:15 -07:00
Behdad Esfahbod c044f4af3e [gsubgpos] Remove wrong const 2022-12-03 11:58:04 -07:00
Behdad Esfahbod 2680be1f22 [gsubgpos] Don't set unnecessary funcs 2022-12-03 11:54:52 -07:00
Behdad Esfahbod 023f595dec [cmap] Speed up DefaultUVS::copy even more
Another 14% on SourceHanSerifVF/10 benchmark.
2022-12-03 11:18:05 -07:00
Behdad Esfahbod 4ca6105108 [cmap] Remove double-min 2022-12-03 11:15:06 -07:00
Behdad Esfahbod cd29147e30 [cmap] Minor cast 2022-12-03 10:41:42 -07:00
Behdad Esfahbod 4cdb5cc69b [cmap] Minor change iterator 2022-12-03 10:40:24 -07:00
Behdad Esfahbod 2cdaedaf54 Use hb_enumerate in more places 2022-12-03 10:16:35 -07:00
Behdad Esfahbod 02bc4dd69b Use hb_enumerate instead of hand-coding 2022-12-03 10:10:01 -07:00
Behdad Esfahbod 4d19c724c0 [CoverageFormat1] Speed up intersects()
Speeds up SourceHanSerif/10000 benchmark (not in test suite) by
32%!
2022-12-03 09:57:29 -07:00
Behdad Esfahbod a2d33779e1 Fix arm bot build 2022-12-03 09:49:00 -07:00
Behdad Esfahbod dabbf13d40 [cmap] Speed up DefaultUVS::copy 2022-12-03 09:46:11 -07:00
Qunxin Liu 8eadb83640 [subset] Update hb_subset_input_override_name_table API
Override the name string for the NameRecord identified by name_id,
platform_id, encoding_id and language_ids specified by the user.
If a record with specified name_id does not exist, this API will create
a new NameRecord with provided info and insert it to the name table.
2022-12-02 18:05:53 -07:00
Behdad Esfahbod ddeac3658b [test-multimap] More tests 2022-12-02 16:51:07 -07:00
Behdad Esfahbod ff419789ef [subset-plan] Sort unicode_to_new_gid_list when needed 2022-12-02 16:43:33 -07:00
Behdad Esfahbod 1a40da4ad1 [subset-plan] Use add_array instead of add_sorted_array
That vector is not declared as sorted.
2022-12-02 16:13:37 -07:00
Behdad Esfahbod 32e049a315 [subset-plan] Use gid-to-unicodes multimap
One test fails. Need investigation.
2022-12-02 16:09:10 -07:00
Behdad Esfahbod da7961b2e8 . 2022-12-02 16:08:40 -07:00
Behdad Esfahbod 7d6893a803 [subset-accelerator] Cache gid-to-unicodes 2022-12-02 15:50:52 -07:00
Behdad Esfahbod 10c8fc5553 [multimap] Add a multimap datastructure 2022-12-02 15:50:49 -07:00
Behdad Esfahbod a42fc8ec4a [subset-accelerator] Adjust in_error() 2022-12-02 15:41:18 -07:00
Behdad Esfahbod 65d9630312 [subset-cff2] Whitespace 2022-12-02 14:59:26 -07:00
Behdad Esfahbod b33297ee26 [cff2] Remove unused typedef 2022-12-02 14:43:37 -07:00
Behdad Esfahbod 3ade2ffaa5 [serialize] Adjust pop_discard for zerocopy 2022-12-02 14:26:36 -07:00
Behdad Esfahbod 043eeb29a3 [subset-cff] Optimize encode_subrs
Don't loop over all original subrs. Just walk over closure subrs.
2022-12-02 13:58:36 -07:00
Behdad Esfahbod 0ad5977cd6 [subset-cff] Simplify hinting processing
We already have drop_hints in the params.
2022-12-02 13:41:36 -07:00
Behdad Esfahbod 16cbe41bca
Merge pull request #3910 from googlefonts/repacker_fuzz
[repacker] Add a fuzzer for the hb-subset-repacker api.
2022-12-02 12:43:13 -07:00
Behdad Esfahbod 2a7a1d5a73 [Coverage] Avoid timeout on broken ranges
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53929
2022-12-02 12:33:24 -07:00
Behdad Esfahbod c947652768 [subset-cff] Micro-optimize 2022-12-02 12:01:35 -07:00
Behdad Esfahbod a24d4e9261 [array] Oops. Fix memcpy copy()! 2022-12-02 12:01:35 -07:00
Behdad Esfahbod 5e41766bb9 [array] Fix hb_bytes_t memcpy copy
Wasn't being used!
2022-12-02 12:01:35 -07:00
Behdad Esfahbod a5616227ca [subset-cff] Fix buffer size calculation 2022-12-02 12:01:35 -07:00
Behdad Esfahbod 015af5a8e5 [subset-cff] Write a couple loops as range-based for 2022-12-02 12:01:35 -07:00
Behdad Esfahbod bfbbd4af25 [subset-cff] Copy str for call ops 2022-12-02 12:01:35 -07:00
Behdad Esfahbod c755b3884f [subset-cff] Pre-alloc enough for check-less copy 2022-12-02 12:01:35 -07:00
Behdad Esfahbod 062e59ae67 [subset-cff] Optimize vector allocation for preprocessed input 2022-12-02 12:01:35 -07:00
Behdad Esfahbod 8e9e94dba9 Revert "[vector] Optimize grow_vector() for size"
This reverts commit 1dd9396c7a.

Is faster indeed.

15% on SourceHanSans/10000 benchmark.
2022-12-02 12:01:35 -07:00
Behdad Esfahbod 2644540a74 [subset-cff] Compact parsed strings if using accelerator
Saves 32% on SourceHanSans/10000 benchmark!

Also, use memcmp now for writing out strings since now that our
ops are not super short, that's faster.

This makes cff-japanese test takes super long though; that needs
inspection.
2022-12-02 12:01:35 -07:00
Behdad Esfahbod 6012d3b228 [subset-cff] Write out charstrings zerocopy to serializer 2022-12-01 17:33:53 -07:00
Behdad Esfahbod 36e1a6339c [cff] Add total_size to INDEX 2022-12-01 17:00:03 -07:00
Behdad Esfahbod 3843000660 [serialize] Add start_zerocopy() 2022-12-01 16:48:22 -07:00
Garret Rieger de5a621322 [repacker] enforce root node having no incoming edges. 2022-12-01 23:37:16 +00:00
Behdad Esfahbod a2681c37c1 [cff-subset] Simplify INDEX serialize() more 2022-12-01 16:15:23 -07:00
Behdad Esfahbod c4b05878cb [subset-cff] Remove INDEX unused serialize() methods 2022-12-01 15:56:37 -07:00
Behdad Esfahbod b3ad4d72cc [cff] Another no-memset in INDEX 2022-12-01 15:46:00 -07:00
Behdad Esfahbod 5fd2f255fc [open-type] Don't memset 0 in serialize for ArrayOf family
Not necessary.
2022-12-01 15:18:59 -07:00
Garret Rieger 30e405e470 [repacker] ensure link obj indices are valid. 2022-12-01 22:12:59 +00:00
Behdad Esfahbod 70ac6dfb28 [subset-cff] Don't memset 0 INDEX and other serialize methods
Not necessary.
2022-12-01 14:58:25 -07:00
Garret Rieger 554ed06fac [repacker] add cycle detection to the graph sort.
This allows us to bail early if the graph is not acyclic.
2022-12-01 21:52:37 +00:00
Behdad Esfahbod a66de336fb [vector] Minor use get_size() in as_bytes() 2022-12-01 14:32:13 -07:00
Behdad Esfahbod 0b826368fd [serializer] Don't memset memory in embed
Not necessary.
2022-12-01 14:23:25 -07:00
Behdad Esfahbod 3b68c7146f [array] Don't clear serializer buffer when copying out
Not needed.
2022-12-01 14:19:27 -07:00
Behdad Esfahbod 57808609c9 [VarData] Move an unlikely 2022-12-01 14:03:56 -07:00
Garret Rieger 9e99d08470 [repacker] validate link widths during repacker setup. 2022-12-01 20:17:41 +00:00
Garret Rieger edf7a29595 [repacker] Validate link positions before running the repacker. 2022-12-01 20:17:41 +00:00
Garret Rieger deca30b268 [repacker] get repacker fuzzer working.
Additionally add helper method that allows a graph to be saved as a fuzzer seed.
2022-12-01 20:17:40 +00:00
Garret Rieger 985b19f678 [repacker] begin implementing a fuzzer for the repacker api. 2022-12-01 20:17:39 +00:00
Matthias Clasen c6d616cc41 Generate and install hb-features.h
This header has defines for all the optional
dependendencies that come with their own Harfbuzz
headers, so you can do:

  #include <hb-features.h>
  #ifdef HB_HAS_DIRECTWRITE
  #include <hb-directwrite.h>
  #endif
2022-12-01 18:16:55 +08:00
Behdad Esfahbod 8805a866b5 [ClassDef2] Write a few loops as range-based for 2022-11-30 17:18:04 -07:00
Behdad Esfahbod ac8b232a2d [gsub] Cache intersects_class results for closure
Benchmark                                                                                 Time             CPU      Time Old      Time New       CPU Old       CPU New
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
BM_subset/subset_codepoints/NotoNastaliqUrdu-Regular.ttf/nohinting/10                  +0.0246         +0.0240             0             0             0             0
BM_subset/subset_codepoints/NotoNastaliqUrdu-Regular.ttf/nohinting/64                  -0.5541         -0.5544             4             2             4             2
BM_subset/subset_codepoints/NotoNastaliqUrdu-Regular.ttf/nohinting/512                 -0.1120         -0.1123            43            38            43            38
BM_subset/subset_codepoints/NotoNastaliqUrdu-Regular.ttf/nohinting/1400                -0.1154         -0.1159            43            38            43            38
2022-11-30 17:09:04 -07:00
Behdad Esfahbod c6a4b60116 [gsubgpos] Add an unlikely 2022-11-30 15:02:42 -07:00
Behdad Esfahbod 32dd9810cf [subset-cff1] Cache glyph-to-sid-map in the accelerator
Benchmark                                                                                      Time             CPU      Time Old      Time New       CPU Old       CPU New
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
BM_subset/subset_codepoints/SourceHanSans-Regular_subset.otf/nohinting/10                   -0.0841         -0.0843             0             0             0             0
BM_subset/subset_codepoints/SourceHanSans-Regular_subset.otf/nohinting/64                   -0.1305         -0.1305             0             0             0             0
BM_subset/subset_codepoints/SourceHanSans-Regular_subset.otf/nohinting/512                  -0.1398         -0.1401             1             1             1             1
BM_subset/subset_codepoints/SourceHanSans-Regular_subset.otf/nohinting/4096                 +0.0382         +0.0380             9             9             9             9
BM_subset/subset_codepoints/SourceHanSans-Regular_subset.otf/nohinting/10000                +0.0213         +0.0211            11            11            11            11
2022-11-30 14:00:33 -07:00
Behdad Esfahbod 72fabef0a4 [SingleSubstFormat2] Speed up closure 2022-11-30 11:37:49 -07:00
Behdad Esfahbod 2dc2e016d4 [cff] Enable an unlikely 2022-11-30 11:25:50 -07:00
Behdad Esfahbod 582a87ef0a [cff] Speed up FDSelect0 sanitize 2022-11-30 11:20:19 -07:00
Garret Rieger 2658370f00 [subset] make the cmap cache in accelerator const. 2022-11-29 22:04:10 -07:00
Garret Rieger 7551a668e3 [subset] Make cff_accelerator const.
This gives more confidence that it won't be accidentally modified by the subset operation using it.
2022-11-29 22:04:10 -07:00
Behdad Esfahbod d8d0e06694 [array] Comment 2022-11-29 21:35:54 -07:00
Behdad Esfahbod 2fecf2aa19 [ClassDef] Minor rename 2022-11-29 21:25:01 -07:00
Behdad Esfahbod 8f632ca884 [ClassDef] Write another loop as range for 2022-11-29 21:23:35 -07:00
Behdad Esfahbod 87b12aee13 [ClassDef] Write a couple loops as range for 2022-11-29 21:18:48 -07:00
Behdad Esfahbod ccd40c842c [ClassDef] Optimize intersected_class_glyphs 2022-11-29 21:15:19 -07:00
Behdad Esfahbod 44c585a6df [ClassDef] Fix disabled codeblock 2022-11-29 20:52:48 -07:00
Behdad Esfahbod 9b7617d433 [ClassDef2] Use a faster algorithm in subset()
Speedup across the board; up to 40% for MPlus1 at small sizes.
2022-11-29 20:29:58 -07:00
Behdad Esfahbod ae5e6d562b [ClassDef2] Micro-optimize 2022-11-29 15:48:38 -07:00
Behdad Esfahbod 7129b79406 [open-type] Add faster range-based loop to array types 2022-11-29 15:33:07 -07:00
Behdad Esfahbod dc82334061 Remove a couple of unneeded .iter() invocations 2022-11-29 15:26:55 -07:00
Behdad Esfahbod 00f2657bb8 [subset] Accelerate sanitize-table-cache
Big wins all across small subsets

BM_subset/subset_codepoints/Roboto-Regular.ttf/nohinting/10                              -0.1140         -0.1129             0             0             0             0
BM_subset/subset_codepoints/Amiri-Regular.ttf/nohinting/10                               -0.4717         -0.4714             0             0             0             0
BM_subset/subset_codepoints/NotoNastaliqUrdu-Regular.ttf/nohinting/10                    -0.8147         -0.8146             0             0             0             0
BM_subset/subset_codepoints/NotoSansDevanagari-Regular.ttf/nohinting/10                  -0.3248         -0.3242             0             0             0             0
BM_subset/subset_codepoints/Mplus1p-Regular.ttf/nohinting/10                             -0.1262         -0.1260             0             0             0             0
BM_subset/subset_codepoints/SourceHanSans-Regular_subset.otf/nohinting/10                -0.0308         -0.0309             0             0             0             0
BM_subset/subset_codepoints/SourceSansPro-Regular.otf/nohinting/10                       -0.1374         -0.1373             0             0             0             0
BM_subset/subset_codepoints/AdobeVFPrototype.otf/nohinting/10                            -0.4555         -0.4555             0             0             0             0
BM_subset/subset_codepoints/MPLUS1-Variable.ttf/nohinting/10                             -0.4175         -0.4174             0             0             0             0
BM_subset/subset_codepoints/RobotoFlex-Variable.ttf/nohinting/10                         -0.4214         -0.4214             0             0             0
2022-11-29 15:20:13 -07:00
Behdad Esfahbod 33165f4848 [bit-page] Remove ELT_BITS_LOG_2
My compiler is smart enough to take care of it.
2022-11-29 15:15:43 -07:00
Garret Rieger 7a004a7ac2 [subset] Cache per subtable cmap unicode mappings. 2022-11-28 19:48:15 -07:00
Behdad Esfahbod d2a2670e54 [iter] Simplify has() interface implementations 2022-11-28 19:43:09 -07:00
Behdad Esfahbod cba82829ba [subset-cff1] Share subrs object
Multiple FDs might share the same subrs...
2022-11-28 16:19:54 -07:00
Behdad Esfahbod c7b998b355 [cff2] Don't share fd-array link
No point.
2022-11-28 16:18:21 -07:00
Behdad Esfahbod 3d9e3c2dc7 [subset-cff2] Don't share varstore object 2022-11-28 16:17:09 -07:00
Behdad Esfahbod c503cf003e [cmap] Store offset, not pointer, in cmap cache 2022-11-28 15:53:35 -07:00
Behdad Esfahbod 3e151139a8 [PairPos] Optimize get_effective_value_format
Speeds up BM_subset/subset_glyphs/SourceHanSans-Regular_subset.otf/nohinting/512
12%.
2022-11-28 14:23:49 -07:00
Behdad Esfahbod 3131aecf9f [array/hash] Fix asan issue
../src/hb-algs.hh:240:43: runtime error: reference binding to misaligned address 0x7ffe91a08b0e for type 'const unsigned int', which requires 4 byte alignment
2022-11-28 14:12:55 -07:00
Behdad Esfahbod 26ad7a6022 [gpos] Minor micro-optimize 2022-11-28 14:12:52 -07:00
Behdad Esfahbod c769d7e181 [gpos] Whitespace 2022-11-28 14:03:58 -07:00
Behdad Esfahbod 3ea0f37c30 [subset-cff] Move an init to constructor
The init was not called anyway.
2022-11-28 13:58:44 -07:00
Behdad Esfahbod 6c92c3e0cf [subset-cff] Remove unnecessary check 2022-11-28 13:54:24 -07:00
Behdad Esfahbod 7fd300dd9a [subset-cff] Use constructor for parsed_cs_op_t 2022-11-28 13:51:16 -07:00
Garret Rieger bd37900e0d [subset] use a reference to cached global/loca subrs.
Previously they were being copied in. Copying is no longer necessary now that hint dropping doesn't mutate the arrays.
2022-11-28 13:43:52 -07:00
Behdad Esfahbod ded9de9cd8 [cff] bsearch in fdselect
Saves 8% in NotoSansCJK / 10000 subset benchmark.
2022-11-28 13:32:08 -07:00
Behdad Esfahbod 0c33aba30c [subset-cff] Rename drop flag to hinting flag 2022-11-28 12:28:13 -07:00
Behdad Esfahbod 6f5b531986 [subset-cff] Make no-hinting use accelerator as well 2022-11-28 12:24:29 -07:00
Behdad Esfahbod f51a624e67 [subset-cff] Micro-optimize drop_hints_in_str 2022-11-27 14:54:39 -07:00
Behdad Esfahbod 3860326688 [subset-cff] Write loop more idiomatic 2022-11-27 13:23:13 -07:00
Behdad Esfahbod 3ff502d3ae [subset-cff] Remove unnecessary initialization 2022-11-27 12:58:04 -07:00
Behdad Esfahbod 6af4985bf9 [subset-cff] No need for bitflag here anymore 2022-11-26 18:20:20 -07:00
Behdad Esfahbod 69ce606d14 [subset-cff] Immediately drop subr numbers instead of marking for skip
Seems to work and saves ~2% time.
2022-11-26 18:18:35 -07:00
Behdad Esfahbod 1cf4f3e083 [subset-cff] More comment 2022-11-26 18:15:28 -07:00
Behdad Esfahbod f68221ff43 [subset-cff] Add comment 2022-11-26 18:12:14 -07:00
Behdad Esfahbod 048ab8a066 [subset-cff] Remove unused bits 2022-11-26 18:00:43 -07:00
Behdad Esfahbod 37cbfc0c7e [subset-cff] Remove unneeded member 2022-11-26 17:57:44 -07:00
Behdad Esfahbod 46ab15137b [subset-cff] Add has_calls to parsed charstrings
Optimize closure based on it.
2022-11-26 17:49:21 -07:00
Behdad Esfahbod 6d53074e63 [subset-cff] Drop another unused parameter 2022-11-26 17:23:09 -07:00
Behdad Esfahbod 42615561b5 Optimize a couple array references 2022-11-26 17:13:20 -07:00
Behdad Esfahbod 04d23b7ca8 [subset-cff] Micro-optimize collect_subr_refs_in_str 2022-11-26 17:08:00 -07:00
Behdad Esfahbod 9d18180c3c [array] Use hb_hash instead of handrolling 2022-11-26 15:38:21 -07:00
Behdad Esfahbod e302b9d5da Fix build 2022-11-26 15:18:16 -07:00
Behdad Esfahbod 70d97d079b [subset-cff] Remove unused argument 2022-11-26 15:16:11 -07:00
Behdad Esfahbod 4167e93a15 [subset-cff2] Micro-optimize blend operator 2022-11-26 15:14:52 -07:00
Behdad Esfahbod f159bf075b [cff2] Micro-optimize blend operator 2022-11-26 15:11:32 -07:00
Behdad Esfahbod a331e913dc [bit-page] Hand-code equality
Faster than memcmp() because of alignment.
2022-11-26 14:59:37 -07:00
Behdad Esfahbod 9df06a2695 [bit-set] Fix is_subset() short-circut criteria
Ouch!
2022-11-26 14:56:45 -07:00
Behdad Esfahbod 915c1a00cf [vector] Add remove_unordered
Saves 5% in NotoNastaliq/1000 subset benchmark.
2022-11-26 14:48:57 -07:00
Behdad Esfahbod 4b8d8fbee4 [ot-map] Micro-optimize for size 2022-11-26 14:31:15 -07:00
Behdad Esfahbod 93f3a9dbc6 [ot-map] Micro-optimize more
Another 500 bytes.
2022-11-26 14:25:21 -07:00
Behdad Esfahbod f39f049870 [ot-map] Micro-optimize
Weird that shrinks size by 500 bytes.
2022-11-26 14:16:15 -07:00
Behdad Esfahbod 60bb32c454 [ot-map] Minor refactor 2022-11-26 14:12:57 -07:00
Behdad Esfahbod e3cc61838f [PairPos] Adjust kerning buffer messages 2022-11-26 13:58:04 -07:00
Behdad Esfahbod a81dd1053d [layout] Adjust printing feature tags
For required-feature, print spaces, not nul bytes.
2022-11-26 13:43:36 -07:00
Behdad Esfahbod 56e3868b52 [layout/buffer-message] Print feature name in lookup buffer messages 2022-11-26 13:14:23 -07:00
Garret Rieger a5d35fd80a [subset] use charstrings directly from accelerator cache if mutability isn't needed. 2022-11-25 16:50:55 -07:00
Behdad Esfahbod 026b64ef76 [subset-cff] Avoid set mallocation in hb_plan_subset_cff_fdselect 2022-11-25 14:57:40 -07:00
Behdad Esfahbod 74acf52f33 [subset-cff] Micro-optimize copy_str more 2022-11-25 14:43:44 -07:00
Behdad Esfahbod d2f3cde7ef [subset-cff] Micro-optimize copy_str 2022-11-25 14:38:30 -07:00
Behdad Esfahbod e333223f26 [array] Optimize serializing copy() 2022-11-25 14:26:02 -07:00
Behdad Esfahbod 22990fca1d
Merge pull request #3894 from googlefonts/cff_accel
[subset] Cache parsed char strings in CFF accelerator
2022-11-25 14:12:58 -07:00
Garret Rieger 8d5c899b0f [subset] In cff accelerator hold reference to CFF table instead of the whole font. 2022-11-25 20:53:20 +00:00
Behdad Esfahbod 7b197446ac [vector] Adjust for HB_OPTIMIZE_SIZE 2022-11-25 13:28:53 -07:00
Garret Rieger 75a99f28ab [subset] destruct cff accelerator if present. 2022-11-25 20:24:05 +00:00
Behdad Esfahbod 1d474194f0 [subset-cff] Micro-optimize encode_str 2022-11-25 13:21:35 -07:00
Behdad Esfahbod 3c4a610b59 [subset-cff] Micro-optimize copy_str some more 2022-11-25 13:16:30 -07:00
Behdad Esfahbod 535aadb309 [subset-cff] Micro-optimize collect_subr_refs_in_str more 2022-11-25 13:07:42 -07:00
Behdad Esfahbod 00a9df3a43 [subset-cff] Micro-optimize collect_subr_refs_in_str 2022-11-25 13:05:05 -07:00
Behdad Esfahbod d2a2f5bf4e [vector] Handroll copy 2022-11-25 12:44:02 -07:00
Behdad Esfahbod 1fed366d5b [serialize] Shut compiler warning off 2022-11-25 12:37:24 -07:00
Behdad Esfahbod f2297e6978 [buffer] Documentation
Fixes https://github.com/harfbuzz/harfbuzz/issues/3889
2022-11-25 11:33:00 -07:00
Garret Rieger 71c23c1c07 [subset] don't copy the entire global/loca subr lists from the accelerator.
Instead run a closure on the retained charstrings and copy only the referenced subrs. This significantly speeds up cases with small character sets.
2022-11-25 18:05:39 +00:00
Garret Rieger 4ff09274a8 [subset] In CFF accelerator keep a reference to original face.
The charstring objects reference memory from the original face so we need to maintain a reference to prevent it from being destroyed.
2022-11-24 22:47:29 +00:00
Behdad Esfahbod 6aaa16627c [Coverage] Comment 2022-11-24 14:58:42 -07:00
Behdad Esfahbod 06e2147a48 More call set->next() directly 2022-11-24 14:56:04 -07:00
Behdad Esfahbod 196c9db06f Call ->next() directly 2022-11-24 14:51:52 -07:00
Behdad Esfahbod 03d64b7469 [bit-set] Remove TODO that would never happen 2022-11-24 14:33:18 -07:00
Behdad Esfahbod 690df8a369 [bit-set] Micro-optimize prev() 2022-11-24 14:32:51 -07:00
Behdad Esfahbod fe5d9176ae [bit-set] Micro-optimize size
It's silly that this saves size at all. :(
2022-11-24 14:30:18 -07:00
Behdad Esfahbod cf9b9929df [bit-set] Micro-optimize process() 2022-11-24 14:26:28 -07:00