Matthias Clasen
4ba7980b8e
Fix the generated gobject headers
...
These headers are not acceptable to modern compilers.
gcc says things like:
/usr/include/harfbuzz/hb-gobject-enums.h💯 1: warning:
function declaration isn’t a prototype [-Wstrict-prototypes]
100 | hb_gobject_ot_metrics_tag_get_type () G_GNUC_CONST;
2022-06-11 23:47:00 +01:00
Ali Chraghi
79bb3b5278
[docs] fix typo
2022-06-11 13:04:55 +01:00
Behdad Esfahbod
98116e5cf5
[myanmar] Fix comments on categories
...
https://github.com/harfbuzz/harfbuzz/pull/3648#discussion_r894955430
2022-06-11 03:42:36 -06:00
Behdad Esfahbod
02016914b3
[indic-generator] Remove unnecessary Myanmar category=D overrides
...
https://github.com/harfbuzz/harfbuzz/pull/3648#discussion_r894685106
2022-06-10 17:24:19 -06:00
Behdad Esfahbod
937c878078
[indic-generator] Remove unnecessary override for Myanmar U+1039
...
https://github.com/harfbuzz/harfbuzz/pull/3648#discussion_r894762535
2022-06-10 17:20:15 -06:00
Behdad Esfahbod
9504037ccb
[indic-generator] Remove three unneeded Myanmar overrides U+AA74-6
...
These three characters have Indic_Syllabic_Category=Consonant_Placeholder. The
original evidence that prompted these overrides says they can take tone marks.
They are not subjoined: Khamti Shan apparently does not use subjoined
characters at all. Therefore, PLACEHOLDER is good enough and these need not be
overridden to C.
https://www.unicode.org/L2/L2008/08276-khamti-proposal.pdf
https://github.com/harfbuzz/harfbuzz/pull/3648#discussion_r894640713
2022-06-10 17:13:16 -06:00
Behdad Esfahbod
02eb6606d7
[indic-generator] Remove redundant PLACEHODER characters overrides
...
https://github.com/harfbuzz/harfbuzz/pull/3648#discussion_r894631922
2022-06-10 17:10:42 -06:00
Behdad Esfahbod
e16669ceac
[indic-generator] Remove redundant override of U+2010 / U+2011
...
https://github.com/harfbuzz/harfbuzz/pull/3648#discussion_r894630596
2022-06-10 17:05:35 -06:00
Behdad Esfahbod
bb255cd9a6
[indic-generator] Remove redundant override of U+0980
...
https://github.com/harfbuzz/harfbuzz/pull/3648#discussion_r894627064
2022-06-10 17:03:52 -06:00
Behdad Esfahbod
30d8c87d01
[myanmar] Document Medials
...
https://github.com/harfbuzz/harfbuzz/pull/3648#discussion_r894532676
2022-06-10 16:56:15 -06:00
Behdad Esfahbod
e1826c3714
[khmer] Reuse OT_H for OT_Coeng
...
https://github.com/harfbuzz/harfbuzz/pull/3648#discussion_r894517417
2022-06-10 16:53:11 -06:00
Behdad Esfahbod
eb2f2e318a
[indic-generator] Update comment re U+104E
...
https://github.com/harfbuzz/harfbuzz/pull/3648#pullrequestreview-1002150048
2022-06-10 16:47:59 -06:00
Behdad Esfahbod
0daafefdd1
Merge branch 'main' into indic-cleanup
2022-06-10 10:55:49 -06:00
Behdad Esfahbod
148283d0e0
[syllabic] Use a buffer scratch-flag for has-broken-syllable
2022-06-10 07:48:39 -06:00
Behdad Esfahbod
6997d10bc0
[arabic] Remove a couple TODO items
2022-06-10 07:43:33 -06:00
Behdad Esfahbod
e1575f2347
[iter] Remove a few TODO items
2022-06-10 07:41:39 -06:00
Behdad Esfahbod
689c77530a
[buffer] Actually remove TODO item
...
In reality, one side is smaller and one side is larger. The existing code
handles that just fine.
2022-06-10 07:37:45 -06:00
Behdad Esfahbod
d09e962b9f
[buffer] Update a TODO item
2022-06-10 07:36:43 -06:00
Behdad Esfahbod
b3f689e7e5
[serializer] Remove TODO that's not gonna happen
2022-06-10 07:31:47 -06:00
Behdad Esfahbod
10a8cc28fc
[normalizer] Remove a TODO that's not going to happen
2022-06-10 07:31:06 -06:00
Behdad Esfahbod
7635568f29
[font] Remove a TODO item that's not gonna happen
2022-06-10 07:29:15 -06:00
Behdad Esfahbod
bd453de757
[unicode] Accept a couple hacks as permanent
2022-06-10 07:25:48 -06:00
Behdad Esfahbod
39c132a62d
[indic/myanmar] Simplify compare functions
2022-06-10 07:12:39 -06:00
Behdad Esfahbod
a5bcd8567f
[indic] Update comment re category listing
2022-06-10 07:03:02 -06:00
Behdad Esfahbod
10a5485136
[indic/myanmar] Move is_consonant to .cc files
2022-06-10 06:34:56 -06:00
Behdad Esfahbod
1c657460ef
[indic] Expand MEDIAL_FLAGS
2022-06-10 06:29:45 -06:00
Behdad Esfahbod
9e3917f6d6
[indic] Move a couple of functions to .cc file
2022-06-10 06:26:26 -06:00
Behdad Esfahbod
165ef55e57
[indic-generator] Move INDIC_COMBINE_CATEGORIES here
2022-06-10 06:20:10 -06:00
Behdad Esfahbod
b030dd9e88
[indic-table] Minor rename
2022-06-10 06:12:13 -06:00
Behdad Esfahbod
d414fb3328
[indic/khmer/myanmar] Add static_assert that categories match OT_*
2022-06-10 00:50:47 -06:00
Behdad Esfahbod
15ea4ccb04
[indic-like] Add note about replicated values
2022-06-09 17:47:46 -06:00
Behdad Esfahbod
3289e81532
[indic] Use categories from the machine
2022-06-09 17:46:15 -06:00
Behdad Esfahbod
37217fc9be
[indic-generator/myanmar] Move most Myanmar category overrides to generator
2022-06-09 17:27:43 -06:00
Behdad Esfahbod
c136227f57
[indic-generator/khmer] Move Khmer overrides to generator
2022-06-09 13:38:34 -06:00
Behdad Esfahbod
40aa4e8320
[indic/khmer/myanmar] Add Khmer/Myanmar categories to indic_category_t
2022-06-09 13:30:00 -06:00
Behdad Esfahbod
25793075e2
[indic-generator] Move Khmer/Myanmar vowel categories to the generator
2022-06-09 13:11:46 -06:00
Behdad Esfahbod
a6c82d4b8c
[myanmar] Simplify to not use position info from the indic table for shaping
2022-06-09 13:04:28 -06:00
Behdad Esfahbod
10cd8ac0e5
[indic-generator] Move matra category overrides to generator
2022-06-09 12:27:31 -06:00
Behdad Esfahbod
c4e4f1d387
[indic-generator] Move SMVD position overrides to generator
2022-06-09 11:58:37 -06:00
Behdad Esfahbod
2963154c15
[indic-generator] Add a couple comments
2022-06-09 11:53:24 -06:00
Behdad Esfahbod
91d6f45bc9
[indic-generator] Move some position overrides to the generator
2022-06-09 11:52:56 -06:00
Behdad Esfahbod
0ec4dcb93d
[indic-generator] Ouch
...
Not sure how this was passing tests still.
2022-06-09 11:52:25 -06:00
Behdad Esfahbod
f0269e0f1b
[indic-generator] Move Ra handling to the generator
2022-06-09 11:52:03 -06:00
Behdad Esfahbod
419d2146c2
[indic-generator] Cap off what categories have positions
...
This was left off of the commit moving Indic categories to the generator.
It didn't fail any tests, but adding it back because it has implications
possibly.
2022-06-09 11:51:38 -06:00
Behdad Esfahbod
e1d965d527
[indic-generator] Move position mapping to generator
2022-06-09 11:51:15 -06:00
Behdad Esfahbod
4907514026
[indic-generator] Move category overrides to generator
2022-06-09 11:50:30 -06:00
Behdad Esfahbod
58eeb3a180
[indic-generator] Move category mapping to generator
2022-06-09 11:49:57 -06:00
Behdad Esfahbod
899ca24387
[myanmar] Remove duplication of categories in the Myanmar shaper
2022-06-09 07:02:54 -06:00
Behdad Esfahbod
ce0528c0ff
[khmer] Remove duplication of categories in the Khmer shaper
2022-06-09 07:02:54 -06:00
Behdad Esfahbod
17c80035ad
Revert "[cplusplus] Internally allow using hb_unique_ptr with hb_free()"
...
This reverts commit b5f621b08d
.
A build was failing with clang 14 for Firefox apparently, sigh.
https://github.com/harfbuzz/harfbuzz/issues/3647
2022-06-09 04:17:38 -06:00
Behdad Esfahbod
9fc9b1ece4
[layout] Minor, add using Lookup to GSUB/GPOS
2022-06-08 12:37:31 -06:00
Behdad Esfahbod
d4ddb3acf8
Comments typos
2022-06-08 11:45:33 -06:00
Behdad Esfahbod
4119f73c21
[subset/layout] Rename dispatch_closure_lookups_recurse_func to dispatch_recurse_func<>
2022-06-08 18:42:09 +01:00
Behdad Esfahbod
c13ff39520
[layout] Rename apply_recurse_func to specialization of dispatch_recurse_func
2022-06-08 18:42:09 +01:00
Behdad Esfahbod
6a1edb8c97
[set-digest] One more rename
2022-06-08 11:38:17 -06:00
Behdad Esfahbod
6453737b0e
[set-digest] Rename lowest_bits to bits_pattern
2022-06-08 11:37:12 -06:00
Behdad Esfahbod
2a061cb9cc
[set-digest] Improve documentation
2022-06-08 11:35:50 -06:00
Behdad Esfahbod
42051fe18a
[layout] s/inplace/always_inplace/g
2022-06-08 04:00:21 -06:00
Behdad Esfahbod
21346af01d
[layout-cache] Adjust cost-function for recent change
2022-06-07 14:41:39 -06:00
Behdad Esfahbod
bfee6839b0
[layout-cache] Cache lookahead, not input, classdef in ChainContextFormat2
...
From the commit:
+ /* For ChainContextFormat2 we cache the LookaheadClassDef instead of InputClassDef.
+ * The reason is that most heavy fonts want to identify a glyph in context and apply
+ * a lookup to it. In this scenario, the length of the input sequence is one, whereas
+ * the lookahead / backtrack are typically longer. The one glyph in input sequence is
+ * looked-up below and no input glyph is looked up in individual rules, whereas the
+ * lookahead and backtrack glyphs are tried. Since we match lookahead before backtrack,
+ * we should cache lookahead. This decisions showed a 20% improvement in shaping of
+ * the Gulzar font.
https://github.com/harfbuzz/harfbuzz/pull/3636
2022-06-07 11:41:05 -06:00
Behdad Esfahbod
39820af72f
[layout] Add HB_NO_OT_LAYOUT_LOOKUP_CACHE to disable caching lookups
...
Enabled when optimize-size profile is enabled.
2022-06-07 10:27:55 -06:00
Behdad Esfahbod
845279c34c
Merge pull request #3636 from harfbuzz/classdef-cache
...
Classdef cache
2022-06-07 16:40:22 +01:00
Behdad Esfahbod
b59e25f25e
[cff] Try fixing Heap-buffer-overflow in CFF::Charset::collect_glyph_to_sid_map
...
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=47790
2022-06-07 09:27:44 -06:00
Behdad Esfahbod
c8fb048f79
[gsubgpos] Document caching
2022-06-07 09:20:27 -06:00
Behdad Esfahbod
5963cf4469
[gsubgpos] Merge cache_enter and cache_leave entry points
...
Saves a pointer per subtable
2022-06-07 09:17:14 -06:00
Behdad Esfahbod
d4c09e9a87
[gsubgpos] Remove apply_cached() entry point
...
Just use a bool to apply()
2022-06-07 09:17:14 -06:00
Behdad Esfahbod
b96622d15c
[layout] Use a cache for main input ClassDef of (Chain)ContextLookupFormat2
...
This commit adds a per-lookup caching infrastructure to GSUB/GPOS, and
uses it to cache input ClassDef.get_class value for (Chain)ContextLookupFormat2.
For fonts heavy on use of heave class-based2 context matching, this shows
a good speedup. For NotoNastaliqUrdu for example, I observe 17% speedup.
Unfortunately not many other lookups can use a cache like this :(.
https://github.com/harfbuzz/harfbuzz/pull/3636
2022-06-07 09:14:38 -06:00
Xavier Claessens
4266f4e29a
Fix check-* scripts when harfbuzz is a subproject
...
When harfbuzz is a subproject paths are in the form
"subprojects/harfbuzz/src/...". Instead of removing "src/" prefix, take
the absolute path and make it relative to current source dir.
This fix regression introduced in
https://github.com/harfbuzz/harfbuzz/pull/3394 .
2022-06-06 16:53:29 +01:00
Behdad Esfahbod
15543f70e0
[indic-like] Move allocation of syllable() buffer var to shapers that use it
...
In indic, we don't have a pause location release the var.
2022-06-05 08:15:47 -06:00
Behdad Esfahbod
104dc85a22
[buffer] Add try_allocate for buffer variables
2022-06-05 08:15:46 -06:00
Behdad Esfahbod
b5f621b08d
[cplusplus] Internally allow using hb_unique_ptr with hb_free()
...
...for arbitrary types.
2022-06-05 08:15:31 -06:00
Behdad Esfahbod
f18eb000d3
[buffer] Mark a variable as unused
...
Weird. Somehow our HB_TINY bot started erring as this var being unused
in non-debug builds. Not sure why now...
In file included from src/hb-ot-map.hh:32:0,
from src/hb-ot-shape.hh:32,
from src/hb-aat-layout.hh:32,
from src/hb-aat-layout.cc:30,
from src/harfbuzz.cc:1:
src/hb-buffer.hh: In member function ‘void hb_buffer_t::assert_var(unsigned int, unsigned int)’:
src/hb-buffer.hh:192:18: error: unused variable ‘bits’ [-Werror=unused-variable]
unsigned int bits = (1u<<end) - (1u<<start);
^~~~
cc1plus: some warnings being treated as errors
Error: Process completed with exit code 1.
2022-06-05 07:06:07 -06:00
Behdad Esfahbod
e6409d3905
Revert "[layout] Use a cache for main input ClassDef of (Chain)ContextLookups"
...
This reverts commit 57d1c08739
.
Err. This was an accident.
2022-06-05 06:57:37 -06:00
Behdad Esfahbod
57d1c08739
[layout] Use a cache for main input ClassDef of (Chain)ContextLookups
2022-06-05 06:54:19 -06:00
Behdad Esfahbod
92e81ab1df
[indic/khmer/myanmar] Shift category numbers around to avoid overlap
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/3632
2022-06-05 01:14:32 -06:00
Behdad Esfahbod
d6dbc0d175
[gi/ft] Silence warnings
...
gi doesn't understand that FT_Face is a pointer, and not bare struct.
So it skips these APIs anyway. Mark skip to silense the warning.
../src/hb-ft.cc:242: Warning: HarfBuzz: hb_ft_font_get_face: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
../src/hb-ft.cc:264: Warning: HarfBuzz: hb_ft_font_lock_face: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
2022-06-05 00:58:53 -06:00
Behdad Esfahbod
f78a25098a
[gi] Remove Xconstructor annotations
2022-06-05 00:55:35 -06:00
Behdad Esfahbod
cb961eac5c
[configs] Fix builds with HB_NO_BUFFER_SERIALIZE but not HB_NO_BUFFER_VERIFY
...
e986c12075 (commitcomment-75339317)
2022-06-05 00:45:29 -06:00
Behdad Esfahbod
67852504f6
[indic/myanmar] No-op update to machines
2022-06-04 09:27:45 -06:00
Behdad Esfahbod
20a61ca447
[myanmar] Fold D category into GB
...
Trying to free a byte the buffer vars, for caching of lookups.
Part of https://github.com/harfbuzz/harfbuzz/issues/3633
2022-06-04 09:27:37 -06:00
Behdad Esfahbod
f9b643f6b2
[layout] s/hb_get_subtables_context_t/hb_accelerate_subtables_context_t/g
2022-06-04 09:27:31 -06:00
Behdad Esfahbod
d4dfb8c1f1
[arabic] Free up buffer variable earlier
2022-06-04 09:27:23 -06:00
Behdad Esfahbod
cc7ebb0ffa
Remove remaining mention to complex shapers in the code
...
https://github.com/harfbuzz/harfbuzz/pull/3628#issuecomment-1146248037
2022-06-04 05:42:58 -06:00
Behdad Esfahbod
b39b5f2f31
[name] Implement approximate language matching
...
Very rudimentary.
Fixes https://github.com/harfbuzz/harfbuzz/issues/3354
2022-06-03 13:00:33 +01:00
Behdad Esfahbod
40d7d56e53
[subset-input] Minor move
2022-06-03 05:40:18 -06:00
Behdad Esfahbod
40193adbfc
[subset] Update default features list
2022-06-03 05:35:19 -06:00
Behdad Esfahbod
5bfb0b721c
Rename s/shape-complex/shaper/g
2022-06-03 10:30:34 +01:00
Behdad Esfahbod
44be1e5dfb
s/SHAPE_COMPLEX/SHAPER/g
2022-06-03 10:30:34 +01:00
Behdad Esfahbod
6fbb552156
s/FLAG_COMPLEX/FLAG_SHAPER/g
2022-06-03 10:30:34 +01:00
Behdad Esfahbod
6d9e94d2b8
s/hb_ot_shape_complex_categorize/hb_ot_shaper_categorize/g
2022-06-03 10:30:34 +01:00
Behdad Esfahbod
a560182cb3
s/complex_var/ot_shaper_var/g
2022-06-03 10:30:34 +01:00
Behdad Esfahbod
13fbed29e4
s/HB_OT_SHAPE_COMPLEX_MAX_COMBINING_MARKS/HB_OT_SHAPE_MAX_COMBINING_MARKS/g
2022-06-03 10:30:34 +01:00
Behdad Esfahbod
44a7b3b773
s/ot_complex_shaper/ot_shaper/g
2022-06-03 10:30:34 +01:00
Behdad Esfahbod
e5161977a4
s/COMPLEX_SHAPER/OT_SHAPER/g
2022-06-03 10:30:34 +01:00
Behdad Esfahbod
f3a8b7f36b
[algs] Test hb_hash()
2022-06-03 02:21:46 -06:00
Behdad Esfahbod
215a0afad1
[algs] Remove unused hb_coerce()
2022-06-03 01:48:46 -06:00
Behdad Esfahbod
5dc12d7d8d
[cmap] Rewrite set_for() slightly
2022-06-03 01:37:02 -06:00
Behdad Esfahbod
9552955e08
Add an unlikely
2022-06-03 01:33:01 -06:00
Behdad Esfahbod
88f00ecb84
[map] Fix iter_ref () and test it
2022-06-03 01:30:27 -06:00
Behdad Esfahbod
a42c624fca
Convert one final use of hashmap to unique_ptr
2022-06-03 01:22:34 -06:00
Behdad Esfahbod
f13a79548f
[subset] Convert another use of hashmap to unique_ptr
2022-06-03 01:17:20 -06:00
Behdad Esfahbod
25f57230d5
[map] Return references from new iter_ref()
2022-06-03 01:14:35 -06:00
Behdad Esfahbod
a7a688616a
[cmap] Convert another map use to unique_ptr
2022-06-02 18:59:15 -06:00
Behdad Esfahbod
997d9cc466
[map] Make unique_ptr hashable
2022-06-02 18:47:42 -06:00
Behdad Esfahbod
8bb2a3326e
[map] Remove unneeded assignment
2022-06-02 15:18:23 -06:00
Behdad Esfahbod
d7785a6da0
[cplusplus] Add unique_ptr
2022-06-02 12:43:04 -06:00
Behdad Esfahbod
bca710e8ad
[gsubgpos] Use map has() instead of get() when appropriate
2022-06-02 12:06:25 -06:00
Behdad Esfahbod
e9407a2bd2
Use shared_ptr<hb_set_t> in one place
...
See if valgrind is happy...
2022-06-02 12:00:43 -06:00
Behdad Esfahbod
a42a703cb6
[shared_ptr] Clear p in destructor
2022-06-02 12:00:43 -06:00
Behdad Esfahbod
f0a0dcad70
[test-map] Test hashing shared_ptr
2022-06-02 11:25:56 -06:00
Behdad Esfahbod
4c1b5d9ece
Whitespace
2022-06-02 11:25:11 -06:00
Behdad Esfahbod
b9230c5425
[map] Fix has()
2022-06-02 11:23:38 -06:00
Behdad Esfahbod
97ea10a63a
Remove old nullptr_t hacks
...
Were used for hashmap before.
2022-06-02 11:23:38 -06:00
Behdad Esfahbod
3f78a71ca0
[map] Finally! Just can usd hb_hashmap_t<obj_t, obj_t>
...
Yay!
2022-06-02 11:23:37 -06:00
Behdad Esfahbod
0ccab339f9
[map] Remove invalid-key template arguments since unused
2022-06-02 11:23:37 -06:00
Behdad Esfahbod
3f6a8f69a0
[map] Remove invalid-key special-casing
...
Can override invalid-key value now.
2022-06-02 11:23:37 -06:00
Behdad Esfahbod
5328b73fba
[map] Reduce map item size again
2022-06-02 11:23:37 -06:00
Behdad Esfahbod
4f58ae60eb
[map] Keep is_used, is_tombstone as booleans
2022-06-02 11:23:37 -06:00
Behdad Esfahbod
7ec3aad20f
[shared_ptr] Fix hb_hash() crash on nullptr
2022-06-02 18:22:05 +01:00
Behdad Esfahbod
4d646773cf
[cplusplus] Make .reference() return T*
2022-06-02 18:22:05 +01:00
Behdad Esfahbod
7e7a4a8f05
[cplusplus] Fix build
2022-06-02 18:22:05 +01:00
Behdad Esfahbod
a089d91fda
[hash] Adjust hash for shared_ptr, implement it for std::hash
2022-06-02 18:22:05 +01:00
Behdad Esfahbod
e037325efb
[hash] Remove custom hash, rely on std::hash
2022-06-02 18:22:05 +01:00
Behdad Esfahbod
0d3d5b62ae
[cplusplus] Adjustments
2022-06-02 18:22:05 +01:00
Behdad Esfahbod
0b35940a72
Make hb::shared_ptr hashable
2022-06-02 18:22:05 +01:00
Behdad Esfahbod
3817bdfd7f
[hb.hh] Include hb-cplusplus.hh
2022-06-02 18:22:05 +01:00
Behdad Esfahbod
e0f3cab246
[cplusplus] Add hb-cplusplus.hh
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/2152
2022-06-02 18:22:05 +01:00
Garret Rieger
98aaecd397
[subset] fix data race touching Crap() in cff subsetting.
2022-06-01 22:50:35 +01:00
Behdad Esfahbod
c88a6a9ec3
[face] Remove const from get_user_data prototype
...
This was done by mistake.
Since the returned user_data can be changed, face should not be marked
const. Other object types follow this parttern.
2022-06-01 09:46:41 -06:00
Behdad Esfahbod
bc6ecaa262
[font-funcs] Handle case of null func but non-null destroy or user-data
2022-06-01 16:38:12 +01:00
Behdad Esfahbod
88ccbd2c43
[font-funcs] Optimize user-data/destroy storage
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/2427
2022-06-01 16:38:12 +01:00
Behdad Esfahbod
e421613e8f
[sbix] Fix conditional
2022-06-01 09:07:57 -06:00
Behdad Esfahbod
55b911d863
[buffer] Mark getter functions as taking const buffer
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/2873
2022-06-01 08:13:06 -06:00
Behdad Esfahbod
9e1479b5f0
[morx] Limit context length
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/3097
2022-06-01 07:54:45 -06:00
Behdad Esfahbod
62e803b361
[sbix] Limit glyph extents
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/3557
2022-06-01 07:39:20 -06:00
Behdad Esfahbod
cd05d187c8
[font] Fix undefined-behavior when scales are negative
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/3555
2022-06-01 07:27:53 -06:00
Behdad Esfahbod
fc4d42ff99
[ft] Add API to notify that hb_font_t changed
...
New API:
- hb_ft_hb_font_changed()
Mostly reverts 56e0ff9ea1
Related https://github.com/harfbuzz/harfbuzz/issues/2270
Fixes https://github.com/harfbuzz/harfbuzz/issues/3619
2022-06-01 14:12:38 +01:00
Behdad Esfahbod
e246723f0c
[shape] Fail shaping internally if buffer ops exceeded
2022-06-01 05:00:06 -06:00
Behdad Esfahbod
9c0c31dfaa
[buffer] When deleting glyphs, check cluster backwards as well
2022-06-01 04:52:10 -06:00
Behdad Esfahbod
0384f80e78
[buffer-verify] If shaping buffers failed during verification, pass the test
2022-06-01 04:50:15 -06:00
Behdad Esfahbod
eba626ff6a
[shape-plan] Return empty plan if buffer direction is invalid
...
Happens if buffer creation failed.
2022-06-01 04:49:46 -06:00
Behdad Esfahbod
a441c6c16b
[shape] Only verify if text_buffer is successful
2022-06-01 04:49:39 -06:00
Behdad Esfahbod
f7f61aeb6f
[buffer] Add TODO item
2022-06-01 04:48:59 -06:00
Behdad Esfahbod
d72d37008d
[shape] Allow null buffer
...
Ouch!
2022-06-01 04:48:40 -06:00
Behdad Esfahbod
45a2252607
[flags] Fix undefined-behavior
...
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/hb-buffer.hh:60:1 in
failure on clusterfuzz-testcase-minimized-hb-subset-get-codepoints-fuzzer-5736539338833920
2022-05-31 06:35:42 -06:00
Behdad Esfahbod
f3f9fc1544
[buffer] Mark glyph_flags_t as flags
2022-05-31 06:35:42 -06:00
Behdad Esfahbod
ab143e85c3
[buffer] Add HB_BUFFER_FLAG_DEFINED and HB_BUFFER_SERIALIZE_FLAG_DEFINED
...
New API:
+ HB_BUFFER_FLAG_DEFINED
+ HB_BUFFER_SERIALIZE_FLAG_DEFINED
2022-05-31 06:35:42 -06:00
Behdad Esfahbod
9a2a857043
[ot-shape] Don't verify buffer if shaping failed
...
Fixes all of fuzzing verify failures, which were result of buffer failure
on super-long results, which fails unsafe-to-break because shorter strings
don't fail shaping.
2022-05-31 06:35:42 -06:00
Behdad Esfahbod
f8b26f43ec
Merge pull request #3606 from harfbuzz/32bit-varstore
...
32bit varstore
2022-05-31 11:22:32 +01:00
Behdad Esfahbod
5af5a56593
[VarStore] Implement writing 32bit var-store
...
Untested.
Finishes fixing https://github.com/harfbuzz/harfbuzz/issues/2965
2022-05-31 03:58:35 -06:00
Behdad Esfahbod
75112098ac
[VarStore] Implement reading 32bit var-store
...
Untested.
Part of https://github.com/harfbuzz/harfbuzz/issues/2965
Serializing is incomplete.
2022-05-31 03:58:29 -06:00
Xavier Claessens
334bd013d9
Skip warning when building as subproject and ragel is missing
...
It is unlikely to be a developer build in that case.
2022-05-30 18:27:33 +02:00
Behdad Esfahbod
e5d6da7905
[varStore] rename shortCount to wordCount
2022-05-30 07:48:58 -06:00
Behdad Esfahbod
d11455f285
[blob] Fix strncpy() use in Mac resource opening code
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/3616
2022-05-30 06:59:03 -06:00
Behdad Esfahbod
ea2dd54b68
[map] Place item hash between key and value, not after them
...
This way if only one of key and value is 64bit (eg. pointer), and other is 32bit,
the whole item will fit in 128bit, whereas before it would have been bumped up to
196 if only value was 64bit (a common use-case for us.)
2022-05-30 05:54:20 -06:00
Behdad Esfahbod
ec6cefc46a
[repacker] Simplify map types
2022-05-30 05:54:20 -06:00
Behdad Esfahbod
cbcdf442c5
[map] Speed up map's own hash()
2022-05-30 05:54:20 -06:00
Behdad Esfahbod
de33ef61b7
[map] Add TODO item
2022-05-30 05:54:20 -06:00
Behdad Esfahbod
fc5739ea90
[test-map] Whitespace
2022-05-30 05:54:20 -06:00
Behdad Esfahbod
3e64abd5d6
Merge pull request #3613 from harfbuzz/threads-test
...
Threads test
2022-05-30 05:52:21 -06:00
Behdad Esfahbod
efa4385b16
Merge pull request #3615 from harfbuzz/gir-freetype
...
[gi] Add freetype2-2.0 for g-i-r includes
2022-05-30 05:40:56 -06:00
Behdad Esfahbod
f4a8b70016
More member initialization
2022-05-30 05:30:37 -06:00
Behdad Esfahbod
484cc18732
[test-shape-threads] Set language
2022-05-30 05:09:53 -06:00
Behdad Esfahbod
315ef83b4e
Revert "Revert "[ot-lang] Use atomic int for cache""
...
This reverts commit c56ce8681c
.
The revert was not intentional. Ouch!
2022-05-30 05:09:26 -06:00
Khaled Hosny
3427511988
[gi] Add freetype2-2.0 for g-i-r includes
...
Fixes the warnings:
../src/hb-ft.cc:810: Warning: HarfBuzz: hb_ft_face_create: argument ft_face: Unresolved type: 'FT_Face'
../src/hb-ft.cc:886: Warning: HarfBuzz: hb_ft_face_create_cached: argument ft_face: Unresolved type: 'FT_Face'
../src/hb-ft.cc:855: Warning: HarfBuzz: hb_ft_face_create_referenced: argument ft_face: Unresolved type: 'FT_Face'
../src/hb-ft.cc:920: Warning: HarfBuzz: hb_ft_font_create: argument ft_face: Unresolved type: 'FT_Face'
../src/hb-ft.cc:1029: Warning: HarfBuzz: hb_ft_font_create_referenced: argument ft_face: Unresolved type: 'FT_Face'
../src/hb-ft.cc:240: Warning: HarfBuzz: hb_ft_font_get_face: return value: Unresolved type: 'FT_Face'
../src/hb-ft.cc:262: Warning: HarfBuzz: hb_ft_font_lock_face: return value: Unresolved type: 'FT_Face'
2022-05-30 04:48:22 +02:00
Behdad Esfahbod
97aa1ce6ba
[gsubgpos] Move some member initialization
2022-05-29 10:56:41 -06:00
Behdad Esfahbod
0bb4c1f021
[cache] Set default values for cache template parameters
2022-05-29 10:23:19 -06:00
Behdad Esfahbod
3957d2927d
[layout] Remove stale comment
2022-05-29 07:30:58 -06:00
Behdad Esfahbod
b6fed6f711
[set-digest] Minor don't use !! when auto bool conversion happens
2022-05-29 06:33:34 -06:00
Behdad Esfahbod
371e14d99c
Combine uses of map has() then get() with has(.., &..)
2022-05-28 13:40:30 -06:00
Behdad Esfahbod
b99efa6c8d
[map] Minor: use const reference in has()
2022-05-28 05:16:34 -06:00
Behdad Esfahbod
24d5a11dcb
[bimap] Add unlikely and minor optimization in is_empty()
2022-05-28 05:14:16 -06:00
Behdad Esfahbod
c56ce8681c
Revert "[ot-lang] Use atomic int for cache"
...
This reverts commit d61b207491
.
2022-05-28 04:25:51 -06:00
Behdad Esfahbod
63bc6be0cf
Merge pull request #3603 from harfbuzz/font-serial
...
Add font serial API
2022-05-27 08:25:22 -06:00
Behdad Esfahbod
e2aa29907d
[set] Use relaxed atomic ops for last_page_index
...
Since iterating a set from multiple threads is supported.
2022-05-27 07:06:02 -06:00
Behdad Esfahbod
d61b207491
[ot-lang] Use atomic int for cache
...
Fixes(?) https://github.com/harfbuzz/harfbuzz/issues/3612
2022-05-26 18:24:43 -06:00
Behdad Esfahbod
67bd147c73
Merge pull request #3610 from googlefonts/subset_create_tables_face
...
[subset] fix subsetting of faces created via hb_face_create_for_tables.
2022-05-26 05:16:07 -06:00
Behdad Esfahbod
a719e67887
[ot-font] Use atomic ops for cache serial number
...
This guarantees the cache is coherent.
2022-05-26 05:02:50 -06:00
Behdad Esfahbod
5248b2567b
[ot-font/h-advance] Adjust varStore cache condition
...
This gives best performance for short strings, now that we have a h-advance cache as well.
The en-words benchmark in particular, now ot-font is faster than ft.
Second to last line is of interest:
Before:
-----------------------------------------------------------------------------------------------------
Benchmark Time CPU Iterations
-----------------------------------------------------------------------------------------------------
BM_Shape/en-words.txt/Roboto-Regular.ttf/hb 29.8 ms 29.8 ms 23
BM_Shape/en-words.txt/Roboto-Regular.ttf/ft 30.4 ms 30.4 ms 23
BM_Shape/en-words.txt/SourceSerifVariable-Roman.ttf/hb 16.3 ms 16.3 ms 43
BM_Shape/en-words.txt/SourceSerifVariable-Roman.ttf/ft 16.5 ms 16.5 ms 42
BM_Shape/en-words.txt/SourceSerifVariable-Roman.ttf/var/hb 18.0 ms 18.0 ms 39
BM_Shape/en-words.txt/SourceSerifVariable-Roman.ttf/var/ft 17.8 ms 17.8 ms 39
After:
behdad@Behdads-MacBook-Pro harfbuzz % ninja -Cbuild && build/perf/benchmark-shape --benchmark_filter=en-words
-----------------------------------------------------------------------------------------------------
Benchmark Time CPU Iterations
-----------------------------------------------------------------------------------------------------
BM_Shape/en-words.txt/Roboto-Regular.ttf/hb 30.0 ms 30.0 ms 23
BM_Shape/en-words.txt/Roboto-Regular.ttf/ft 30.3 ms 30.3 ms 23
BM_Shape/en-words.txt/SourceSerifVariable-Roman.ttf/hb 16.3 ms 16.3 ms 43
BM_Shape/en-words.txt/SourceSerifVariable-Roman.ttf/ft 16.4 ms 16.4 ms 43
BM_Shape/en-words.txt/SourceSerifVariable-Roman.ttf/var/hb 17.6 ms 17.6 ms 40
BM_Shape/en-words.txt/SourceSerifVariable-Roman.ttf/var/ft 17.8 ms 17.8 ms 39
2022-05-26 05:02:50 -06:00
Behdad Esfahbod
12fff976b6
[ot-var] Use atomic int for cached-serial
2022-05-26 05:02:50 -06:00
Behdad Esfahbod
0919eaa6e8
[ot-font] Remove lock around cache
...
Not needed.
2022-05-26 05:02:50 -06:00
Behdad Esfahbod
3548b6025f
[ot-font] Cache h-advances for variable fonts
2022-05-26 05:02:50 -06:00
Behdad Esfahbod
39a07bf3eb
[ot-font] Rename cache to varStore_cache
2022-05-26 05:02:50 -06:00
Behdad Esfahbod
970e03ecae
[ot-font] Add a hb_ot_font_t struct
2022-05-26 05:02:50 -06:00
Behdad Esfahbod
80c49933c6
[hb-ft] Adjust serial signature
2022-05-26 05:02:50 -06:00
Behdad Esfahbod
56e0ff9ea1
[ft] If hb_font changed, update FT_Face
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/2270
Rather untested.
2022-05-26 05:02:50 -06:00
Behdad Esfahbod
d0de389de8
[font] Fix test
2022-05-26 05:02:50 -06:00
Behdad Esfahbod
a2015cd300
[font] Add a separate serial_coords
2022-05-26 05:02:50 -06:00
Behdad Esfahbod
8629df188a
[ft] Discard advance cache if font changed
...
Uses newly added font serial API.
Part of https://github.com/harfbuzz/harfbuzz/issues/2270
But doesn't set new coords on the FT_Face. That's a lot more
work :(.
2022-05-26 05:02:50 -06:00
Behdad Esfahbod
48db1c9583
[font] Add serial API
...
New API:
+ hb_font_get_serial()
+ hb_font_changed()
Fixes https://github.com/harfbuzz/harfbuzz/issues/2426
Unused internally as of now.
2022-05-26 05:02:50 -06:00
Behdad Esfahbod
efa2a5796e
[map] Add hb_map_copy()
...
New API:
+ hb_map_copy()
2022-05-26 05:01:57 -06:00
Behdad Esfahbod
3b28cff9c0
[cff1] Fix null dereference on memory alloc failure
2022-05-26 04:42:17 -06:00
Behdad Esfahbod
8df9aba997
Actually try to fix null-size undefined behavior
...
Related to:
https://github.com/harfbuzz/harfbuzz/pull/2067
https://bugzilla.mozilla.org/show_bug.cgi?id=1577584
2022-05-26 03:59:21 -06:00
Garret Rieger
e00c7358a0
[subset] special case table presence check for hb_face_create_from_tables faces.
2022-05-25 22:39:00 +00:00
Garret Rieger
6a149a09e7
[subset] fix use of lazy static constructor.
2022-05-25 22:22:35 +00:00
Garret Rieger
d4c7939eb7
[subset] use a list of known tables instead of handled tables.
2022-05-25 22:11:32 +00:00
Garret Rieger
3472f73b79
[subset] also include no subset tables when guessing which tables are present.
2022-05-25 21:52:48 +00:00
Garret Rieger
9564d98739
[subset] fix subsetting of faces created via hb_face_create_for_tables.
...
Fixes #3609 .
2022-05-25 21:16:37 +00:00
Behdad Esfahbod
6010feeeb5
[varStore] Rename variable as per review
...
https://github.com/harfbuzz/harfbuzz/pull/3605
2022-05-24 09:01:02 -06:00
Behdad Esfahbod
3eb7eff487
Remove varstore cache use if HB_NO_VAR
2022-05-21 15:25:53 -06:00
Behdad Esfahbod
099482a37a
[ot-font] Cache v_advance varstore as well
2022-05-21 15:24:23 -06:00
Behdad Esfahbod
d9acc045f1
[VarStore] Sprinkle cache_t type around
...
It's available so no need to use void*.
2022-05-21 15:12:14 -06:00
Behdad Esfahbod
da38312e42
[VarStore] Pepper cache with likely()
2022-05-21 15:12:14 -06:00
Behdad Esfahbod
cf8f00e354
[VarStore] Don't use NAN
...
Is faster.
With this, I'm seeing 25 to 28% speedup in glyph_h_advances benchmark
of benchmark-font for var/hb tests.
2022-05-21 15:12:14 -06:00
Behdad Esfahbod
5336ba70f6
[HVAR] Cache VarStore region scalars
2022-05-21 15:12:14 -06:00
Behdad Esfahbod
880f50f7e4
Refactor varstore cache
2022-05-21 15:12:14 -06:00
Behdad Esfahbod
f2a2fb91a3
[GPOS] Cache VarStore region scalars
2022-05-21 15:12:14 -06:00
Behdad Esfahbod
5fbc70c59b
[VarStore] Add cache API
2022-05-21 15:12:14 -06:00
Behdad Esfahbod
05e82aa12e
[ft] Add missing lock to kerning function
2022-05-20 17:36:59 -06:00
Behdad Esfahbod
4ea2725704
[set/map] Expose hash API publicly
...
New API:
+ hb_set_hash()
+ hb_map_hash()
2022-05-20 13:19:48 -06:00
Behdad Esfahbod
2e186d9f24
[buffer] Improve hash function of segment_properties_t
2022-05-20 13:19:48 -06:00
Khaled Hosny
aee123fc83
4.3.0
2022-05-20 21:07:25 +02:00
Behdad Esfahbod
975a5f9194
[array] Use hb_memcmp instead of memcmp
...
Fixes ubsan error.
2022-05-20 12:34:49 -06:00
Behdad Esfahbod
55804e8d68
[hb-ft] Minor rearrange of struct members
...
To make clear what members the lock protects.
2022-05-20 11:40:44 -06:00
Garret Rieger
cbf8f44c9b
[subset-perf] swap instead of copying vertice's when reordering during sort.
2022-05-20 09:41:18 -06:00
Garret Rieger
b32ca2a292
[subset-perf] remove sort_kahn from repacker.
...
Without an optimized FIFO queue implementation it's nearly as slow as the now optimized sort_shortest_distance.
2022-05-20 09:41:18 -06:00
Behdad Esfahbod
4266cf3be2
[array] Specialize operator== for bytes_t and ubytes_t
2022-05-19 18:16:54 -06:00
Behdad Esfahbod
6eaa22e9d7
[serialize] Reduce link_t size from 16 to 12
2022-05-19 18:16:54 -06:00
Behdad Esfahbod
30ba9a39e2
[vector] Add emplacing push implementation
2022-05-19 18:16:48 -06:00
Garret Rieger
73b8360dcf
[subset] fix fuzzer found underflow when heap push fails.
...
Fixes https://oss-fuzz.com/testcase-detail/5148625505746944 .
2022-05-19 17:02:34 -06:00
Behdad Esfahbod
f1bf14ea89
Revert "[set] Cache hash value"
...
This reverts commit 44952bcc25
.
While we investivate https://github.com/harfbuzz/harfbuzz/issues/3599
2022-05-19 16:49:27 -06:00
Behdad Esfahbod
b4d1ec310c
[algs] Declare coerce() as constexpr
2022-05-19 16:06:21 -06:00
Behdad Esfahbod
2fdb7616f5
[map Further adjust hash function
2022-05-19 16:00:43 -06:00
Behdad Esfahbod
01fc90b68c
[map] Adjust hash function
2022-05-19 16:00:06 -06:00
Behdad Esfahbod
a47b0aebf5
[vector] Fix remove() implementation
...
test-vector under valgrind happy now.
2022-05-19 15:52:16 -06:00
Behdad Esfahbod
3bd755c32d
[test-vector] Test remove()
...
Currently buggy. Valgrind confirms.
2022-05-19 15:51:18 -06:00
Behdad Esfahbod
58f848daa8
[set/map] Adjust hash function return type
2022-05-19 15:43:19 -06:00
Behdad Esfahbod
6544fc284f
[vector] Add further copy implementation
2022-05-19 15:43:15 -06:00
Behdad Esfahbod
c19f116952
[meta] Remove non-existing gcc4 trait implementation
2022-05-19 15:43:15 -06:00
Behdad Esfahbod
679b900e9b
[meta] Fix gcc4 trait implementation
2022-05-19 15:43:15 -06:00
Behdad Esfahbod
fb77f48ffd
[vector] Optimize vector copy
2022-05-19 15:43:15 -06:00
Behdad Esfahbod
28b44ac46a
[set] Switch set copy to vector operator =
...
Slows it down currently.
2022-05-19 15:43:15 -06:00
Behdad Esfahbod
37d3275dec
[test-vector] Enable disabled test
...
This seems to work already.
2022-05-19 15:43:15 -06:00
Behdad Esfahbod
544ffb913e
[set] Adjust grow_vector condition
2022-05-19 15:43:15 -06:00
Behdad Esfahbod
0623aa598b
[benchmark-set] Add benchmark for set copy
2022-05-19 15:43:15 -06:00
Behdad Esfahbod
44952bcc25
[set] Cache hash value
2022-05-19 14:02:48 -06:00
Behdad Esfahbod
844ac328e4
[set] Fix hb_set_t hash stability
2022-05-19 13:54:31 -06:00
Behdad Esfahbod
2d0b1248b2
[test-map] Test hb_set_t hash stability
...
Fails currently.
2022-05-19 13:53:53 -06:00
Behdad Esfahbod
561e02fefb
[map] Make hb_map_t hashable
2022-05-19 13:41:53 -06:00
Behdad Esfahbod
ad17699089
[map] Add is_equal() / towards making hb_map_t hashable
...
New API:
+ hb_map_is_equal()
2022-05-19 13:36:12 -06:00
Behdad Esfahbod
14a24d8e3f
[vector] Make hb_vector_t hashable
2022-05-19 13:04:06 -06:00
Behdad Esfahbod
124f9aeb9b
[set] Make hb_set_t hashable
2022-05-19 12:58:02 -06:00
Garret Rieger
3ab2c7935f
[subset-perf] Signficiantly speed up ClassDef*::subset.
...
Eliminates the usage of a glyph -> klass hash map and replaces it with a vector storing the mapping. This allows us to use the vector directly as the iterator driving the serialize. Approximately 1% speedup for Noto Nastaliq.
2022-05-19 12:37:28 -06:00
David Corbett
e3e685e5ee
[ot-tags] Fix `min_subtag_len` calculations
2022-05-18 18:30:01 -06:00
Garret Rieger
0b1c2ff96a
[subset-perf] Remove extra map lookup in ClassDef subset methods.
2022-05-18 18:25:36 -06:00
Garret Rieger
13ace77f1d
[subset-perf] Use glyph_map instead of set in ClassDefFormat.
2022-05-18 18:25:36 -06:00
Garret Rieger
adae2f2272
[subset-perf] Cache a glyph map for gsub.
...
This allows us in some cases to avoid using glyph_set_gsub as a filter.
2022-05-18 18:25:36 -06:00
Behdad Esfahbod
202e6c4699
[subset] Remove unnecessary test
2022-05-18 17:12:43 -06:00
Behdad Esfahbod
cedf739646
Add some commented-out code
2022-05-18 16:53:26 -06:00
Behdad Esfahbod
6b62c10f02
[priority-queue] Remove old init/fini
2022-05-18 16:27:54 -06:00
Behdad Esfahbod
bff8248a9d
[repacker] Pre-alloc vertices
2022-05-18 16:25:03 -06:00
Behdad Esfahbod
39a424caf0
[priority-queue] Optimize heap access
2022-05-18 16:19:44 -06:00
Behdad Esfahbod
9308659fd7
[priority-queue] Optimize swap()
2022-05-18 16:14:25 -06:00
Behdad Esfahbod
c7317ef761
[repacker] Avoid destroying and recreating objects
2022-05-18 16:03:41 -06:00
Behdad Esfahbod
864e09a0c4
[repacker] Reuse allocated vector
2022-05-18 15:59:29 -06:00
Behdad Esfahbod
ca77f16470
[repacker] Remove unnecessary vector .fini() calls
2022-05-18 15:55:49 -06:00
Behdad Esfahbod
4cfc2d668e
[subset] Use a std::move on set_t when feasible
2022-05-18 15:32:19 -06:00
Behdad Esfahbod
1f578b5a32
[set] Add pre-allocation internal API
2022-05-18 15:25:00 -06:00
Garret Rieger
48dfbd54a3
[subset] minor cleanup.
2022-05-18 15:24:54 -06:00
Garret Rieger
482c6e5dc4
[subset-perf] Speed up Coverage::serialize by caching iterator.
2022-05-18 15:24:54 -06:00
Behdad Esfahbod
14b18725f0
In Coverage::iter_t, assume iterators are from same Coverage object
...
No need to support otherwise.
2022-05-18 15:14:32 -06:00
Behdad Esfahbod
27141735c3
[subset] Add Coverage::__end__ implementation
2022-05-18 15:12:49 -06:00
Behdad Esfahbod
c476f58adb
[subset] Write CoverageFormat2::intersects_coverage() as bsearch()
2022-05-18 14:20:23 -06:00
Behdad Esfahbod
63c6695108
[ot-layout] Cosmetic
...
The implementation of HBUINT16 operator == is slower than just
comparing to ints.
2022-05-18 13:53:52 -06:00
Behdad Esfahbod
777debd748
[subset] Rewrite CoverageFormat2::intersects as dagger
2022-05-18 13:46:06 -06:00
Behdad Esfahbod
cf5001fac7
[subset] Optimize CoverageFormat2::intersected_coverage_glyphs
2022-05-18 13:38:29 -06:00
Behdad Esfahbod
6f37c20798
[subset] Minor rewrite in CoverageFormat2::serialize()
2022-05-18 13:25:42 -06:00
Behdad Esfahbod
e91863b717
[subset-cff] Pre-size map in subr_remap_t::create()
2022-05-18 12:39:55 -06:00
Behdad Esfahbod
ce60462173
[subset-plan] Pre-size maps in _create_old_gid_to_new_gid_map()
2022-05-18 12:34:27 -06:00
Behdad Esfahbod
f82ee17a75
[map] Pre-size map in constructor if we can
2022-05-18 12:19:49 -06:00
Behdad Esfahbod
b5aa8a27ea
[subset-cff] Cosmetic
2022-05-18 11:58:58 -06:00
Behdad Esfahbod
0b201623f5
[subset-cff] Fix previous commit
...
Oops!
2022-05-18 11:58:22 -06:00
Behdad Esfahbod
4792309265
[subset-cff] Access vector directly
2022-05-18 11:54:08 -06:00
Behdad Esfahbod
7c86f2e763
[subset-cff] Pre-alloc out buffer
2022-05-18 11:45:27 -06:00
Behdad Esfahbod
0761e7cdfd
[subset-cff] Avoid resetting buffer as encoder does
2022-05-18 11:38:25 -06:00
Behdad Esfahbod
71aa10a394
[subset-cff] Manually grow vector to avoid memset overhead
2022-05-18 11:37:24 -06:00
Behdad Esfahbod
f455cc53fd
[subset-cff] Reuse buffer allocation
2022-05-18 11:31:55 -06:00
Behdad Esfahbod
e24797aeac
[ot-tags] Follow-up to previous commit
...
Part of https://github.com/harfbuzz/harfbuzz/issues/3591
2022-05-18 11:10:10 -06:00
Behdad Esfahbod
f5d619be79
[ot-tags] Further gate the slow complex case, and add more tests
...
Part of https://github.com/harfbuzz/harfbuzz/issues/3591
Still 'zh-trad' is the slowest case.
--------------------------------------------------------------------------------------------------
Benchmark Time CPU Iterations
--------------------------------------------------------------------------------------------------
BM_hb_ot_tags_from_script_and_language/COMMON zh_trad 136 ns 136 ns 5107838
BM_hb_ot_tags_from_script_and_language/COMMON ab_abcd 115 ns 115 ns 6103104
BM_hb_ot_tags_from_script_and_language/COMMON ab_abc 25.4 ns 25.3 ns 27674482
BM_hb_ot_tags_from_script_and_language/COMMON abcdef_XY 20.2 ns 20.1 ns 34795719
BM_hb_ot_tags_from_script_and_language/COMMON abcd_XY 19.4 ns 19.3 ns 36390401
BM_hb_ot_tags_from_script_and_language/COMMON cxy_CN 33.5 ns 33.4 ns 20998939
BM_hb_ot_tags_from_script_and_language/COMMON exy_CN 25.1 ns 25.0 ns 27705832
BM_hb_ot_tags_from_script_and_language/COMMON zh_CN 34.2 ns 34.1 ns 20564356
BM_hb_ot_tags_from_script_and_language/COMMON en_US 15.5 ns 15.5 ns 45032204
BM_hb_ot_tags_from_script_and_language/LATIN en_US 15.9 ns 15.8 ns 44412379
BM_hb_ot_tags_from_script_and_language/COMMON none 4.72 ns 4.71 ns 149101665
BM_hb_ot_tags_from_script_and_language/LATIN none 4.72 ns 4.70 ns 149254498
2022-05-18 11:04:52 -06:00
Behdad Esfahbod
9c64bda21d
[ot-tag] Whitespace
2022-05-17 17:31:18 -06:00
Behdad Esfahbod
3df8017e9b
[ot-tag] Optimize subtag_matches() more
2022-05-17 17:29:39 -06:00
Behdad Esfahbod
7f6e8c5536
[ot-tags] Optimize subtag_matches() further
...
Part of https://github.com/harfbuzz/harfbuzz/issues/3591
Comparing before to after
Benchmark Time CPU Time Old Time New CPU Old CPU New
----------------------------------------------------------------------------------------------------------------------------------------------------
BM_hb_ot_tags_from_script_and_language/COMMON abcd_XY -0.3371 -0.3371 71 47 71 47
2022-05-17 16:58:35 -06:00
Behdad Esfahbod
27c11405a2
[ot-tag] Optimize subtag_matches
...
Part of https://github.com/harfbuzz/harfbuzz/issues/3591
2022-05-17 16:51:51 -06:00
Behdad Esfahbod
a07d818597
[ot-tag] Add a likely() to the cache hit case
2022-05-17 16:46:10 -06:00
Behdad Esfahbod
dfca47f419
[ot-tag] Cache last bsearch result
...
Part of https://github.com/harfbuzz/harfbuzz/issues/3591
Humm. Looks like not all of the fat is bsearch overhead now. I cached
the last bsearch result, but most of the time is still there. I'm
baffled.
Before:
------------------------------------------------------------------------------------------------
Benchmark Time CPU Iterations
------------------------------------------------------------------------------------------------
BM_hb_ot_tags_from_script_and_language/COMMON abcd_XY 8.08 ns 8.05 ns 84500482
BM_hb_ot_tags_from_script_and_language/COMMON zh_CN 42.2 ns 42.1 ns 16722006
BM_hb_ot_tags_from_script_and_language/COMMON en_US 16.1 ns 16.0 ns 43461527
BM_hb_ot_tags_from_script_and_language/LATIN en_US 16.5 ns 16.5 ns 42448505
BM_hb_ot_tags_from_script_and_language/COMMON none 4.34 ns 4.33 ns 161290530
BM_hb_ot_tags_from_script_and_language/LATIN none 4.34 ns 4.33 ns 162339799
After:
------------------------------------------------------------------------------------------------
Benchmark Time CPU Iterations
------------------------------------------------------------------------------------------------
BM_hb_ot_tags_from_script_and_language/COMMON abcd_XY 8.13 ns 8.11 ns 80438134
BM_hb_ot_tags_from_script_and_language/COMMON zh_CN 40.0 ns 39.9 ns 17487939
BM_hb_ot_tags_from_script_and_language/COMMON en_US 12.7 ns 12.7 ns 55124394
BM_hb_ot_tags_from_script_and_language/LATIN en_US 13.1 ns 13.0 ns 53660125
BM_hb_ot_tags_from_script_and_language/COMMON none 4.61 ns 4.60 ns 151394104
BM_hb_ot_tags_from_script_and_language/LATIN none 4.70 ns 4.68 ns 150402847
2022-05-17 16:21:02 -06:00
Behdad Esfahbod
909f00ac6e
[ot-tags] Further speed up language bsearch()
...
Using an integer tag to bsearch, instead of string.
Part of: https://github.com/harfbuzz/harfbuzz/issues/3591
Before:
------------------------------------------------------------------------------------------------
Benchmark Time CPU Iterations
------------------------------------------------------------------------------------------------
BM_hb_ot_tags_from_script_and_language/COMMON abcd_XY 8.11 ns 8.08 ns 87067795
BM_hb_ot_tags_from_script_and_language/COMMON zh_CN 53.6 ns 53.5 ns 13042418
BM_hb_ot_tags_from_script_and_language/COMMON en_US 24.2 ns 24.1 ns 29052731
BM_hb_ot_tags_from_script_and_language/LATIN en_US 24.4 ns 24.3 ns 28736769
BM_hb_ot_tags_from_script_and_language/COMMON none 4.43 ns 4.41 ns 160370413
BM_hb_ot_tags_from_script_and_language/LATIN none 4.35 ns 4.34 ns 160578191
After:
------------------------------------------------------------------------------------------------
Benchmark Time CPU Iterations
------------------------------------------------------------------------------------------------
BM_hb_ot_tags_from_script_and_language/COMMON abcd_XY 7.97 ns 7.95 ns 85208363
BM_hb_ot_tags_from_script_and_language/COMMON zh_CN 41.7 ns 41.6 ns 16945817
BM_hb_ot_tags_from_script_and_language/COMMON en_US 16.1 ns 16.0 ns 43613523
BM_hb_ot_tags_from_script_and_language/LATIN en_US 16.5 ns 16.4 ns 42568107
BM_hb_ot_tags_from_script_and_language/COMMON none 4.30 ns 4.29 ns 164055469
BM_hb_ot_tags_from_script_and_language/LATIN none 4.29 ns 4.27 ns 163793591
2022-05-17 15:51:41 -06:00
Behdad Esfahbod
c460cf74ce
[ot-tags] Cosmetic
2022-05-17 15:30:11 -06:00
Behdad Esfahbod
1c8226ed14
Fix compiler warning
...
On Mac compiler:
FAILED: src/libharfbuzz.0.dylib.p/hb-ot-tag.cc.o
c++ -Isrc/libharfbuzz.0.dylib.p -Isrc -I../src -I. -I.. -I/usr/local/opt/freetype/include/freetype2 -I/usr/local/Cellar/graphite2/1.3.14/include -I/usr/local/Cellar/glib/2.72.1/include/glib-2.0 -I/usr/local/Cellar/glib/2.72.1/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/pcre/8.45/include -Xclang -fcolor-diagnostics --coverage -pipe -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++11 -fno-rtti -O2 -g -fno-exceptions -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -DHAVE_CONFIG_H -Wno-non-virtual-dtor -MD -MQ src/libharfbuzz.0.dylib.p/hb-ot-tag.cc.o -MF src/libharfbuzz.0.dylib.p/hb-ot-tag.cc.o.d -o src/libharfbuzz.0.dylib.p/hb-ot-tag.cc.o -c ../src/hb-ot-tag.cc
In file included from ../src/hb-ot-tag.cc:29:
In file included from ../src/hb.hh:481:
../src/hb-array.hh:359:14: error: missing default argument on parameter 'ds'
Ts... ds) const
^
../src/hb-ot-tag.cc:292:58: note: in instantiation of function template specialization 'hb_sorted_array_t<const LangTag>::bfind<const char *, unsigned int>' requested here
if (hb_sorted_array (ot_languages, ot_languages_len).bfind (lang_str, &tag_idx,
^
1 error generated.
2022-05-17 15:28:50 -06:00
Behdad Esfahbod
c1f4b57c06
[ot-tags] Optimize language comparison
...
Now that we know both strings are of equal len of 2 or 3, optimize.
Part of https://github.com/harfbuzz/harfbuzz/issues/3591
Before:
------------------------------------------------------------------------------------------------
Benchmark Time CPU Iterations
------------------------------------------------------------------------------------------------
BM_hb_ot_tags_from_script_and_language/COMMON abcd_XY 8.50 ns 8.47 ns 81221549
BM_hb_ot_tags_from_script_and_language/COMMON zh_CN 79.6 ns 79.3 ns 8785804
BM_hb_ot_tags_from_script_and_language/COMMON en_US 40.0 ns 39.9 ns 17462768
BM_hb_ot_tags_from_script_and_language/LATIN en_US 39.2 ns 39.1 ns 17886793
BM_hb_ot_tags_from_script_and_language/COMMON none 4.31 ns 4.30 ns 162805417
BM_hb_ot_tags_from_script_and_language/LATIN none 4.32 ns 4.31 ns 162656688
After:
------------------------------------------------------------------------------------------------
Benchmark Time CPU Iterations
------------------------------------------------------------------------------------------------
BM_hb_ot_tags_from_script_and_language/COMMON abcd_XY 8.27 ns 8.24 ns 81868701
BM_hb_ot_tags_from_script_and_language/COMMON zh_CN 56.1 ns 56.0 ns 12353284
BM_hb_ot_tags_from_script_and_language/COMMON en_US 24.3 ns 24.2 ns 28955030
BM_hb_ot_tags_from_script_and_language/LATIN en_US 24.5 ns 24.4 ns 28664868
BM_hb_ot_tags_from_script_and_language/COMMON none 4.35 ns 4.34 ns 161190014
BM_hb_ot_tags_from_script_and_language/LATIN none 4.36 ns 4.34 ns 161319000
2022-05-17 15:19:40 -06:00
Behdad Esfahbod
dde48d78c1
Fix compiler warning
2022-05-17 15:07:49 -06:00
Behdad Esfahbod
15be0deda0
[ot-tags] Optimize lang_matches()
...
Part of https://github.com/harfbuzz/harfbuzz/issues/3591
Before:
------------------------------------------------------------------------------------------------
Benchmark Time CPU Iterations
------------------------------------------------------------------------------------------------
BM_hb_ot_tags_from_script_and_language/COMMON abcd_XY 8.67 ns 8.64 ns 80324382
BM_hb_ot_tags_from_script_and_language/COMMON zh_CN 91.2 ns 90.9 ns 7674131
BM_hb_ot_tags_from_script_and_language/COMMON en_US 41.1 ns 41.0 ns 17174093
BM_hb_ot_tags_from_script_and_language/LATIN en_US 41.3 ns 41.2 ns 17000876
BM_hb_ot_tags_from_script_and_language/COMMON none 4.56 ns 4.55 ns 153914130
BM_hb_ot_tags_from_script_and_language/LATIN none 4.53 ns 4.52 ns 153830303
After:
------------------------------------------------------------------------------------------------
Benchmark Time CPU Iterations
------------------------------------------------------------------------------------------------
BM_hb_ot_tags_from_script_and_language/COMMON abcd_XY 8.24 ns 8.21 ns 84078465
BM_hb_ot_tags_from_script_and_language/COMMON zh_CN 77.5 ns 77.2 ns 9059230
BM_hb_ot_tags_from_script_and_language/COMMON en_US 38.8 ns 38.7 ns 17790692
BM_hb_ot_tags_from_script_and_language/LATIN en_US 37.6 ns 37.5 ns 18648293
BM_hb_ot_tags_from_script_and_language/COMMON none 4.50 ns 4.49 ns 155573267
BM_hb_ot_tags_from_script_and_language/LATIN none 4.49 ns 4.47 ns 156456653
2022-05-17 14:57:08 -06:00
Behdad Esfahbod
dd3c858f84
[ot-tags] Speed up hb_ot_tags_from_language()
...
Part of https://github.com/harfbuzz/harfbuzz/issues/3591
"After that, bulk of the time I suppose is spent in binary-searching the
language table. I suggest we split the language table in 2-letter and
3-letter tags, to speed-up the vast majority of cases that are
2-letter."
benchmark-ot, before:
----------------------------------------------------------------------------------------------
Benchmark Time CPU Iterations
----------------------------------------------------------------------------------------------
BM_hb_ot_tags_from_script_and_language/COMMON zh_CN 112 ns 111 ns 6286271
BM_hb_ot_tags_from_script_and_language/COMMON en_US 60.6 ns 60.4 ns 11671176
BM_hb_ot_tags_from_script_and_language/LATIN en_US 61.3 ns 61.1 ns 11442645
BM_hb_ot_tags_from_script_and_language/COMMON none 4.75 ns 4.74 ns 146997235
BM_hb_ot_tags_from_script_and_language/LATIN none 4.65 ns 4.64 ns 150938747
After:
----------------------------------------------------------------------------------------------
Benchmark Time CPU Iterations
----------------------------------------------------------------------------------------------
BM_hb_ot_tags_from_script_and_language/COMMON zh_CN 89.5 ns 89.2 ns 7747649
BM_hb_ot_tags_from_script_and_language/COMMON en_US 38.5 ns 38.4 ns 18199432
BM_hb_ot_tags_from_script_and_language/LATIN en_US 39.0 ns 38.9 ns 18049238
BM_hb_ot_tags_from_script_and_language/COMMON none 4.53 ns 4.52 ns 154895110
BM_hb_ot_tags_from_script_and_language/LATIN none 4.54 ns 4.52 ns 154762105
2022-05-17 14:28:28 -06:00
Behdad Esfahbod
9baccb9860
[ot-tags] Speed up hb_ot_tags_from_complex_language()
...
Part of https://github.com/harfbuzz/harfbuzz/issues/3591
2. All the subtag_matches outside the switch match long strings (>= 6 or so).
As such, check the tag for such length before going into any of them.
benchmark-ot, before:
----------------------------------------------------------------------------------------------
Benchmark Time CPU Iterations
----------------------------------------------------------------------------------------------
BM_hb_ot_tags_from_script_and_language/COMMON zh_CN 172 ns 171 ns 4083155
BM_hb_ot_tags_from_script_and_language/COMMON en_US 120 ns 119 ns 5849947
BM_hb_ot_tags_from_script_and_language/LATIN en_US 113 ns 112 ns 5840326
BM_hb_ot_tags_from_script_and_language/COMMON none 4.66 ns 4.64 ns 151396224
BM_hb_ot_tags_from_script_and_language/LATIN none 4.66 ns 4.64 ns 149019593
After:
----------------------------------------------------------------------------------------------
Benchmark Time CPU Iterations
----------------------------------------------------------------------------------------------
BM_hb_ot_tags_from_script_and_language/COMMON zh_CN 112 ns 112 ns 6357763
BM_hb_ot_tags_from_script_and_language/COMMON en_US 60.5 ns 60.3 ns 11475091
BM_hb_ot_tags_from_script_and_language/LATIN en_US 54.9 ns 54.8 ns 12575690
BM_hb_ot_tags_from_script_and_language/COMMON none 4.61 ns 4.59 ns 152388450
BM_hb_ot_tags_from_script_and_language/LATIN none 4.66 ns 4.64 ns 151497600
2022-05-17 13:34:34 -06:00
Behdad Esfahbod
fb413f5202
[subset/cff] Don't use bitfields for hot bools
...
The struct has room because of alignment, and these bools are hot.
2022-05-16 17:38:18 -06:00
Behdad Esfahbod
a4d98b63ea
[subset/cff1] Collect glyph-to-sid map to avoid an O(n^2) algorithm
...
Saves 13 for largest benchmark:
BM_subset/subset_glyphs/SourceHanSans-Regular_subset.otf/10000 -0.1313 -0.1308 75 65 75 65
BM_subset/subset_codepoints/SourceHanSans-Regular_subset.otf/4096 -0.1009 -0.1004 54 48 54 48
BM_subset/subset_codepoints/SourceHanSans-Regular_subset.otf/10000 -0.1067 -0.1066 70 62 69 62
2022-05-16 17:38:18 -06:00
Behdad Esfahbod
b87f48e948
[cff1] get_sid() move bounds check into each implementation
2022-05-16 17:38:18 -06:00
Behdad Esfahbod
e1e359b4da
[cff1] Tighten up range_list_t a bit
2022-05-16 16:36:28 -06:00
Behdad Esfahbod
3fbac0942d
[cff1] Lazy-load & sort glyph names
...
Improves subset benchmarks by up to 70% for small CFF1 subset of
non-CID fonts!
BM_subset/subset_glyphs/SourceSansPro-Regular.otf/10 -0.7067 -0.7071 1 0 1 0
BM_subset/subset_glyphs/SourceSansPro-Regular.otf/64 -0.4817 -0.4824 1 0 1 0
BM_subset/subset_glyphs/SourceSansPro-Regular.otf/512 -0.1948 -0.1956 2 2 2 2
BM_subset/subset_glyphs/SourceSansPro-Regular.otf/2000 -0.0767 -0.0761 6 6 6 6
2022-05-16 16:36:28 -06:00
Behdad Esfahbod
b58bfd9818
[font] Minor move of code to silence gcc-12 warning
...
See mailing list discussion.
2022-05-16 11:21:45 -06:00
Behdad Esfahbod
602e0ca79d
[cff] Minor restructure of struct
...
Surprisingly this shows tiny benchmark improvement consistently.
2022-05-16 10:14:34 -06:00
Behdad Esfahbod
acdab17ed3
[cff] Cosmetic in parsed_values_t
2022-05-13 14:14:36 -06:00
Behdad Esfahbod
b46c7faa9c
[cff] Check buf_len, not buf
...
Ouch!
2022-05-13 14:02:54 -06:00
Garret Rieger
19a8db8545
[subset] fix potential integer overflow in gname_t::cmp.
2022-05-13 13:55:39 -06:00
Behdad Esfahbod
2d2f66e1a3
[cff-common] In INDEX, return empty bytes if length is zero
...
Before it was possible to return non-null arrayZ.
2022-05-13 13:53:17 -06:00
Behdad Esfahbod
a2f132f1fc
[cff] Check glyph-name's length, not arrayZ
...
As the latter can be non-null while still zero-length.
2022-05-13 13:49:39 -06:00
Thomas Devoogdt
c657c4e1f8
[meta] fix type traits on gcc 4.9 #3526
...
Signed-off-by: Thomas Devoogdt <thomas.devoogdt@barco.com>
2022-05-13 11:26:12 -06:00
Behdad Esfahbod
e61234c5f7
[vector] Add tests for move constructor/assignment
2022-05-12 13:20:10 -06:00
Behdad Esfahbod
7fa580bc4f
[map] Fix map copy/move constructors to actually work
...
Ouch!
2022-05-12 13:05:32 -06:00
Behdad Esfahbod
a09dd87ca3
[set] Fix set copy/move constructors to actually work
...
Ouch!
2022-05-12 12:58:07 -06:00
Behdad Esfahbod
76fc27713f
[vector] Remove explicit std::move
...
Was confusing compilers. Let them figure it out themselves.
Makes NotoNastaliqu subsetting/1000 benchmark more than twice faster:
Benchmark Time CPU Time Old Time New CPU Old CPU New
------------------------------------------------------------------------------------------------------------------------------------------------------------
BM_subset/subset_glyphs/NotoNastaliqUrdu-Regular.ttf/1000 -0.5064 -0.5065 111 55 110 55
BM_subset/subset_codepoints/NotoNastaliqUrdu-Regular.ttf/1000 -0.5494 -0.5493 132 59 131 59
2022-05-12 12:14:07 -06:00
Behdad Esfahbod
c81198b5bc
[set] Tweak move operators a bit
...
Should be equivalent.
2022-05-12 12:14:02 -06:00
Behdad Esfahbod
175319cd89
[gsubgpos] Clean up OT::ClassDefFormat2::intersected_class_glyphs 0 case
2022-05-11 13:47:17 -06:00
Behdad Esfahbod
137af3612b
[gsubgpos] Simplify OT::ClassDefFormat2::intersected_class_glyphs()
2022-05-11 13:39:30 -06:00
Behdad Esfahbod
3261e05bdb
[subset] Optimize ClassDef1::intersected_class_glyphs() for class0
2022-05-11 13:16:31 -06:00
Behdad Esfahbod
c78d8ba60b
[subset] Allocate same size as source table for GSUB/GPOS/name
2022-05-11 13:05:41 -06:00
Behdad Esfahbod
2e7f1ae48f
[subset] Use vector.allocated size instead of tracking buf_size
2022-05-11 12:52:27 -06:00
Behdad Esfahbod
f08537963b
[cff-subset] Pre-alloc vector for operator decoding
2022-05-11 12:14:49 -06:00
Behdad Esfahbod
aeb50b8942
[subset] Retain buffer across table subset operations
2022-05-11 12:14:49 -06:00
Behdad Esfahbod
bff78e6515
[cff] Convert interpretation environment to use constructor
2022-05-10 16:50:38 -06:00
Behdad Esfahbod
de053e2efb
[cff] Convert subr_subset_param_t to use constructor
2022-05-10 16:17:20 -06:00
Behdad Esfahbod
96140db485
[cff] Convert cff2_extents_param_t to use constructor
2022-05-10 16:17:20 -06:00
Behdad Esfahbod
54544f2a57
[cff] Convert cff1_extents_param_t to use constructor
2022-05-10 16:17:20 -06:00
Behdad Esfahbod
377befd0c7
[cff] Convert get_seac_param_t to use constructor
2022-05-10 16:17:20 -06:00
Behdad Esfahbod
8fd70362fa
[cff] Use hb_ubytes_t() instead of Null(hb_ubytes_t)
2022-05-10 16:17:20 -06:00
Behdad Esfahbod
9033c7f99d
[cff-common] Optimize INDEX::operator[]
...
Previous try showed slowdown in benchmarks, suprisingly.
Rewrite it keeping the function, hopefully allowing better optimization.
2022-05-10 14:58:53 -06:00
Behdad Esfahbod
3aace2431b
Revert "[cff-common] Optimize INDEX::operator[]"
...
This reverts commit 9edb03ac7a
.
2022-05-10 14:54:04 -06:00
Behdad Esfahbod
b31ef081db
Revert "[cff] Add an unlikely()"
...
This reverts commit 9ba9adb7ed
.
This shows slowdown in benchmarks.
2022-05-10 14:52:40 -06:00
Behdad Esfahbod
9ba9adb7ed
[cff] Add an unlikely()
2022-05-10 14:43:00 -06:00
Behdad Esfahbod
9edb03ac7a
[cff-common] Optimize INDEX::operator[]
2022-05-10 14:43:00 -06:00
Behdad Esfahbod
0a42410dc8
[cff2] Change extents/shape stack to be just a number
...
Do the blending immediately.
Fixes https://github.com/harfbuzz/harfbuzz/issues/3559
Benchmark on AdobeVFPrototype shows 35% speedup. Now we're faster
than FreeType:
Benchmark Time CPU Time Old Time New CPU Old CPU New
------------------------------------------------------------------------------------------------------------------------------------------------
BM_Font/glyph_extents/AdobeVFPrototype.otf/hb -0.3792 -0.3792 1584 983 1581 982
BM_Font/glyph_extents/AdobeVFPrototype.otf/ft +0.0228 +0.0224 1220 1248 1218 1245
BM_Font/glyph_extents/AdobeVFPrototype.otf/var/hb -0.3513 -0.3518 1616 1048 1613 1046
BM_Font/glyph_extents/AdobeVFPrototype.otf/var/ft +0.0172 +0.0169 1232 1254 1230 1251
2022-05-10 13:41:12 -06:00
Garret Rieger
8f9f0c494b
[subset] Enforce cmap12 group ordering constraints in collect_mapping.
...
Fixes fuzzer issue: https://oss-fuzz.com/testcase-detail/6365271012540416
2022-05-10 12:15:09 -06:00
Behdad Esfahbod
1b14d2ff13
[cff] Fix arg-stack peek() impl
2022-05-09 18:15:31 -06:00
Behdad Esfahbod
6106ef8c0f
[cff] Tighten up arg-stack access
2022-05-09 18:15:11 -06:00
Behdad Esfahbod
8c616a6efe
[cff] Allocate stack inline instead of using hb_vector_t
...
Speeds up glyph_extents and glyph_shape benchmarks for CFF by 10
to 16 percent!
2022-05-09 17:50:59 -06:00
Behdad Esfahbod
c941ece60f
[cff] Use using instead of typedef
2022-05-09 17:34:58 -06:00
Behdad Esfahbod
64d63cebe2
[cff-common] Use existing types for str_buff_vec_t
2022-05-09 17:34:58 -06:00
Behdad Esfahbod
e1838ec1f8
[cff-common] Remove unused method
2022-05-09 17:34:58 -06:00
Behdad Esfahbod
8aa54aaca2
[cff] Replace byte_str_t with hb_bytes_t use
2022-05-09 17:34:58 -06:00
Behdad Esfahbod
fe1d85a55a
[cff] Remove custom byte_str_t impl
2022-05-09 17:34:58 -06:00
Behdad Esfahbod
c8a5f1e3c0
[cff-common] Indent
2022-05-09 17:34:58 -06:00
Behdad Esfahbod
be7b2905cb
[cff-common] Remove unused INDEX::serialize() method
2022-05-09 17:34:58 -06:00
Behdad Esfahbod
60390169b6
[cff-common] Write str_buf_t::total_size() as dagger
2022-05-09 17:34:58 -06:00
Behdad Esfahbod
258afb45b7
[cff-common] Use range-based loop in str_buff_vec_t
2022-05-09 17:34:58 -06:00
Behdad Esfahbod
8bb1a3ce9a
[cff-common] Write INDEX offset-size calc using hb_bit_storage()
2022-05-09 17:34:58 -06:00
Behdad Esfahbod
2ccfe84eff
[cff-common] Add assert to INDEX::set_offset_at()
2022-05-09 17:34:58 -06:00
Behdad Esfahbod
4bcab9e99a
[cff-common] Use byte_str_t() instead of Null(byte_str_t)
2022-05-09 17:34:58 -06:00
Behdad Esfahbod
94f7a26322
[cff-common] Fix get_size() for Null object
...
The special-casing didn't make sense.
2022-05-09 17:34:58 -06:00
Behdad Esfahbod
c9cc7d5d21
[cff-common] Inline once-used method in INDEX
2022-05-09 17:34:58 -06:00
Behdad Esfahbod
11482a3a39
[cff-common] Remove unused method from INDEX
2022-05-09 17:34:58 -06:00
Behdad Esfahbod
d1bb3b08f6
[cff-common] Hide more INDEX internals
2022-05-09 17:34:58 -06:00
Behdad Esfahbod
d3b21387fd
[cff-common] Remove redundant operator implementation
2022-05-09 17:34:58 -06:00
Behdad Esfahbod
a96b408d80
[cff-common] Hide INDEX internals
2022-05-09 17:34:58 -06:00
Behdad Esfahbod
335b1d83cf
[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.
2022-05-09 17:34:58 -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
Behdad Esfahbod
2884eb97bf
[cff-common] Remove special-casing of count=0 in INDEX serialize
...
The generic code-path now can handle count=0.
2022-05-06 13:33:13 -06:00
Behdad Esfahbod
fc7f51aece
[cff-common] Reduce iterator calls
2022-05-06 13:33:13 -06:00
Behdad Esfahbod
c857b8e3c6
[cff-common] Set INDEX min_size to 2
...
That is what it is, for an empty INDEX.
2022-05-06 13:33:13 -06:00
Behdad Esfahbod
dd71d2c1c3
[gvar] Protect against offset underflow
2022-05-06 13:02:26 -06:00
Behdad Esfahbod
9a6dabd61a
[gvar] Remove sanitize check for data array
...
We are not checking in sanitize that offset array is ascending,
so this check was bogus.
2022-05-06 12:43:45 -06:00
Behdad Esfahbod
38478d1061
[gvar] DEFINE_SIZE_ARRAY instead of DEFINE_SIZE_MIN
2022-05-06 12:43:45 -06:00
Behdad Esfahbod
90d278c92e
[gvar] Remove requirement that num_glyphs matches the font's
2022-05-06 12:43:45 -06:00
Behdad Esfahbod
ca8a0f3ea3
[gvar] Protect against out-of-range access
...
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=47281
Fixes https://oss-fuzz.com/testcase-detail/5508865908670464
2022-05-06 11:54:38 -06:00
Behdad Esfahbod
f10ddb8dd8
[cmap] Use -1 as Unicode sentinel, not U+FFFF in Format12 serialize
2022-05-05 11:21:24 -06:00
Behdad Esfahbod
8a19968c8b
[cmap] Use iterator bool operator
2022-05-05 11:17:23 -06:00
Behdad Esfahbod
8bfeea4828
[subset] Compute set max using previous()
2022-05-05 11:13:57 -06:00
Behdad Esfahbod
00cb8c629d
[subset] Don't go into glyf table if it's empty
2022-05-05 11:13:57 -06:00
Behdad Esfahbod
4fe69bc413
[subset] Use del_range in _remove_invalid_gids
2022-05-05 11:13:57 -06:00
Behdad Esfahbod
2a42edccbe
[subset] Cosmetic; use set bulk array population instead of for loop
2022-05-05 10:35:54 -06:00
Behdad Esfahbod
43938ecdc2
[subset] Remove outdated comment
...
I tried something like that. It was slower because of the allocations.
2022-05-04 16:59:28 -06:00
Behdad Esfahbod
50db78ba83
[subset] In cmap planning, remove a qsort()
2022-05-04 16:18:27 -06:00
Behdad Esfahbod
052812b6ba
Merge pull request #3561 from googlefonts/cmap_opt
...
[subset] Further cmap subsetting speed optimizations
2022-05-04 15:38:30 -06:00
Garret Rieger
7cb36e4222
[subset] Re-introduce size threshold in choosing unicode collection method.
...
Threshold is needed since the unicodes set might be an inverted set.
2022-05-04 21:22:26 +00:00
Garret Rieger
42c54eba83
[subset] Presize unicode to gid list to unicodes + glyphs size.
2022-05-04 20:21:43 +00:00
Garret Rieger
7c7c01d28c
[subset] Remove switch to alternate unicode collection at large subset sizes.
...
Benchmarks show that the first path is always faster even at large subset sizes:
BM_subset_codepoints/subset_roboto/10_median +0.0324 +0.0325 0 0 0 0
BM_subset_codepoints/subset_roboto/64_median +0.0253 +0.0255 0 1 0 1
BM_subset_codepoints/subset_roboto/512_median +0.0126 +0.0128 1 1 1 1
BM_subset_codepoints/subset_roboto/4000_median +0.0500 +0.0491 6 7 6 7
BM_subset_codepoints/subset_amiri/10_median +0.0338 +0.0332 1 1 1 1
BM_subset_codepoints/subset_amiri/64_median +0.0238 +0.0234 1 1 1 1
BM_subset_codepoints/subset_amiri/512_median +0.0066 +0.0063 8 8 8 8
BM_subset_codepoints/subset_amiri/4000_median -0.0011 -0.0012 13 13 13 13
BM_subset_codepoints/subset_noto_nastaliq_urdu/10_median +0.0226 +0.0226 0 0 0 0
BM_subset_codepoints/subset_noto_nastaliq_urdu/64_median +0.0047 +0.0044 20 20 20 20
BM_subset_codepoints/subset_noto_nastaliq_urdu/512_median +0.0022 +0.0021 165 166 165 166
BM_subset_codepoints/subset_noto_nastaliq_urdu/1000_median -0.0021 -0.0023 166 166 166 165
BM_subset_codepoints/subset_noto_devangari/10_median +0.0054 +0.0054 0 0 0 0
BM_subset_codepoints/subset_noto_devangari/64_median +0.0024 +0.0019 0 0 0 0
BM_subset_codepoints/subset_noto_devangari/512_median +0.0089 +0.0090 5 5 5 5
BM_subset_codepoints/subset_noto_devangari/1000_median -0.0028 -0.0019 5 5 5 5
BM_subset_codepoints/subset_mplus1p/10_median +0.0001 +0.0002 0 0 0 0
BM_subset_codepoints/subset_mplus1p/64_median +0.0073 +0.0075 1 1 1 1
BM_subset_codepoints/subset_mplus1p/512_median +0.0034 +0.0034 1 1 1 1
BM_subset_codepoints/subset_mplus1p/4096_median -0.1248 -0.1248 7 6 7 6
BM_subset_codepoints/subset_mplus1p/10000_median -0.0885 -0.0885 13 12 13 12
BM_subset_codepoints/subset_notocjk/10_median +0.0031 +0.0032 2 2 2 2
BM_subset_codepoints/subset_notocjk/64_median -0.0010 -0.0010 2 2 2 2
BM_subset_codepoints/subset_notocjk/512_median -0.0023 -0.0023 9 9 9 9
BM_subset_codepoints/subset_notocjk/4096_median -0.1725 -0.1726 28 23 28 23
BM_subset_codepoints/subset_notocjk/32768_median -0.0277 -0.0287 140 137 140 136
BM_subset_codepoints/subset_notocjk/100000_median -0.0929 -0.0926 162 147 162 147
2022-05-03 22:45:39 +00:00
Garret Rieger
f0c04114bc
[subset] Embed unicode to gid list vector in subset plan.
2022-05-03 22:02:59 +00:00
Behdad Esfahbod
15fa8afb21
Add fast-path for big-endian 32-bit byteswap
...
Speeds up cmap format-12 decoding by some 40% as measured by
the newly added test in perf/benchmark-font!
2022-05-02 16:46:41 -06:00
Behdad Esfahbod
3fff2e9182
[perf/benchmark-font] Cosmetic
2022-05-02 16:42:10 -06:00
Behdad Esfahbod
307d2d8bb6
[cmap] Sprinkle some 'unlikely's
2022-05-02 16:30:22 -06:00
Garret Rieger
85ec5cbcef
[subset] In _populate_unicodes_to_retain populate unicodes in order.
...
Allows the set insert to take advantage of page lookup cache.
2022-05-02 22:29:43 +00:00
Garret Rieger
088133d939
[subset] cache cp to new gid list in subset plan.
...
This avoids having to recompute the ordered list multiple times during cmap generation.
2022-05-02 21:29:16 +00:00
Garret Rieger
6922a2561f
[subset] Change serialize_rangeoffset_glyid back to using iterator.
2022-04-29 23:30:32 +00:00
Garret Rieger
c66fd50c26
[subset] in cmap4 serialization save cp to gid iter to memory.
...
Iterator accesses are slow and it's iterated multiple times.
2022-04-29 23:18:53 +00:00
Garret Rieger
17b98563dc
[subset] In cmap4 serialization reduce unnessecary calls into the iterator.
...
Gives ~20% speedup for large subsets.
2022-04-29 22:49:02 +00:00
Garret Rieger
5e241094bf
[subset] In unicodes cache cleanup if set insert fails.
2022-04-29 22:45:16 +00:00
Garret Rieger
a424a92ce5
[subset] s/void */intptr_t.
2022-04-29 22:14:03 +00:00
Garret Rieger
aad67f5629
[subset] cache results of collect_unicodes.
2022-04-29 22:05:34 +00:00
Garret Rieger
b4236b7de6
[subset] Optimize Cmap4 collect_unicodes.
...
Use set add_range() instead of individual add() calls.
2022-04-29 19:22:00 +00:00
Behdad Esfahbod
067225a86d
[set] Optimize const page_for() using last_page_lookup caching
...
Similar to previous commit.
This speeds up SetLookup benchmark by 50%, but that's because that
lookup always hits the same page...
2022-04-29 13:04:36 -06:00
Behdad Esfahbod
c283e41ce3
[set] Optimize non-const page_for() using last_page_lookup caching
...
This speeds up SetOrderedInsert tests by 15 to 40 percent, and the
subset_mplus1p benchmarks by 9 to 27 percent.
2022-04-29 12:45:48 -06:00
Behdad Esfahbod
d8292b8446
[CFF] Fix parsing of empty Index
...
https://github.com/harfbuzz/harfbuzz/issues/3545#issuecomment-1111047941
2022-04-27 12:38:35 -06:00
David Corbett
6454cec085
[USE] Classify U+10A38 as CONS_MOD_BELOW
2022-04-24 11:41:32 -06:00
Khaled Hosny
f7aee78e90
4.2.1
2022-04-24 05:47:57 +02:00
Behdad Esfahbod
6695bf0560
[gsubgpos] Remove wrong condition in Context application
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/3545
2022-04-22 13:48:41 -06:00
Behdad Esfahbod
8575a8f50c
Add _hb_codepoint_is_regional_indicator()
2022-04-21 11:15:34 -06:00
Behdad Esfahbod
c1ee7d28f3
Typo
...
Co-authored-by: Khaled Hosny <khaled@aliftype.com>
2022-04-21 11:15:34 -06:00
Behdad Esfahbod
4d48fae4f2
Enforce Regional_Indicators native direction to LTR
...
And undo the morx direction reversal change introduced in
https://github.com/harfbuzz/harfbuzz/pull/3315
23159084b4
This fixes original bug https://github.com/harfbuzz/harfbuzz/issues/3314
And the reversion in morx code fixes regressions:
https://github.com/harfbuzz/harfbuzz/issues/3528
https://github.com/harfbuzz/harfbuzz/issues/3535
Supersedes:
https://github.com/harfbuzz/harfbuzz/pull/3529
2022-04-21 11:15:34 -06:00
Behdad Esfahbod
a85461b9b6
Add link to Context LookupFlag discussion
...
https://github.com/harfbuzz/harfbuzz/discussions/3538
2022-04-20 12:13:40 -06:00
Simon Cozens
9e59c401e0
[myanmar] Reword confusing comment about masks
2022-04-20 11:25:15 -06:00
Behdad Esfahbod
903cf8cfce
[check-static-inits] Unbreak test
2022-04-13 15:31:51 -06:00
Behdad Esfahbod
ec925ece05
[khmer] Reinstate a pause after basic features
...
This was removed as part of 044d7a06db
,
which caused the regression. Just adding a pause fixes the shaping.
Debugged by just tracing the good/bad shaping and observing the
lookup orders intermingling in the bad shaping.
Test:
hb-shape LeelawUI.ttf --unicodes U+1780,U+17D2,U+179A,U+17BB
Fixes https://github.com/harfbuzz/harfbuzz/issues/3531
2022-04-13 11:54:08 -06:00
Khaled Hosny
88bb746b42
[blob] Return nullptr from create_from_file_or_fail
...
Fix a couple of cases where it would return empty blob, possibly
missed in bdfed8f113
.
2022-04-01 02:38:23 +02:00
Behdad Esfahbod
b179d357a9
[main] Fix unused-variable warnings
2022-03-30 12:59:52 -06:00
Khaled Hosny
9d5730b958
4.2.0
2022-03-30 15:08:34 +02:00
Behdad Esfahbod
044d7a06db
[indic-like] Add per-lookup per-syllable flag
...
This allows mix-and-matching per-syllable and other lookups.
In fact, removes the clear-syllables call completely.
Fixes https://github.com/harfbuzz/harfbuzz/issues/3513
2022-03-28 17:39:54 -06:00
Behdad Esfahbod
61486746d3
Revert "[indic] Clear syllables before presentation features"
...
This reverts commit 90f09b1e87
.
This regressed Indic shaping. See:
https://github.com/harfbuzz/harfbuzz/issues/3513
2022-03-28 15:57:07 -06:00
Behdad Esfahbod
e8f3397f4e
[matcher] Simplify syllable initialization
2022-03-28 13:23:37 -06:00
Behdad Esfahbod
94f5c630fc
[aat] Remove morx deleted-glyphs before GPOS processing
...
Fixes new Apple Color Emoji glyphs sequences rendering.
Fixes https://github.com/harfbuzz/harfbuzz/issues/3512
2022-03-28 13:10:56 -06:00
David Corbett
0dcbdbde9c
[indic] Categorize U+0D04 as Consonant_Placeholder
2022-03-26 21:02:08 -06:00
Behdad Esfahbod
a665e29ed7
[use] Avoid O(n^2) in the machine
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/3502
2022-03-25 15:17:55 -06:00
Behdad Esfahbod
ccd9161bfd
[apply-lookup] Try to fix the logic for contextual lookups
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/1611
Notably, this fixes Myles's AdditionFont:
https://litherum.blogspot.com/2019/03/addition-font.html
Test with AdditionFont, eg.:
$ util/hb-view AdditionFont.otf =1112112+1113134=
2022-03-25 15:14:40 -06:00
Behdad Esfahbod
fa15fc44bb
[subset] Require exact harfbuzz version in .pc file
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/1446
2022-03-25 15:00:36 -06:00
Behdad Esfahbod
b619b05f39
[subset] Adjust name in .pc file
2022-03-25 15:00:36 -06:00
Khaled Hosny
1229078660
[set] Fix annotation
2022-03-25 22:41:25 +02:00
Behdad Esfahbod
3a78cf92c8
[gvar] Fix decoding of private vs shared points
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/3506
2022-03-25 13:25:28 -06:00
Behdad Esfahbod
a02fb4a0dc
[glyf] Don't bail rendering glyf even if gvar failed
...
Part of https://github.com/harfbuzz/harfbuzz/issues/3506
2022-03-25 13:25:28 -06:00
Behdad Esfahbod
0a38878549
[set] Minor touch-up on the previous commit
2022-03-25 09:42:36 -06:00
Andrew John
0182988229
[set] Add call to export set contents to an array. ( #3500 )
...
[set] Add hb_set_next_many.
2022-03-25 09:36:44 -06:00
aneejit1
a55a42444d
Meson build writes to the source directory (issue #3507 ) ( #3508 )
...
Don't write to source directory if files did not change
Remove writes to the source directory which cause a meson build failure
if the source directory is read-only.
https://github.com/harfbuzz/harfbuzz/pull/3508
2022-03-24 14:16:41 -06:00
Behdad Esfahbod
bf2a845a17
[ot-layout] Comment
2022-03-24 13:09:53 -06:00
Behdad Esfahbod
a792e16e48
[ot-layout] Change max nesting level of lookups from 6 to 64
2022-03-24 13:08:51 -06:00
Garret Rieger
444c2375a1
[reorg] Use relative includes for hb-ot-layout-gsubgpos.hh
2022-03-23 18:05:24 -06:00
Garret Rieger
b342adeb96
[reorg] Move GSUB into OT::Layout::GSUB namespace.
2022-03-23 18:05:24 -06:00
Garret Rieger
a9910e258f
[reorg] Move SubstLookup and GSUB into the new layout.
2022-03-23 18:05:24 -06:00
Garret Rieger
90af2143d5
[reorg] Move ReverseChainSingleSubst to new layout.
2022-03-23 18:05:24 -06:00
Garret Rieger
403feb3804
[reorg] Move LigatureSubst to new layout.
2022-03-23 18:05:24 -06:00
Garret Rieger
6a369389d6
[reorg] Move AlternateSubst to new layout.
2022-03-23 18:05:24 -06:00
Garret Rieger
dea0681db2
[reorg] Move MultipleSubst into new layout.
2022-03-23 18:05:24 -06:00
Behdad Esfahbod
7243bf3e41
[reorg] Use relative include
2022-03-23 18:05:24 -06:00
Behdad Esfahbod
c180f93766
[reorg] Move sanitize/dispatch and size macros to top
2022-03-23 18:05:24 -06:00
Garret Rieger
f577d02f4a
[reorg] Fix check-* scripts to work with sources files in directories.
2022-03-23 18:05:24 -06:00
Garret Rieger
3ef180db44
[reorg] Move SingleSubst opentype fields to top of the classes.
2022-03-23 18:05:24 -06:00
Garret Rieger
7dfd9e7001
[reorganization] WIP move single substitution into separate files.
2022-03-23 18:05:24 -06:00
Khaled Hosny
c36844d6d9
4.1.0
2022-03-23 07:20:59 +02:00
Behdad Esfahbod
d35c73cd37
[buffer] Whitespace
2022-03-22 13:09:50 -06:00
Behdad Esfahbod
1449498e1d
[ot-font] Vertically center glyph in vertical writing fallback
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/537
2022-03-21 21:40:07 -06:00
Behdad Esfahbod
bf03d7e962
[ot-font] Use ascent+descent for fallback vertical advance
...
This matches what FreeType does.
Part of fixing https://github.com/harfbuzz/harfbuzz/issues/537
2022-03-21 21:27:31 -06:00
Behdad Esfahbod
df42d28d18
[hmtx] Change default advance for horizontal direction to upem/2 again
2022-03-21 21:17:15 -06:00
Behdad Esfahbod
6d0e67dee0
[ot-font] Only use vmtx side-bearing if table exists
...
Part of fixing https://github.com/harfbuzz/harfbuzz/issues/537
2022-03-21 21:07:28 -06:00
Behdad Esfahbod
f41945e313
[cmap] In collect_unicodes() of format 12/13, limit to max Unicode
...
Fixes fuzzer timeout:
https://oss-fuzz.com/testcase-detail/5062368881672192
2022-03-21 18:24:30 -06:00
Behdad Esfahbod
03085132ba
[buffer] Fix out-buffer under memory-alloc failure
...
This was broken in July refactoring of the buffer, and exposed to
ReverseChainSingleSubstFormat1 in 3807061d63
Fixes:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38800
https://bugs.chromium.org/p/chromium/issues/detail?id=1303552
2022-03-21 18:09:06 -06:00
Khaled Hosny
116cc69236
[set] Fix documentation
2022-03-22 00:15:23 +02:00
Behdad Esfahbod
90f09b1e87
[indic] Clear syllables before presentation features
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/3488
2022-03-21 15:42:08 -06:00
Behdad Esfahbod
4289684cdb
[set] Fix-up previous commits
2022-03-21 15:37:05 -06:00
Andy John
1176620ba4
Move fn, fix doc.
2022-03-21 15:32:59 -06:00
Andy John
7d802994be
Remove null checks.
2022-03-21 15:32:59 -06:00
Andy John
ef588ea97b
Add option to insert a sorted arrays of values to sets.
2022-03-21 15:32:59 -06:00
Andy John
7a1e79c3ba
Fix typo.
2022-03-21 14:34:22 -06:00
Andy John
4ee00f943f
Use bit shifting instead of multiplying and dividing.
2022-03-21 14:34:22 -06:00
Andy John
3125f5ae33
Add log base 2 versions of constants.
2022-03-21 14:34:22 -06:00
Behdad Esfahbod
1ffe637a0e
[coretext] Remove dead code
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/3484
2022-03-21 10:37:42 -06:00
TheBluuDot
7bdc20ec81
restores unintended addition in 43be5ba
...
restores two lines in restore in _hb_allocate_lig_id function that were unintentionally deleted in 43be5ba
2022-03-19 15:12:25 -04:00
Qunxin Liu
7cb002cb58
[subset] bug fix in prune_langsys
...
we should not cache visited langsys cause 2 different Record<Langsys>
could have different Tag while pointing to the same Langsys, a langsys
is redundant in Record<Langsys> A does not mean it's redundant in Record
B. Same thing for visited_script.
Also adding the number of features in the LangSys's feature list to the
visited langsys count so it's more accurate.
Plus some improvement in langsys compare()
2022-03-16 13:08:13 -06:00
Behdad Esfahbod
cad2fe8e63
[baseline] Fix HB_NO_METRICS build
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/3482
2022-03-15 10:49:29 -06:00
Behdad Esfahbod
a8a89b80b4
[layout] Whitespace
2022-03-15 10:48:03 -06:00
Behdad Esfahbod
21f5ef56f5
[metrics] Simplify x-height fallback
2022-03-15 10:45:50 -06:00
Behdad Esfahbod
6bf8f0a38f
[baseline] Use ot-metrics fallback API
2022-03-15 10:44:41 -06:00
Dominik Röttsches
965cf1d665
Make load_num_glyphs_from_loca conditional on HB_NO_BORING_EXPANSION
...
Fixes build errors complaining about this function being unused.
2022-03-14 15:16:35 +02:00
David Corbett
49fb8f9072
[USE] Treat visible viramas like dependent vowels
2022-03-13 14:45:27 -06:00
Khaled Hosny
1f79ba9407
4.0.1
2022-03-11 20:19:04 +02:00
Qunxin Liu
a35757c6bc
[repacker] expose hb_subset_repack() API, hb_object_t and hb_link_t structs
2022-03-10 17:26:20 -07:00
Matthias Clasen
e7ab42b246
[layout] Fix handling of baseline variations
...
For BASE table format 1.1, the handling of design
space vs user space coordinates was inconsistent.
We were applying design -> user transformation
twice for the deltas, leading to wrong baseline
values.
Patch by Ebrahim Byagowi <ebrahim@gnu.org>
Fixes : #3476
2022-03-10 09:29:56 -07:00
David Corbett
e5707a440c
Update IANA Language Subtag Registry to 2022-03-02
2022-03-08 13:28:25 -07:00
David Corbett
13bb46cfd5
[USE] Remove obsolete overrides
2022-03-06 16:04:18 -07:00
David Corbett
c33468d48e
[USE] Treat all gc=Cn as independent clusters
2022-03-06 10:44:37 -07:00
David Corbett
e497a8f142
[USE] Remove obsolete symbol/punctuation overrides
2022-03-06 10:44:37 -07:00
David Corbett
854219e056
[USE] Simplify `not_ccs_default_ignorable`
2022-03-06 10:44:37 -07:00
David Corbett
6e059a46b7
[USE] Allow any non-numeric tail in symbol cluster
2022-03-06 10:44:37 -07:00
David Corbett
5b0a59812d
[USE] Restore the category WJ
2022-03-06 10:44:37 -07:00
Florian Pircher
05b3bdb0b3
[aat] Update OT to AAT mappings for hist and vrtr
2022-03-05 20:36:40 -07:00
luz paz
cf3a0f7ab5
Fixed various misc. typos
...
Found via `codespell -q 3 -S ./perf/texts -L actualy,als,ba,beng,clen,crasher,dependant,eachother,fo,gir,inout,ist,nd,ned,ot,pres,ro,statics,te,teh,timne`
2022-03-06 04:59:24 +02:00
Khaled Hosny
8d1b000a3e
4.0.0
2022-03-01 21:27:32 +02:00
Khaled Hosny
6e466256e4
[doc] Typo
2022-03-01 12:01:18 +02:00
Garret Rieger
f6071c16b0
[subset] Rename codepoint -> unicode in subset plan api
2022-02-28 23:45:40 +02:00
Khaled Hosny
1b5a2e0809
[doc] Various fixes to newly added documentation
2022-02-28 10:11:42 -07:00
Behdad Esfahbod
222301bfa4
Merge pull request #3429 from harfbuzz/external_plan
...
[subset] expose subset plan in public subsetting API
2022-02-24 12:55:01 -07:00
Behdad Esfahbod
651c280d0b
[style] Move the negation into the constant
2022-02-18 18:21:46 -06:00
Matthias Clasen
16b232be0e
[hb-style] Fix the sign of slant ratios
...
We want negative slant angles to yield
positive slant ratios. Fix that.
Test included.
2022-02-18 18:10:34 -06:00
Matthias Clasen
e76061a737
[hb-style] Fix synthetic slant values
...
When reporting the slant ratio of a font
that has synthetic slant set, we were
reporting twice the expected value.
Fix that. Test included.
2022-02-18 17:53:54 -06:00
Behdad Esfahbod
56f11ec938
[buffer] Add HB_BUFFER_FLAG_PRODUCE_UNSAFE_TO_CONCAT
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/3454
2022-02-18 17:52:27 -06:00
Garret Rieger
fc1548cf71
[subset] document return values.
2022-02-17 17:16:31 -08:00
Matthias Clasen
f6efe34f5e
[ot-metrics] Synthesize missing metrics
...
Add a variant of hb_ot_metrics_get_position that
synthesizes missing values.
New api: hb_ot_metrics_get_position_with_fallback
2022-02-17 18:34:59 -06:00
Behdad Esfahbod
f8e9e315bb
Merge pull request #3437 from matthiasclasen/synthesize-missing-baselines
...
[BASE] Synthesize missing baselines
2022-02-17 14:34:46 -06:00
Behdad Esfahbod
8e900f2cda
Revert "hb-algs.hh: Fix build on Visual Studio 2015"
...
This reverts commit 52c536bb8d
.
See https://github.com/harfbuzz/harfbuzz/pull/3448
2022-02-17 13:29:04 -06:00
Matthias Clasen
95bb2ff719
[ot-layout] Add central baselines
...
Add HB_OT_LAYOUT_BASELINE_TAG_IDEO_EMBOX_CENTRAL
and HB_OT_LAYOUT_BASELINE_TAG_IDEO_FACE_CENTRAL
which are the centers of the ideographic em-box
and face box.
2022-02-16 17:37:35 -06:00
Matthias Clasen
f81578fd86
[ot-layout] Synthesize missing baselines
...
Add a variation of hb_ot_layout_get_baseline that
synthesizes missing baselines, using heuristics in part
taken from the CSS Inline Layout Module, Level 3.
Includes some new tests for synthesized baselines.
The base2.ttf is a subset of Noto Sans Bengali that
includes just the Bengali Ka.
New API: hb_ot_layout_get_baseline_with_fallback
2022-02-16 17:37:33 -06:00
Behdad Esfahbod
5de67c8961
[ot-layout] Remove commented-out prototypes
...
Not gonna happen.
2022-02-16 17:08:19 -06:00
Behdad Esfahbod
d2998faad3
Merge pull request #3410 from harfbuzz/boring-expansion
...
[Boring Expansion] >64k loca & hmtx tables
This does two things:
The num-glyphs reported by the face now is the maximum reported by the maxp and that deduced from the length of the loca table; I think this is the right thing to do anyway; According to OpenType such loca tables are invalid.
The interpretation hmtx tables that have excessive bytes at the end, again, invalid according to OpenType, has changed. Previously we were interpreting those excessive bytes as extra lsb values. Now we interpret them as extra advance values, the last of which is repeated for all missing glyphs. Again, these are tables that are invalid according to OpenType, and the advances are for glyph indices beyond maxp table's num-glyphs.
The combined effect is that the font can have shapes and advances for gid's beyond the maxp limit of 64k. In fact, maxp table becomes optional.
2022-02-16 14:37:09 -06:00
Behdad Esfahbod
98079109e6
[ot-layout] Add +hb_ot_layout_get_horizontal_baseline_tag_for_script()
...
New API:
+hb_ot_layout_get_horizontal_baseline_tag_for_script()
2022-02-16 13:54:22 -06:00
Matthias Clasen
9909e33268
Improve docs for hb_ot_layout_get_ligature_carets
...
Add some relevant details to the documentation
for this function.
Fixes : #3168
2022-02-15 18:48:54 -06:00
Behdad Esfahbod
a396543ae1
Merge pull request #3411 from harfbuzz/draw
...
[draw] Finish and release draw API
2022-02-15 18:47:55 -06:00
Behdad Esfahbod
f567b55619
[face] Use max numGlyphs of maxp and loca
2022-02-15 18:26:43 -06:00
Behdad Esfahbod
c8fd8c1337
[ot-face] Use core tables
2022-02-15 18:13:44 -06:00
Behdad Esfahbod
2a430790ad
[machinery] Add "core table" machinery
...
To be used in subsequent commit; or tried anyway.
2022-02-15 17:53:33 -06:00
Behdad Esfahbod
67eb9acf79
[config] Add HB_NO_BORING_EXPANSION
2022-02-15 17:17:49 -06:00
Behdad Esfahbod
8b7ccc41c4
[hmtx] Implement [boring-expansion] >64k expansion
...
This implements https://github.com/be-fonts/boring-expansion-spec/issues/7
2022-02-15 14:15:12 -06:00
Behdad Esfahbod
431c948ed7
[hmtx] Document
2022-02-14 14:13:04 -06:00
Behdad Esfahbod
be4ddcc30b
[hmtx] Rename internal num_advances to num_long_metrics
2022-02-14 14:12:07 -06:00
Behdad Esfahbod
622cbc485f
[hmtx] Internal rename num_metrics to num_bearings
2022-02-14 14:09:40 -06:00
Behdad Esfahbod
ed6d287d11
[ot-face] Load num-glyphs from `loca` table before `maxp`
...
Implements [boring-expansion] [maxp] Relax
https://github.com/be-fonts/boring-expansion-spec/issues/6
2022-02-14 13:52:30 -06:00
Behdad Esfahbod
93962977bc
Remove return of void
2022-02-13 19:38:59 -06:00
Ebrahim Byagowi
d4588204e5
[draw/glyf] Emit empty contours
...
This makes it actually match freetype behaviour even though rasterizer
should filter such contours specially for stroking.
See https://github.com/harfbuzz/harfbuzz/pull/3411#discussion_r802283827 for the context.
2022-02-13 23:50:53 +03:30
Behdad Esfahbod
94517850dd
[algs] Fix typo in hb_pair_t conversion operator
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/2083
2022-02-13 13:39:26 -06:00
Khaled Hosny
f942874fac
[draw] Fix some introspection warnings
2022-02-13 13:21:15 -06:00
Behdad Esfahbod
0858463ac3
[draw/glyf] Don't skip empty contours of size 2
...
See:
https://github.com/harfbuzz/harfbuzz/pull/3411#discussion_r804988217
2022-02-13 13:21:15 -06:00
Behdad Esfahbod
57aa8c3b3a
[draw] Another try at a stable draw moveto semantic
2022-02-13 13:21:15 -06:00
Behdad Esfahbod
151f205819
[draw] Emit move_to immediately, like other operators
2022-02-13 13:21:15 -06:00
Khaled Hosny
628847b5c8
[doc] Link to respective draw callback functions
2022-02-13 13:21:14 -06:00
Khaled Hosny
7245298e25
[doc] Document HB_DRAW_STATE_DEFAULT
2022-02-13 13:21:14 -06:00
Khaled Hosny
8e892bdb54
[doc] Message draw documentation a bit
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
cdf1cb35db
[draw] Destroy callback data
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
c56c13756b
[draw] Document more
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
2376230523
[draw] Flesh out docs a bit
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
bc6c3b8401
[font] Update get_glyph_shape() doc
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
732c749ef7
[font] Adjust synthetic-slant docs
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
59067db9f4
[font/draw] Slant drawings
...
Need to update hb_font_set_synthetic_slant() docs now that we do this.
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
aa5c7a3811
[draw-session] Add slant
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
4f2704adb6
[draw] Add more reserved items to hb_draw_state_t
...
Since these are free basically.
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
2ce19f2868
[font/draw] Fetch shape from parent font if not implemented in font
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
d6b61dff95
[draw] Minor cleanup
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
6d5b998f25
[ft/draw] Implement hb-draw for hb-ft
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
370bec938b
[draw] Rename internal draw_session_t to hb_draw_session_t
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
a357e5d889
[draw] Do quadratic-to-cubic conversion in nil quadratic implementation
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
c681331c3f
[draw] Rename internal draw_helper_t to draw_session_t
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
f1a9a9ccaf
[draw-state] Pass state down to callbacks
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
a9dd9f0bae
[draw] Add public move_to/line_to/... API that take a draw-state
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
ebc2a133c3
[draw] Rename internal methods
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
86fcd4fe98
[draw] Simplify start_path
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
1740916ede
[draw] Remove check for no-op
...
This is unnecessary overhead. Up to rasterizers to handle this. Plus,
this throws off point-numbers in uses that rely on it.
Disabled one test that broke with this.
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
fc78592e67
[draw-state] Add type and use in draw-helper
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
a755f93e8d
[draw] Add TODO
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
cdb1a1fc06
[draw] Add REPLACEME
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
8b4f429000
[draw] Virtualize hb_font_draw_glyph() into hb_font_get_glyph_shape()
...
To be implemented in hb-ft.
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
92e6e53b30
[draw] Rename user_data to draw_data
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
3b915389b5
[draw] Remove unneeded roundf() calls
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
2bed4f46fb
[draw] Fix draw signatures
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
e0ac6c587b
Remove remaining traces of HB_EXPERIMENTAL_API
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
27dfd69fc7
[draw] Another Since: tag update
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
7ac23f4e78
[draw] Whitespace
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
e157b50345
[draw] Remove return value of hb_font_draw_glyph()
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
ddc36df332
[draw] Move hb_font_draw_glyph() to hb-draw-glyph.cc
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
9a1508a2be
[draw] Replace API Since tags with REPLACEME
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
a428c1193c
[main] Fix compiler warnings
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
35190dc961
[draw] Convert API to float instead of hb_position_t
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
d6e49b8278
[font] Add em_fscalef_[xy] That take and return float
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
6c0b65a6a8
[font] Add em_scaleff() that returns float
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
dd7b6e2c3f
[draw] Remove EXPERIMENTAL_API tag
2022-02-13 13:21:14 -06:00
Behdad Esfahbod
7af165dbf0
Fix compiler warning
2022-02-12 21:25:36 -06:00
Khaled Hosny
0a12996134
3.4.0
2022-02-13 00:30:50 +02:00
Khaled Hosny
41815a0d63
[name] Extraneous (out) annotation in return value
2022-02-13 00:00:01 +02:00
Behdad Esfahbod
b263371b09
Merge pull request #3398 from harfbuzz/buffer-verify
...
Add HB_BUFFER_FLAG_VERIFY
2022-02-12 15:06:47 -06:00
Behdad Esfahbod
42b119edb5
[hmtx] Remove other subset-specific method from hmtx accelerator
2022-02-12 14:22:35 -06:00
Behdad Esfahbod
9ba520b5d1
[hmtx] Remove one subset-specific method from hmtx accelerator
...
Looks ugly but is the right thing to do.
2022-02-12 14:22:35 -06:00
Garret Rieger
27a6c895ba
[subset] Fix memory leak in plan creation.
2022-02-11 16:19:43 -08:00
Garret Rieger
670ef070bd
[subset] Change subset plan create to be or_fail.
2022-02-11 16:01:33 -08:00
Garret Rieger
ae8d373bcf
[subset] add subset plan reference, set/get user data functions.
2022-02-11 14:54:23 -08:00
Garret Rieger
b65e48a786
[subset] Add subset plan to public API.
...
Add the ability to create a subset plan which an be used to gather info on things like glyph mappings in the final subset. The plan can then be passed on to perform the subsetting operation.
2022-02-11 14:37:21 -08:00
Behdad Esfahbod
6893723879
[machinery] Allow using lazy-loader with void*
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/3427
2022-02-11 14:28:51 -06:00
Chun-wei Fan
52c536bb8d
hb-algs.hh: Fix build on Visual Studio 2015
...
The compiler does not recognize the std::hash call on
hb_decay<decltype (hb_deref (v)>, so give it a shove so that it is recognized
there.
2022-02-10 13:26:56 -06:00
Alexis King
81754a5a96
[ot-math] Add hb_ot_math_get_glyph_kernings
...
closes #3396
2022-02-09 12:03:07 -06:00
Alexis King
1bc4bad7a5
[ot-tag] Add HB_SCRIPT_MATH (Zmth) and map it to OT ‘math’ tag
...
The ISO 15924 code for mathematical notation is ‘Zmth’, but the
OpenType script is ‘math’.
2022-02-08 12:40:15 -06:00
Khaled Hosny
76cd8a4737
[arabic] Update to AMTRA revision 6
...
https://www.unicode.org/reports/tr53/tr53-6.html#Modifications
2022-02-08 12:38:51 -06:00
Khaled Hosny
ac46c3248e
3.3.2
2022-02-06 15:41:18 +02:00
Behdad Esfahbod
88798ee8be
[GPOS] Disable split-kerning
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/3408
Reverts https://github.com/harfbuzz/harfbuzz/pull/3235
Fixes https://github.com/harfbuzz/harfbuzz/pull/3235#issuecomment-1029814978
2022-02-04 19:01:57 -06:00
Behdad Esfahbod
9177953720
[atexit] Allow hb_atexit redefinition
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/3412
2022-02-04 12:38:45 -06:00
Behdad Esfahbod
8670ffbf4c
[buffer] Comment
2022-02-03 11:19:23 -06:00
Behdad Esfahbod
e59da2871a
[glyf] Don't store face in accelerator
2022-02-01 16:32:39 -06:00
Khaled Hosny
45df259538
3.3.1
2022-01-31 23:06:10 +02:00
Garret Rieger
4e2f409bce
[subset] Don't hold references to members of the active_glyph_stack.
...
These references may get invalidated after the vector for the stack is resized. Fixes: https://oss-fuzz.com/testcase-detail/5422577634377728
2022-01-31 22:58:53 +02:00
Khaled Hosny
98da330638
3.3.0
2022-01-31 18:39:06 +02:00
David Corbett
ae9afd9772
Let BCP 47 tag "mo" fall back to OT tag 'ROM '
2022-01-30 14:32:59 -05:00
David Corbett
a184c5f851
Don’t always inherit from macrolanguages
...
If an OpenType tag maps to a BCP 47 macrolanguage, that is presumably to
support the use of the macrolanguage as a vague stand-in for one of its
individual languages. For example, "ar" and "zh" are often used for
"arb" and "cmn". When the OpenType tag maps to a macrolanguage and some
but not all of its individual languages, that indicates that the
OpenType tag only corresponds to the listed individual languages (which
may be referred to using the macrolanguage subtag) but not the missing
individual languages. In particular, INUK (Nunavik Inuktitut) is mapped
to "ike" (Eastern Canadian Inuktitut) and "iu" (Inuktitut) but not to
"ikt" (Inuinnaqtun), so "ikt" should not inherit the INUK mapping from
its macrolanguage "iu".
2022-01-30 13:28:23 -05:00
Behdad Esfahbod
b47b3b9972
[fallback-kern] Move buffer message to correct position
2022-01-29 10:24:38 -07:00
Behdad Esfahbod
e986c12075
[verify] Show buffer input text when verification fails
2022-01-29 09:08:48 -07:00
Behdad Esfahbod
3972e0a8f1
[buffer] Whitespace
2022-01-29 08:22:19 -07:00
David Corbett
0b1bf89cc2
Replace “[family]” with “[collection]”
...
Not all language collections are language families.
2022-01-29 10:15:23 -05:00
David Corbett
0e31595e0d
Infer tag mappings for unregistered macrolanguages
...
Every macrolanguage not mentioned in the OT language system tag registry
is mapped to every tag of its individual languages, if those have
registered tags.
2022-01-29 10:15:23 -05:00
David Corbett
5a6545940a
Add the language system tag INUK
2022-01-28 21:29:43 -05:00
Garret Rieger
bc899650c7
[subset] Fix for issue #3397 .
...
cur_intersected_glyphs gets modified during recursion leading to incorrect filtering of sub tables in some cases. So don't use cur_intersected_glyphs. Instead just add an additional entry onto the parent_active_glyphs () stack.
Additionaly expands NotoNastaliqUrdu tests to include coverage of the issue from #3397 .
2022-01-28 14:20:33 -08:00
Garret Rieger
f3c1f4f0da
[subset] convert active_glyphs_stack to be a vector of hb_set_t instead of hb_set_t*.
2022-01-28 14:20:33 -08:00
Behdad Esfahbod
476a6377a5
[buffer] Document HB_BUFFER_FLAG_VERIFY
2022-01-28 15:05:10 -07:00
Behdad Esfahbod
5b1d813b69
[config] Enable HB_NO_BUFFER_VERIFY in HB_LEAN
2022-01-28 13:53:44 -07:00
Behdad Esfahbod
61823838f9
[buffer] Add HB_BUFFER_FLAG_VERIFY
...
Move buffer verification code inside the library, from util/.
Part of https://github.com/harfbuzz/harfbuzz/issues/3010
2022-01-28 13:53:44 -07:00
Behdad Esfahbod
7c704d8982
[buffer] Make hb_buffer_append() take a const argument
2022-01-28 13:53:44 -07:00
Behdad Esfahbod
24650624c8
[font] Fix build with no-var configs
2022-01-28 13:53:21 -07:00
Behdad Esfahbod
91b779e23c
Avoid redefinition of HB_NO_SETLOCALE in certain configs
2022-01-28 13:52:15 -07:00
Khaled Hosny
fa29006bfa
[doc] Fix generation of hb_glyph_flags_t docs
...
GTK-Doc does not like the empty lines here, and interprets everything
after the first empty line as the description of the enum itself not a
specific member and the generated text makes no sense.
Removing the empty lines makes the text harder to read (both in source
and HTML), but at least it is correctly organized.
2022-01-26 19:10:23 -08:00
Behdad Esfahbod
e9cc5f6cdb
Merge pull request #3297 from harfbuzz/unsafe-to-concat
...
Implement UNSAFE_TO_CONCAT flag
2022-01-26 12:23:29 -08:00
Behdad Esfahbod
540af548dc
[unsafe-to-concat] Clarify documentation as per feedback
...
Fixes https://github.com/harfbuzz/harfbuzz/pull/3297#discussion_r754395825
2022-01-25 09:10:56 -07:00
Behdad Esfahbod
bad5c94562
[test] Remove HB_UNUSED
2022-01-23 10:53:19 -07:00
Behdad Esfahbod
6c09a8b5b0
[test-serialize] Assert len
2022-01-23 10:52:13 -07:00
Behdad Esfahbod
76c6f4164f
[test] Add test-serialize
2022-01-23 10:43:37 -07:00
Behdad Esfahbod
3324606492
[buffer] Oops
2022-01-22 15:46:13 -07:00
Behdad Esfahbod
20031ddbb8
[unsafe-to-concat] Mark in all other shapers
...
unsafe_to_break() implies unsafe-to-concat; but setting the flag
manually wasn't.
2022-01-22 11:53:18 -07:00
Behdad Esfahbod
6e345f709d
Cosmetic
2022-01-22 11:53:18 -07:00
Behdad Esfahbod
374a6f186d
[fallback-shape] Add buffer trace log
2022-01-22 11:53:18 -07:00
Behdad Esfahbod
bcdfedbc09
[unsafe-to-concat] Mark as unsafe in kern machine
...
Fixes that last test. Yay!
2022-01-22 11:53:18 -07:00
Behdad Esfahbod
14d43d1235
[unsafe-to-concat] Adjust end conditions
2022-01-22 11:53:18 -07:00
Behdad Esfahbod
8663eda4fd
[unsafe-to-concat] More annotations for MarkMarkPos
...
Failures down to one:
265/401 harfbuzz:shaping+aots / lookupflag_ignore_attach FAIL
2022-01-22 11:53:18 -07:00
Behdad Esfahbod
6a7d6d4b64
[unsafe-to-concat] More annotations for MarkLigaturePos
2022-01-22 11:53:18 -07:00
Behdad Esfahbod
a575992057
[unsafe-to-concat] Mark LigatureSubst
...
Failures down to two:
209/401 harfbuzz:shaping+aots / gpos6 FAIL 0.06s exit status 1
265/401 harfbuzz:shaping+aots / lookupflag_ignore_attach FAIL 0.06s exit status 1
2022-01-22 11:53:18 -07:00
Behdad Esfahbod
b443898cce
[unsafe-to-concat] Adjust MarkBasePos
...
A couple more aots tests down. Four failing:
209/401 harfbuzz:shaping+aots / gpos6 FAIL 0.06s exit status 1
261/401 harfbuzz:shaping+aots / gsub4_1_multiple_ligatures FAIL 0.07s exit status 1
265/401 harfbuzz:shaping+aots / lookupflag_ignore_attach FAIL 0.07s exit status 1
267/401 harfbuzz:shaping+aots / lookupflag_ignore_combination FAIL 0.07s exit status 1
2022-01-22 11:53:18 -07:00
Behdad Esfahbod
95d052a791
[unsafe-to-concat] Adjust GPOS lookbacks
...
Fixes Cursive aots test, fails a couple new aots ones.
2022-01-22 11:53:18 -07:00
Behdad Esfahbod
909e34f68a
[unsafe-to-concat] Adjust Arabic-joining start boundary condition more
2022-01-22 11:53:18 -07:00
Behdad Esfahbod
11bdd7a020
[unsafe-to-concat] Adjust CursivePos
...
Doesn't fix the test yet.
2022-01-22 11:53:18 -07:00
Behdad Esfahbod
ea1b32c8c1
[unsafe-to-concat] Adjust "interior"ness of "from_out_buffer"
2022-01-22 11:53:18 -07:00
Behdad Esfahbod
4f04baef17
[unsafe-to-concat] Further adjust Arabic joining logic at boundary
2022-01-22 11:53:18 -07:00
Behdad Esfahbod
235c3a1295
[unsafe-to-concat] Adjust Arabic joining logic
...
Test failures done one more. Fixed the mongolian-variation-selector
test. Another test case:
$ util/hb-shape NotoSansArabic-Regular.ttf -u 628,200c,628 --show-flags --verify
2022-01-22 11:53:18 -07:00
Behdad Esfahbod
48c5f26199
[unsafe-to-concat] Fix PairPos2 logic
...
Test failures down from 8 to 6:
113/400 harfbuzz:shaping+in-house / mongolian-variation-selector FAIL 0.06s exit status 1
203/400 harfbuzz:shaping+aots / gpos3 FAIL 0.06s exit status 1
204/400 harfbuzz:shaping+aots / gpos4_lookupflag FAIL 0.06s exit status 1
260/400 harfbuzz:shaping+aots / gsub4_1_multiple_ligatures FAIL 0.06s exit status 1
264/400 harfbuzz:shaping+aots / lookupflag_ignore_attach FAIL 0.06s exit status 1
266/400 harfbuzz:shaping+aots / lookupflag_ignore_combination FAIL 0.06s exit status 1
2022-01-22 11:53:18 -07:00
Behdad Esfahbod
c0058892be
[unsafe-to-concat] Mark entire buffer unsafe-to-concat if kerx format2
2022-01-22 11:53:18 -07:00
Behdad Esfahbod
60006d3687
[gsubgpos] Adjust chaining unsafe-to-concat application
...
Fixes three tests.
2022-01-22 11:53:18 -07:00
Behdad Esfahbod
d98a0fc88e
[buffer] Consolidate glyph-flags implementation
2022-01-22 11:53:18 -07:00
Behdad Esfahbod
f91ce56e08
[buffer] Add default cluster value in find_min_cluster
2022-01-22 11:53:18 -07:00
Behdad Esfahbod
56d081955c
[buffer] Rename _unsafe_to_break_set_mask to _infos_set_glyph_flags
2022-01-22 11:53:18 -07:00
Behdad Esfahbod
78481b32c0
[gsubgpos] Combine input/backtrack/lookahead unsafe-to-concat
...
I feel like this is correct logic. Still have to prove.
Errors unchanged at 10.
2022-01-22 11:53:18 -07:00
Behdad Esfahbod
596bc7e939
[unsafe-to-concat] Add to GPOS kerning
2022-01-22 11:53:18 -07:00
Behdad Esfahbod
e1cbd4539f
[unsafe-to-concat] Add annotations to GPOS and kern
...
Failures from 13 to 14.
2022-01-22 11:53:18 -07:00
Behdad Esfahbod
3122c2cdc4
[buffer] Add HB_GLYPH_FLAG_UNSAFE_TO_CONCAT
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/1463
2022-01-22 11:53:18 -07:00
Behdad Esfahbod
a8b7f18804
[cff] Initialize accelerator members
2022-01-21 07:38:33 -07:00
Behdad Esfahbod
cce37a6f10
[gpos] Fix conditional
2022-01-21 07:31:21 -07:00
Behdad Esfahbod
773cf4fdd3
[post] Initialize variables
2022-01-21 07:30:09 -07:00
Behdad Esfahbod
84aa1a836c
[PairPos] Split GPOS kerning to both sides ( #3235 )
2022-01-20 14:18:19 -07:00
Behdad Esfahbod
ae9fc7f533
Clean accelerators a bit more
2022-01-20 12:37:21 -07:00
Behdad Esfahbod
0ae6659398
Merge pull request #3392 from harfbuzz/auto-accelerators
...
Auto accelerators
2022-01-20 11:28:59 -08:00
Behdad Esfahbod
ac1bb3e39e
[machinery] Move accelerators to constructor/destructor
2022-01-20 12:10:05 -07:00
Garret Rieger
112cb9fe69
[repacker] Fix missing initilization of obj in vertex_t.
2022-01-20 08:03:52 -08:00
Behdad Esfahbod
e062376ef1
[machinery] Make accelerator lazy-loader call Xinit/Xfini
...
Instead of init/fini. To isolate those functions. To be turned into
constructor/destructors, ideally one per commit (after some SFINAE
foo.)
2022-01-19 17:09:34 -07:00
Behdad Esfahbod
2d12fc90a4
[ms-feature-ranges] Pass reference to cmp function
2022-01-19 14:01:34 -07:00
Behdad Esfahbod
ac109c9353
[ms-feature-ranges] Inline code in header file
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/3387
2022-01-19 12:22:02 -08:00
Behdad Esfahbod
376738d411
[coretext] Fix lsearch
2022-01-19 11:58:42 -07:00
Behdad Esfahbod
106388e766
[vector] Merge sorted-vector into vector
...
Was easier than I thought!
Let's see what the bot gods think...
2022-01-19 11:38:37 -07:00
Behdad Esfahbod
294d50ff35
[vector] Add sorted template argument
2022-01-19 11:32:14 -07:00
Behdad Esfahbod
cd9799784c
[vector] Remove old find() method
2022-01-19 11:14:25 -07:00
Behdad Esfahbod
849e40b4db
[ms-feature-ranges] Use preferred vector search API
2022-01-19 11:06:33 -07:00
Behdad Esfahbod
7e160dc347
[gpos] Fix unsafe-to-break of mark-attachment
...
This was undetected because most of the time marks were in same
cluster of their base already.
Fixes https://github.com/harfbuzz/harfbuzz/issues/3093
2022-01-19 09:27:55 -07:00
Behdad Esfahbod
c8195dbc01
Merge pull request #3365 from harfbuzz/gdef-fix
...
GDEF fix
2022-01-19 06:56:05 -08:00
Garret Rieger
94ba4d5a44
[subset] Fix bound check when setting overlap bit.
...
length() shouldn't be used again as the end of instruction offset is already included in flags_offset.
2022-01-18 19:16:37 -08:00
Behdad Esfahbod
fe783ac091
[cff] Remove op_str_t nop init/fini
2022-01-18 13:38:28 -07:00
Behdad Esfahbod
8d24ac2662
[cff] Remove init/fini from number_t
2022-01-18 13:14:42 -07:00
Behdad Esfahbod
6ef83c2c31
[vector] Remove .fini_deep()
2022-01-18 13:08:34 -07:00
Behdad Esfahbod
4eb6e6ea16
[cff] Remove some more fini_deep()
2022-01-18 12:07:05 -07:00
Behdad Esfahbod
29f60d1eaa
[cff] Remove init/fini from blend_arg_t
2022-01-18 11:58:16 -07:00
Behdad Esfahbod
213e3f09b1
[vector] Add TODO Emplace?
2022-01-18 11:53:52 -07:00
Garret Rieger
f1dc8b087c
[subset-cff] Convert subr_closures_t to constructor/destructor instead of init/fini.
2022-01-18 10:29:04 -08:00
Behdad Esfahbod
a48aa9850a
[subset-cff] Remove another set of fini_deep
2022-01-18 09:32:58 -07:00
Behdad Esfahbod
07474aa8c6
[subset-cff1] Remove a constructor/destructor pair
2022-01-18 09:29:43 -07:00
Behdad Esfahbod
a1e9a276eb
[subset-cff2] Drop an constructor/destructor pair
2022-01-18 09:27:32 -07:00
Behdad Esfahbod
035f03346d
[str_buff_vec_t] Remove unused fini method
2022-01-18 09:26:30 -07:00
Behdad Esfahbod
de2cef42b4
[bimap] Remove init/fini
2022-01-18 09:21:31 -07:00
Behdad Esfahbod
c3dd21f110
[cff] Remove unneeded init/fini
2022-01-18 09:11:08 -07:00
Behdad Esfahbod
15cceff3d7
[repacker] Replace fini_deep() with fini()
...
Vector calls destructor now.
2022-01-17 16:46:45 -07:00