Behdad Esfahbod
299ec902eb
[glyf] Move instanciation to serialize()
2022-11-22 16:03:02 -07:00
Behdad Esfahbod
d8d881f22d
[subset-glyf] Don't create a second glyf accelerator
2022-11-22 15:24:16 -07:00
Behdad Esfahbod
7560930070
[glyf] Add _create_font_for_instancing
2022-11-22 15:22:25 -07:00
Behdad Esfahbod
40634ceeb0
[glyf] Adjust data types
2022-11-22 15:07:16 -07:00
Behdad Esfahbod
ba0d28ea36
[glyf] Fix font error check
2022-11-22 15:01:48 -07:00
Behdad Esfahbod
04c525019c
[glyf] Use a malloc instead of calloc
2022-11-22 14:54:55 -07:00
Behdad Esfahbod
024aa81805
[glyf] Micro-optimize encode_coord
2022-11-22 14:51:42 -07:00
Behdad Esfahbod
b6694597f9
[glyf] Micro-optimize encode_flag()
2022-11-22 14:49:01 -07:00
Behdad Esfahbod
d47cfe7936
[glyf] Minor use operator ++
2022-11-22 14:45:04 -07:00
Behdad Esfahbod
03e6bde790
[glyf] Minor adjustment to lastflag handling
...
No logic change.
2022-11-22 14:40:50 -07:00
Behdad Esfahbod
0ca9fda889
[glyf] Remove misplaced comment
2022-11-22 14:39:10 -07:00
Behdad Esfahbod
4afcdf675b
More hb_memcpy
2022-11-22 12:56:48 -07:00
Behdad Esfahbod
1758ee6646
[glyf] Minor write loop more idiomatically
2022-11-22 10:55:16 -07:00
Behdad Esfahbod
b567ce51d3
[subset] Don't trim glyf's again if preprocessed
...
Speeds up M1/10000 benchmark by 30%!
2022-11-22 10:55:08 -07:00
Behdad Esfahbod
f2b5db700f
[vector] Remove .sub_array ()
2022-11-16 21:22:57 -07:00
Behdad Esfahbod
477d71724c
[glyf] Limit points in a glyf to 10000 roughly
...
Only enforced when components are being expanded.
Fixes https://github.com/harfbuzz/harfbuzz/issues/3838
2022-10-26 13:11:47 -06:00
Behdad Esfahbod
a756bd1944
[glyf] Use component phantom points after transformation
2022-10-13 17:18:19 -06:00
Behdad Esfahbod
82d19c08fc
Revert "[glyf/Composite] Remove phantom points when not needed anymore"
...
This reverts commit 527e63a3bd
.
2022-10-13 17:17:03 -06:00
Behdad Esfahbod
527e63a3bd
[glyf/Composite] Remove phantom points when not needed anymore
2022-10-13 17:13:40 -06:00
Garret Rieger
8f1bf23cc9
[subset] optimize glyf subsetting w/ retain gids.
...
When retain gids is enabled the subset plan may require the output of many empty glyphs. This change optimizes the glyf subsetting code when the number of retained glyphs << number of output glyphs. Unnessecary lookups to the glyph map are reduced by iterating through the glyph map instead of the output glyph set.
2022-09-29 15:44:49 -06:00
Qunxin Liu
e94fe2adf3
[instance] minor optimizations to glyf instancing
2022-09-29 12:14:43 -06:00
Qunxin Liu
b90ce34a25
[instance] fix for non-empty .notdef glyph metrics update
...
we need pass in source glyph's outline data to calculate boundaries, and
then drop the outline data if notdef-outline is specified.
Also disable shifting points for instancing in get_points () API
2022-09-29 12:14:43 -06:00
Qunxin Liu
8f84c58a34
[instance] don't copy phantom points from component
...
No need to consider USE_MY_METRICS for instancing
2022-09-01 09:44:28 -07:00
Qunxin Liu
58dbc00162
[instance] Fix compiling Composite glyph bytes
...
The x/y offset encoded with int8 originally might overflow after deltas
are applied. So we cannot just copy and update old values.
2022-09-01 09:44:28 -07:00
Qunxin Liu
8b7e2a1373
[instance] we need to update hmtx/vmtx values even for empty glyphs
...
Update metrics using the 4 phantom points
2022-09-01 09:44:28 -07:00
Behdad Esfahbod
84d33a1ed8
[glyf] Fix compiler warning
2022-08-23 13:13:13 -06:00
Qunxin Liu
ac0e22fa8e
[instance] update glyf/hmtx/vmtx tables
2022-08-22 09:29:37 -07:00
Behdad Esfahbod
b57ea3b053
Revert "[iter] Use && in uses of is_source_of"
...
This reverts commit ccbba667a9
.
2022-08-05 14:29:27 -06:00
Behdad Esfahbod
ccbba667a9
[iter] Use && in uses of is_source_of
2022-08-05 11:51:51 -06:00
Behdad Esfahbod
8fb7cc1c63
[iter] Use && in is_sink_of uses
2022-08-05 11:49:29 -06:00
Behdad Esfahbod
e51526bf06
[CompositeGlyph] Add HB_NO_BEYOND_64K
2022-07-28 09:53:30 -06:00
Behdad Esfahbod
7549d447ba
[>64k:glyf] Implement composites for >64k
...
Implements https://github.com/be-fonts/boring-expansion-spec/issues/42
2022-07-12 13:42:52 -06:00
Behdad Esfahbod
09de94788b
[>64k:glyf] Hid composite glyphIndex
2022-07-12 13:42:52 -06:00
Behdad Esfahbod
b0cb9a1a63
Make get_leading_bearing return bool
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/3496
Part of supporting >64k glyphs correctly.
2022-07-03 15:32:32 -06:00
Behdad Esfahbod
115e1a03e7
[glyf] Relax condition for matching number of coords
2022-07-03 14:45:12 -06:00
Behdad Esfahbod
800760c5bd
[glyf] Rename get_extents functions for clarity
2022-07-03 13:21:06 -06:00
Behdad Esfahbod
ab327f93b7
[glyf] Fix another bug with scaling
...
Of advances this time.
That codepath is never exercised though, if font has HVAR table.
2022-07-03 13:17:03 -06:00
Behdad Esfahbod
f46ddeba48
[hmtx/glyf] Rename side-bearing functions for clarity
2022-07-03 13:12:49 -06:00
Behdad Esfahbod
b2d60cbd6e
[glyf] Rename advance functions for clarity
2022-07-03 12:56:48 -06:00
Behdad Esfahbod
35c00c1216
[hmtx] Rename advance functions for clarity
2022-07-03 12:54:17 -06:00
Behdad Esfahbod
6b82d4faa1
[glyf] Make an optional argument non-optional
2022-07-03 12:45:27 -06:00
Behdad Esfahbod
3ef590808f
[glyf] Internal flip a variable
2022-07-03 12:44:24 -06:00
Behdad Esfahbod
78b4f39821
[glyf] Fix confusion between scaled vs unscaled lsb
...
Was always broken.
2022-07-03 12:39:55 -06:00
Behdad Esfahbod
6665881c7d
[glyf] Change side-bearing rounding
2022-07-03 12:39:55 -06:00
Behdad Esfahbod
34c6c0193c
[glyf] Fix byterange check again
2022-06-27 20:26:57 -06:00
Behdad Esfahbod
20572f914c
[glyf] Move read_flags into a function
2022-06-27 20:22:09 -06:00
Behdad Esfahbod
6e72c2e3fa
[glyf] Add an assertion
2022-06-27 15:09:25 -06:00
Behdad Esfahbod
3a0e27e794
[glyf] Move comment
2022-06-27 13:07:39 -06:00
Behdad Esfahbod
d0836dee7a
[glyf] Minor typo change
2022-06-27 13:05:58 -06:00
Behdad Esfahbod
5cca25e5d0
[glyf] Accumulate points as int
...
Everything is int at this stage.
Doesn't seem to matter for performance though.
2022-06-27 13:03:06 -06:00
Behdad Esfahbod
d6f60b3c19
[glyf] Minor optimization
2022-06-27 13:00:08 -06:00
Behdad Esfahbod
b30a3dcba3
[glyf] Another bounds check
...
Very unlikely that is needed but technically possible.
2022-06-27 12:56:54 -06:00
Behdad Esfahbod
2e9dbdcbbe
[glyf] Protect against an unlikely overflow
2022-06-27 12:55:13 -06:00
Behdad Esfahbod
f1fb8c4489
[glyf] Optimize Glyph layout
2022-06-27 12:41:46 -06:00
Behdad Esfahbod
34e3f561b5
[glyf] Fix a bug I introduced recently
...
Pass gid to Glyph in trim_padding codepath.
2022-06-27 12:39:35 -06:00
Behdad Esfahbod
19cbfb9ce9
[glyf] Relax a condition that font num_coords be equal to gvar's
...
gvar itself still checks the same.
2022-06-27 12:32:18 -06:00
Behdad Esfahbod
d5cfbaa068
[glyf] Optimize composite points loading
2022-06-27 12:24:20 -06:00
Behdad Esfahbod
32dc0641e1
[glyf] Remove an unnecessary condition
2022-06-27 12:22:06 -06:00
Behdad Esfahbod
3c49a6a60a
[glyf] Fix an allocation error
...
Try fixing assertion failure found by fuzzers:
hb-draw-fuzzer: ../../src/harfbuzz/src/OT/glyf/glyf.hh:175: bool OT::glyf_accelerator_t::get_points(hb_font_t *, hb_codepoint_t, T) const [T = OT::glyf_impl::path_builder_t]: Assertion `count >= glyf_impl::PHANTOM_COUNT' failed.
2022-06-27 10:57:51 -06:00
Behdad Esfahbod
a1c45bbb55
[glyf] Minor simplify
2022-06-26 17:30:16 -06:00
Behdad Esfahbod
a21a9bb855
[glyf] Optimize flags decoding byte range checking
2022-06-26 17:24:29 -06:00
Behdad Esfahbod
0f1fdf461c
[glyf] Optimize points decoding byte range checking
2022-06-26 17:22:45 -06:00
Behdad Esfahbod
51cfcf2957
[glyf] Optimize points decoding
2022-06-26 17:04:47 -06:00
Behdad Esfahbod
86b7022503
[glyf] Optimize flag decoding
2022-06-26 17:02:32 -06:00
Behdad Esfahbod
2bb0fa878a
[glyf] Remove unneeded point init()
2022-06-26 16:43:05 -06:00
Behdad Esfahbod
fc72a1d22d
[glyf] Add a pre-allocation for phantom points
2022-06-26 16:42:01 -06:00
Behdad Esfahbod
8d242aaa8b
[glyf] Rewrite a loop harmlessly
...
I hope...
2022-06-26 16:36:08 -06:00
Behdad Esfahbod
cf57f04ddb
[glyf/path-builder] Optimize scaling code
...
Scale each point once upon entry to function.
This makes our shape fetching code as fast as FreeType for all
benchmark cases now.
2022-06-26 16:26:17 -06:00
Behdad Esfahbod
b095df1343
[glyf/path-builder] Use operator bool for style
2022-06-26 16:12:50 -06:00
Behdad Esfahbod
abb433d0f4
[glyf] Avoid a copy of points in shape fetching for simple glyphs
...
Matches performance with freetype now.
2022-06-26 16:09:32 -06:00
Behdad Esfahbod
7eac779abf
Revert "Revert "[glyf] Optimize shape loading""
...
This reverts commit 164bd288cf
.
2022-06-26 16:02:27 -06:00
Behdad Esfahbod
164bd288cf
Revert "[glyf] Optimize shape loading"
...
This reverts commit f0819301b7
.
Broke tests. To be debugged and redone.
2022-06-26 16:01:15 -06:00
Behdad Esfahbod
f0819301b7
[glyf] Optimize shape loading
...
Do away with a copy for simple glyph load.
2022-06-26 15:52:54 -06:00
Behdad Esfahbod
65b066f18e
[glyf/path-builder] Simplify initialization
2022-06-26 13:18:00 -06:00
Behdad Esfahbod
2d4557fe04
[glyf/SimpleGlyph] Use member pointer instead of lambda
2022-06-26 13:08:37 -06:00
Behdad Esfahbod
9ce9773040
[glyf/SimpleGlyph] Minor use constructor for contour_point_t
2022-06-26 13:08:37 -06:00
Behdad Esfahbod
f897978f21
[glyf] Adjust a check-range
2022-06-26 13:08:37 -06:00
Behdad Esfahbod
db039d97ff
[glyf/Composite] Make glyphIndex public
2022-06-26 13:08:37 -06:00
Behdad Esfahbod
1b14bf8aa8
[glyf] Rename CompositeGlyphChain to CompositeGlyphRecord
2022-06-26 13:08:37 -06:00
Behdad Esfahbod
a5ac7f2ea6
[glyf/composite_iter_t] Renames
2022-06-26 13:08:37 -06:00
Behdad Esfahbod
449bdeed5f
[glyf] Rename get_iterator() to iter()
...
That's the standard name.
2022-06-25 18:32:30 -06:00
Behdad Esfahbod
11d2670676
[glyf] Split off glyf-helpers.hh
2022-06-25 18:19:09 -06:00
Behdad Esfahbod
7c4b8c9bf4
[glyf] path-builder minor header guards fix test
2022-06-25 18:14:42 -06:00
Behdad Esfahbod
499c637922
[glyf] Split off path-builder.hh
2022-06-25 18:07:49 -06:00
Behdad Esfahbod
13aadc8961
[glyf] Split off CompositeGlyph.hh
2022-06-25 18:03:15 -06:00
Behdad Esfahbod
f0ec2b728e
[glyf] Split off SimpleGlyph.hh
2022-06-25 17:55:16 -06:00
Behdad Esfahbod
8ed78627f0
[glyf] Split off GlyphHeader.hh
2022-06-25 17:53:13 -06:00
Behdad Esfahbod
81315a3016
[glyf] Namespace implementation in glyf_impl
...
Part of https://github.com/harfbuzz/harfbuzz/issues/3677
2022-06-25 17:50:44 -06:00
Behdad Esfahbod
be1d4bcf29
[glyf] Add fast __end__ to composite iterator
2022-06-25 17:45:21 -06:00
Behdad Esfahbod
ef250eea7e
[glyf] Move a few structs out of Glyph{}
2022-06-25 17:37:59 -06:00
Behdad Esfahbod
ae75f066b5
[glyf] Split SubsetGlyph
2022-06-25 17:12:10 -06:00
Behdad Esfahbod
0031069f47
[glyf] Fix includes
2022-06-25 17:05:18 -06:00
Behdad Esfahbod
36373ee15c
[glyf] Move add_gid_and_children to subset-plan where it belongs
2022-06-25 16:55:26 -06:00
Behdad Esfahbod
ba1c9eda38
[glyf] Use a range for loop
2022-06-25 16:51:33 -06:00
Behdad Esfahbod
e4f2bc9342
[glyf] Split Glyph.hh
2022-06-25 16:47:06 -06:00
Behdad Esfahbod
3f9c6bf3fc
[glyf] Minor in _write_loca()
2022-06-25 14:46:26 -06:00
Behdad Esfahbod
852985da0f
[glyf] Split loca.hh
2022-06-25 14:41:51 -06:00
Behdad Esfahbod
100576b7b7
[glyf] Start splitting file
2022-06-25 14:38:43 -06:00