Commit Graph

11106 Commits

Author SHA1 Message Date
Behdad Esfahbod 8b379ddc76 [test-iter] Add back test of OT namespace iteration 2022-07-14 16:20:04 -06:00
Garret Rieger 5363e40de1 [reorg] update build files. 2022-07-13 20:25:13 -06:00
Garret Rieger d82ace5c6f [reorg] add TODO to RangeRecord. 2022-07-13 20:25:13 -06:00
Garret Rieger c1e280ea78 [reorg] Move Coverage, RangeRecord into new namespace layout. 2022-07-13 20:25:13 -06:00
Garret Rieger 9c2518988d [repack] Don't count space isolation against round limit.
Restore max rounds to 20 but don't count space isolation against the limit. The number of iterations space isolation can make changes for is already bounded to a reasonable max (the number of lookups in the font) so no need to cap the number of iterations.
2022-07-13 20:24:59 -06:00
Behdad Esfahbod a2f0723148 [GPOS] Adjust mark attachment on multiple substitution some more
Fixes https://github.com/harfbuzz/harfbuzz/issues/1545
2022-07-13 16:02:39 -06:00
Behdad Esfahbod ac216972ab [subset] Add table size blowup bound
Fixes https://github.com/harfbuzz/harfbuzz/issues/3091
2022-07-13 15:32:19 -06:00
Behdad Esfahbod 4b3afafb00 [array] Use hb_swap() in reverse() 2022-07-13 15:13:07 -06:00
Behdad Esfahbod 87167acfe3
Merge pull request #3704 from harfbuzz/64k
Towards breaking the 64k in GSUB/GPOS
2022-07-13 14:58:09 -06:00
Garret Rieger a369ab133b [repacker] Increase max_rounds when called via public api. 2022-07-13 14:01:42 -06:00
Behdad Esfahbod 4ee471922d More -Wcomma fixes
Fixes https://github.com/harfbuzz/harfbuzz/issues/3716
2022-07-13 13:59:35 -06:00
Behdad Esfahbod c2712ff4f5 Reorder hb_ot_shaper_t members to save 8 bytes of data per shaper 2022-07-13 13:34:11 -06:00
Behdad Esfahbod e5f0bc8f0a [set] Save a few kilobytes via type erasure of process() 2022-07-13 13:22:34 -06:00
Behdad Esfahbod 42da7da5ef Fix HB_NO_SHAPER HB_NO_OT_SHAPE build 2022-07-13 12:46:36 -06:00
Behdad Esfahbod 015aecfcdd [use-table] Port to using packtab
Saves around 9kb.
2022-07-13 12:24:46 -06:00
Behdad Esfahbod 0fcd1decb7 Fix file permissions 2022-07-13 12:17:35 -06:00
Behdad Esfahbod 7549d447ba [>64k:glyf] Implement composites for >64k
Implements https://github.com/be-fonts/boring-expansion-spec/issues/42
2022-07-12 13:42:52 -06:00
Behdad Esfahbod 09de94788b [>64k:glyf] Hid composite glyphIndex 2022-07-12 13:42:52 -06:00
Behdad Esfahbod df7eebf40a [>64k:layout] Fix layout of RangeRecord
https://github.com/be-fonts/boring-expansion-spec/issues/30
2022-07-12 13:42:52 -06:00
Behdad Esfahbod 99f017f41d [>64k:layout:GSUBGPOS] Implement format 2
Implements https://github.com/be-fonts/boring-expansion-spec/issues/58

Subset does NOT lower format.
2022-07-12 13:42:52 -06:00
Behdad Esfahbod 9ef9fc0114 [>64k:layout] Templatize GSUBGPOSFormat1 2022-07-12 13:42:52 -06:00
Behdad Esfahbod 5fd0a3f0b9 [>64k:layout] Templatize GSUBGPOSFormat1 2022-07-12 13:42:52 -06:00
Behdad Esfahbod f6c2aaeea4 [>64k:layout] Add List16OfOffsetTo 2022-07-12 13:42:52 -06:00
Behdad Esfahbod 6d0e3e677b [>64k:layout] Split GSUBGPOSVersion1 into own struct 2022-07-12 13:42:52 -06:00
Behdad Esfahbod 04c5cd4085 [subset/layout] Move find_duplicate_features to subset from layout 2022-07-12 13:42:52 -06:00
Behdad Esfahbod 1bf8fa2f1f [>64k:layout:(Chain)Context] Implement format 4
Implements rest of https://github.com/be-fonts/boring-expansion-spec/issues/34

Subset does NOT lower format.
2022-07-12 13:42:52 -06:00
Behdad Esfahbod 0f13eb1f5c [>64k:layout] Templatize (Chain)ContextFormat1 2022-07-12 13:42:52 -06:00
Behdad Esfahbod d1f58e5979 [>64k:layout:(Chain)Context] Implement format 5
Implements part of https://github.com/be-fonts/boring-expansion-spec/issues/34

Subset does NOT lower format.
2022-07-12 13:42:52 -06:00
Behdad Esfahbod a90c5af9d2 [>64k:layout] Templatize (Chain)ContextFormat2 2022-07-12 13:42:52 -06:00
Behdad Esfahbod cc83b0b8fd [>64k:layout:MarkBasePos/MarkMarkPos/MarkLigPos] Implement format 2
Implements https://github.com/be-fonts/boring-expansion-spec/issues/40

Subset does NOT lower format.
2022-07-12 13:42:52 -06:00
Behdad Esfahbod 4b43070e2f [>64k:layout] Templatize MarkBasePos/MarkMarkPos/MarkLigPos 2022-07-12 13:42:52 -06:00
Behdad Esfahbod f0d6dda5a6 [>64k:layout:PairPos] Implement format 3
Implements rest of https://github.com/be-fonts/boring-expansion-spec/issues/38

Subset does NOT lower format.
2022-07-12 13:42:52 -06:00
Behdad Esfahbod 298ee47c55 [>64k:layout] Templatize PairPosFormat1 2022-07-12 13:42:52 -06:00
Behdad Esfahbod e9f8010fd0 [>64k:layout:PairPos] Templatize & implement format 4
Implements part of https://github.com/be-fonts/boring-expansion-spec/issues/38

Subset does NOT lower format.
2022-07-12 13:42:52 -06:00
Behdad Esfahbod ecd8bc5a9c [>64k:layout:LigatureSubst] Implement format 2
Implements https://github.com/be-fonts/boring-expansion-spec/issues/33

Subset does NOT lower format.
2022-07-12 13:42:52 -06:00
Behdad Esfahbod 9d0e9faa43 [>64k:layout] Templatable bunch of GSUBGPOS internal functions 2022-07-12 13:42:52 -06:00
Behdad Esfahbod 429b387a6f [>64k:layout] Support HBUINT24 in skippy_iter 2022-07-12 13:42:52 -06:00
Behdad Esfahbod 1ef67a6d66 [gsubgpos] Remove HBUINT16 from matcher 2022-07-12 13:42:52 -06:00
Behdad Esfahbod 704e696ad0 [>64k:layout] Templatize LigatureSubst 2022-07-12 13:42:52 -06:00
Behdad Esfahbod 27d24212db [>64k:layout:AlternateSubst] Implement format 2
Implements rest of https://github.com/be-fonts/boring-expansion-spec/issues/32

Subset does NOT lower format.
2022-07-12 13:42:52 -06:00
Behdad Esfahbod c53d3ad51e [>64k:layout] Templatize AlternateSet 2022-07-12 13:42:52 -06:00
Behdad Esfahbod a58a48622a [>64k:layout:MultipleSubst] Implement format 2
Implements part of https://github.com/be-fonts/boring-expansion-spec/issues/32

Subset is NOT updated to lower format.
2022-07-12 13:42:52 -06:00
Behdad Esfahbod 684c8fcea7 [>64k:layout] Templatize MultipleSubst 2022-07-12 13:42:52 -06:00
Behdad Esfahbod 8775e9b4a4 [>64k:layout:SingleSubst] Implement format 3/4
Implements https://github.com/be-fonts/boring-expansion-spec/issues/31
2022-07-12 13:42:52 -06:00
Behdad Esfahbod e3caf8d50a [>64k:layout] Templatize SingleSubst 2022-07-12 13:42:52 -06:00
Behdad Esfahbod ca5c8a6419 [>64k:layout:Coverage] Implement format 3/4
Implements rest of https://github.com/be-fonts/boring-expansion-spec/issues/30
2022-07-12 13:42:52 -06:00
Behdad Esfahbod 25de6fb4e7 [>64k:layout:ClassDef] Implement format 3/4
This implements part of https://github.com/be-fonts/boring-expansion-spec/issues/30
2022-07-12 13:42:52 -06:00
Behdad Esfahbod 9286526f37 [>64k:layout] Templatize Coverage & ClassDef
Have not added new formats yet.
2022-07-12 13:42:52 -06:00
Behdad Esfahbod e8cce9d1b3 [>64k:layout] Add SmallTypes & MediumTypes 2022-07-12 13:42:52 -06:00
Behdad Esfahbod d8f9d51780 [hashmap] Add keys_ref() and values_ref() 2022-07-12 13:19:31 -06:00
Behdad Esfahbod cddcb31065 [vector] Remove residual nullptr_t from when hashmap needed it 2022-07-12 13:15:38 -06:00
Behdad Esfahbod 46a36771f4 [draw] Fix leak from e0a5231657 2022-07-12 12:03:00 -06:00
Behdad Esfahbod f8544cbfc0 [draw] Fix regression from e0a5231657 2022-07-12 11:52:33 -06:00
Behdad Esfahbod d15041be7d [GSUB/GPOS] Trace toplevel sanitize 2022-07-12 11:11:22 -06:00
Behdad Esfahbod 7c4e9080c0 [sanitize] Minor trace format fixup
This likely() is unlikely to make a difference, and obscures
the return_trace() message by writing out "something" instead
of the true/false value.
2022-07-11 21:52:41 -06:00
Matthias Clasen d826a5920c docs: Clarify 0xFFFF as palette index
Mention that a palette index of 0xFFFF
means to use the foreground color.
2022-07-10 11:08:52 -06:00
Behdad Esfahbod 6d051f4018 [layout] Simplify StructAfter<> usage 2022-07-08 14:09:04 -06:00
Behdad Esfahbod 5192294f83 . 2022-07-08 14:09:04 -06:00
Garret Rieger 29f149c16c [subset] cache sanitized tables in subset plan to avoid sanitizing tables multiple times. 2022-07-08 13:42:38 -06:00
Behdad Esfahbod 8b349e1139 [gsubgpos] Remove HBUINT16 from match functions signatures 2022-07-08 12:05:01 -06:00
Behdad Esfahbod f114b18c58 [gsubgpos] Break skippy_iter set_match_func into two 2022-07-08 12:04:14 -06:00
Behdad Esfahbod 8a107125a5 [layout] Make SubstLookup:serialize_single take iterators 2022-07-08 12:02:11 -06:00
Behdad Esfahbod 8a971d01e9 [layout] Use is_source_of instead of is_iterator 2022-07-08 12:01:48 -06:00
Behdad Esfahbod 0dc0da054d [iter] Add hb_is_sorted_iterator(_of) 2022-07-08 12:01:38 -06:00
Behdad Esfahbod 2c67261723 [open-type] Add HBGlyph24 2022-07-08 12:01:26 -06:00
Behdad Esfahbod 7cfe7fe651 [null] Change null bytes for RangeRecord
Should be harmless.
2022-07-08 12:01:18 -06:00
Behdad Esfahbod 486555c691 [open-type] Add Array24Of<> and SortedArray24Of<> 2022-07-08 12:01:07 -06:00
Behdad Esfahbod 1e503f587b [null] Add DECLARE_NULL_NAMESPACE_BYTES_TEMPLATE1 2022-07-08 12:00:53 -06:00
Behdad Esfahbod ea11029a6e [GPOS] Split LigatureArray.hh 2022-07-08 11:58:43 -06:00
Behdad Esfahbod 68b2742fe4 [GPOS] Move code around 2022-07-07 16:11:15 -06:00
Behdad Esfahbod 6a3043a0c1 Fix tests 2022-07-07 14:51:37 -06:00
Behdad Esfahbod aa68657434 [Makefile.sources/meson.build] Sort file names 2022-07-07 14:07:45 -06:00
Behdad Esfahbod 0b0e3b30ce [GPOS] Break down PairPosFormat1 into new layout 2022-07-07 14:06:44 -06:00
Garret Rieger 6fad6b4113 [repacker] add tests for special casing of 24bit offsets. 2022-07-06 19:18:27 +00:00
Garret Rieger b4f561dbbf [subset] Add some comments to find_space_roots/find_32_bit_roots methods. 2022-07-06 18:49:23 +00:00
Garret Rieger 401066bf3d [subset] Prepare the repacker for handling 24bit offsets in GSUB/GPOS.
The boring expansion (https://github.com/be-fonts/boring-expansion-spec) plans to introduce 24bit offsets into GSUB/GPOS. This changes the repacker to treat 24 bit offsets similar to 32 bit offsets and assign the top level 24 bit offsets into spaces to improve packing.
2022-07-06 18:44:40 +00:00
Behdad Esfahbod c091d029c2
Merge pull request #3706 from lb90/dwrite-dll
Load DirectWrite dynamically
2022-07-06 10:51:04 -06:00
Luca Bacci 1abc14b463 Do not link with the DWrite lib
It's loaded dynamically now
2022-07-06 17:55:39 +02:00
Luca Bacci c22acfa8bd Fix function pointer typedef 2022-07-06 17:55:24 +02:00
Kleis Auke Wolthuizen 79eb0f7486 [GSUB] Fix build on GCC < 7 2022-07-06 14:00:16 +02:00
Kleis Auke Wolthuizen 3238cb744b [GPOS] Fix build on GCC < 7 2022-07-06 14:00:16 +02:00
Luca Bacci 3e881efbe4 Revert "Revert "Revert "[hb-directwrite] Don't load dwrit.dll dynamically"""
This reverts commit 361a438658.
2022-07-06 13:51:56 +02:00
Kleis Auke Wolthuizen 7b51bc95d9 [cplusplus] Fix build on GCC < 7 2022-07-06 13:12:00 +02:00
Behdad Esfahbod 386e1bbad8
Merge pull request #3699 from googlefonts/filter_scripts
[subset] Add support for --layout-scripts
2022-07-05 12:46:05 -06:00
Garret Rieger 30309ec8d3 [subset] add null element in _filter_tag_list. 2022-07-05 18:33:19 +00:00
Garret Rieger 216cf5946b [subset] Allocate space for null entry in script/feature list. 2022-07-05 17:49:12 +00:00
Behdad Esfahbod d9ab805e61 Fix LookupFlag negation
Fixes https://github.com/harfbuzz/harfbuzz/issues/3703
2022-07-05 11:45:10 -06:00
Behdad Esfahbod b0cb9a1a63 Make get_leading_bearing return bool
Fixes https://github.com/harfbuzz/harfbuzz/issues/3496

Part of supporting >64k glyphs correctly.
2022-07-03 15:32:32 -06:00
Behdad Esfahbod 115e1a03e7 [glyf] Relax condition for matching number of coords 2022-07-03 14:45:12 -06:00
Behdad Esfahbod 800760c5bd [glyf] Rename get_extents functions for clarity 2022-07-03 13:21:06 -06:00
Behdad Esfahbod ab327f93b7 [glyf] Fix another bug with scaling
Of advances this time.

That codepath is never exercised though, if font has HVAR table.
2022-07-03 13:17:03 -06:00
Behdad Esfahbod f46ddeba48 [hmtx/glyf] Rename side-bearing functions for clarity 2022-07-03 13:12:49 -06:00
Behdad Esfahbod 23435d5285 [hvar] Rename advance function for clarity 2022-07-03 13:04:27 -06:00
Behdad Esfahbod 9f974cae4a [hvar] Rename lsb function for clarity 2022-07-03 13:03:12 -06:00
Behdad Esfahbod ab5ce64313 [VVAR] Rename vorg function for clarity 2022-07-03 13:00:22 -06:00
Behdad Esfahbod b2d60cbd6e [glyf] Rename advance functions for clarity 2022-07-03 12:56:48 -06:00
Behdad Esfahbod 35c00c1216 [hmtx] Rename advance functions for clarity 2022-07-03 12:54:17 -06:00
Behdad Esfahbod 6b82d4faa1 [glyf] Make an optional argument non-optional 2022-07-03 12:45:27 -06:00
Behdad Esfahbod 3ef590808f [glyf] Internal flip a variable 2022-07-03 12:44:24 -06:00
Behdad Esfahbod b07fa2bb1a [ot-font] Respect VORG even if it has no variations 2022-07-03 12:39:55 -06:00
Behdad Esfahbod 71d52e10aa [var] Fix getting side-bearing variations
In HVAR/VVAR, if the side-bearing mappings are null, it means the
table does not have them and they should be loaded from glyf table.
Previous logic was returning zer0.

Part of fixing https://github.com/harfbuzz/harfbuzz/issues/1694
2022-07-03 12:39:55 -06:00
Behdad Esfahbod 78b4f39821 [glyf] Fix confusion between scaled vs unscaled lsb
Was always broken.
2022-07-03 12:39:55 -06:00
Behdad Esfahbod 6665881c7d [glyf] Change side-bearing rounding 2022-07-03 12:39:55 -06:00
Behdad Esfahbod 0a295fcde6 [var] Fix DeltaSetIndexMapFormat1
Fixes https://github.com/harfbuzz/harfbuzz/issues/3692
2022-07-01 17:16:24 -06:00
Behdad Esfahbod 351cccdb75 [buffer-deserialize] Deserialize glyph flags
Fixes https://github.com/harfbuzz/harfbuzz/issues/1482
2022-07-01 16:52:49 -06:00
Behdad Esfahbod 5134041f21 [deserialize-json] Make it actually work!
Was not correctly deserializing glyph names as it was not dropping
double-quotes from glyph name before parsing.
2022-07-01 16:48:47 -06:00
Behdad Esfahbod 534b0911f7 [aat-layout] Add an unlikely() 2022-07-01 16:20:31 -06:00
Stephan Bergmann 14b018124c hb_graphite2_cluster_t::advance can apparently be negative
...as seen with HarfBuzz used by LibreOffice, with `instdir/program/soffice
--headless --convert-to pdf` of doc/abi6073-2.doc from the LibreOffice crash-
testing corpus when run under UBSan,

> hb-graphite2.cc:361:15: runtime error: -1024 is outside the range of representable values of type 'unsigned int'
>  #0 in _hb_graphite2_shape at workdir/UnpackedTarball/harfbuzz/src/hb-graphite2.cc:361:15
>  #1 in _hb_shape_plan_execute_internal(hb_shape_plan_t*, hb_font_t*, hb_buffer_t*, hb_feature_t const*, unsigned int) at workdir/UnpackedTarball/harfbuzz/src/./hb-shaper-list.hh:38:1
>  #2 in hb_shape_plan_execute at workdir/UnpackedTarball/harfbuzz/src/hb-shape-plan.cc:453:14
>  #3 in hb_shape_full at workdir/UnpackedTarball/harfbuzz/src/hb-shape.cc:139:19
>  #4 in GenericSalLayout::LayoutText(ImplLayoutArgs&, SalLayoutGlyphsImpl const*) at vcl/source/gdi/CommonSalLayout.cxx:495:23
>  #5 in OutputDevice::getFallbackLayout(LogicalFontInstance*, int, ImplLayoutArgs&, SalLayoutGlyphs const*) const at vcl/source/outdev/font.cxx:1232:21
>  #6 in OutputDevice::ImplGlyphFallbackLayout(std::unique_ptr<SalLayout, std::default_delete<SalLayout> >, ImplLayoutArgs&, SalLayoutGlyphs const*) const at vcl/source/outdev/font.cxx:1300:48
>  #7 in OutputDevice::ImplLayout(rtl::OUString const&, int, int, Point const&, long, long const*, SalLayoutFlags, vcl::TextLayoutCache const*, SalLayoutGlyphs const*) const at vcl/source/outdev/text.cxx:1332:22
>  #8 in lcl_CreateLayout(SwTextGlyphsKey const&, __gnu_debug::_Safe_iterator<std::_Rb_tree_iterator<std::pair<SwTextGlyphsKey const, SwTextGlyphsData> >, std::__debug::map<SwTextGlyphsKey, SwTextGlyphsData, std::less<SwTextGlyphsKey>, std::allocator<std::pair<SwTextGlyphsKey const, SwTextGlyphsData> > >, std::bidirectional_iterator_tag>) at sw/source/core/txtnode/fntcache.cxx:233:33
>  #9 in SwFntObj::GetCachedSalLayoutGlyphs(SwTextGlyphsKey const&) at sw/source/core/txtnode/fntcache.cxx:257:12
>  #10 in SwFont::GetTextBreak(SwDrawTextInfo const&, long) at sw/source/core/txtnode/fntcache.cxx:2551:58
>  #11 in SwTextSizeInfo::GetTextBreak(long, o3tl::strong_int<int, Tag_TextFrameIndex>, unsigned short, vcl::TextLayoutCache const*) const at sw/source/core/text/inftxt.cxx:450:20
>  #12 in SwTextGuess::Guess(SwTextPortion const&, SwTextFormatInfo&, unsigned short) at sw/source/core/text/guess.cxx:205:26
>  #13 in SwTextPortion::Format_(SwTextFormatInfo&) at sw/source/core/text/portxt.cxx:305:32
>  #14 in SwTextPortion::Format(SwTextFormatInfo&) at sw/source/core/text/portxt.cxx:456:12
>  #15 in SwLineLayout::Format(SwTextFormatInfo&) at sw/source/core/text/porlay.cxx:260:31

(where in frame #4 GenericSalLayout::LayoutText, pHbBuffer->props.direction is
HB_DIRECTION_RTL, in case that is relevant).

It is unclear to me whether it is sufficient to only change
hb_graphite2_cluster_t::advance from signed to unsigned int, as there are other
unsigned int variables (like curradv in _hb_graphite2_shape) whose value depend
on hb_graphite2_cluster_t::advance, and which thus might also become negative.
But unlike the float -> unsigned int conversion that UBSan warned about here
(where gr_slot_origin_X() and xscale are float), those are signed int ->
unsigned int conversions that do not cause undefined behavior.  At least, with
this change, the above --convert-to pdf and a full `make check screenshot`
succeeded for me under without further UBSan warnings.

(For the version of HarfBuzz optionally built as part of the LibreOffice build,
this has been addressed with
<https://git.libreoffice.org/core/+/6e53e03f752c2f85283c4d47efaaf0683299783c%5E!/>
"external/harfbuzz: hb_graphite2_cluster_t::advance can apparently be
negative.")
2022-07-01 12:00:09 -06:00
Garret Rieger dbfd2bf327 minor. 2022-06-30 23:04:35 +00:00
Garret Rieger 79bdcbef0d [subset] Fix GDEF version downgrade logic. 2022-06-30 22:20:32 +00:00
Garret Rieger 587969af42 [subset] Drop scripts that are not in the layout_scripts list. 2022-06-30 21:37:42 +00:00
Garret Rieger 900476c635 Move GSUB.hh GPOS.hh back into the GPOS/GSUB sub directories. 2022-06-30 15:33:20 -06:00
Garret Rieger 5fdae68481 [reorg] Move GSUB.hh up one level and change GSUB namespace to GSUB_impl. 2022-06-30 15:33:20 -06:00
Garret Rieger 70e32a662f [subset] Add layout_scripts to subset input. 2022-06-30 21:00:48 +00:00
Behdad Esfahbod 13c499cb26 [hvar] Minor internal rewiring
Not passing font to functions makes it more clear that they don't
scale values.
2022-06-30 14:25:09 -06:00
Garret Rieger 41d2c335bc [subset] Apply script list filter when doing layout collection. 2022-06-30 20:24:42 +00:00
Garret Rieger e5c8a2f4e1 [subset] Pass plan through to collect methods.
Allows to more easily access the filtering sets as they are added and enables propagating errors to the plan.
2022-06-30 20:14:29 +00:00
Behdad Esfahbod aba4a4957a [ot-font] Disable VORG variation code in HB_NO_VAR 2022-06-30 14:13:44 -06:00
Behdad Esfahbod d5921b379b [tt-font] Apply VVAR.vOrg variation to VORG origin
Mostly fixes https://github.com/harfbuzz/harfbuzz/issues/1694
2022-06-30 14:09:09 -06:00
Behdad Esfahbod eee29f7327 [hmtx] Specialize var_table 2022-06-30 14:09:09 -06:00
Garret Rieger 1bf051ef3b [subset] refactor feature tag filtering so it can be used for scripts as well. 2022-06-30 20:03:33 +00:00
Khaled Hosny f6f93c30f3 [docs] Fix warning
These comment blocks don’t use gtk-doc syntax.
2022-06-30 08:50:59 +02:00
Khaled Hosny 98e90cc67c [docs] Reduce warnings
Use markdown syntax for inline code blocks instead of %true, %false, and
%NULL.
2022-06-30 08:44:40 +02:00
Behdad Esfahbod c69ec6f5bb [kern2] Fix sanitize issue on 32bit systems
Fixes https://github.com/harfbuzz/harfbuzz/issues/3483
2022-06-29 16:32:59 -06:00
Khaled Hosny 34d3d49e78 [docs] Fix Since annotation 2022-06-29 07:46:21 +02:00
Khaled Hosny 096aaa62a6 4.4.1 2022-06-29 07:30:05 +02:00
Behdad Esfahbod 050f169078 [GPOS/kerx] Call into impl namespace from kerx 2022-06-28 18:52:27 -06:00
Garret Rieger 910a137f4e [reorg] Fix propagate_attachment_offsets definition. 2022-06-28 18:47:50 -06:00
Garret Rieger 3fbf2dece7 [reorg] Move OT::Layout::GPOS_impl::GPOS to OT::Layout::GPOS. 2022-06-28 18:47:50 -06:00
Garret Rieger 88ef3c5a9a [reorg] Change OT::Layout::GPOS to OT::Layout::GPOS_impl. 2022-06-28 18:47:50 -06:00
Garret Rieger 49ddf069e0 [reorg] Move GPOS reverse_cursive_minor_offset implementation into new directory layout. 2022-06-28 18:47:50 -06:00
Garret Rieger 74f45f7c2a [reorg] Move remaining GPOS lookup types to new directory. 2022-06-28 18:47:50 -06:00
Garret Rieger 197d9a5c99 [reorg] Move more GPOS lookups to new directory. 2022-06-28 18:47:50 -06:00
Garret Rieger c7307ca06a [reorg] Begin moving GPOS into the new directory layout. 2022-06-28 18:47:50 -06:00
Behdad Esfahbod 9909d11f6f [indic generator] Fix regression
Fixes https://github.com/harfbuzz/harfbuzz/issues/3690
2022-06-28 16:02:51 -06:00
Behdad Esfahbod 4499ae0225 [coretext] Fix positioning of out-of-order glyphs
Unfortunately this now generates negative advances. To be fixed...
2022-06-28 15:44:34 -06:00
Behdad Esfahbod 58d2e93099 [coretext] Fix up clusters only if needed 2022-06-28 15:44:34 -06:00
Behdad Esfahbod eaba5e74a9 [directwrite] Simplify 2022-06-28 13:51:50 -06:00
Behdad Esfahbod 33e3bf2d79 [font] Drop caches on variation changes 2022-06-28 13:51:50 -06:00
Behdad Esfahbod c90130e625 [coretext] Remove old hack now that font layer takes care...
of invalidating font data when font settings change.
2022-06-28 13:30:44 -06:00
Behdad Esfahbod c1c78ade71 [font] When font changes, drop font shaper data
https://github.com/harfbuzz/harfbuzz/issues/3683#issuecomment-1168016509
2022-06-28 13:19:30 -06:00
Behdad Esfahbod 34c6c0193c [glyf] Fix byterange check again 2022-06-27 20:26:57 -06:00
Behdad Esfahbod 20572f914c [glyf] Move read_flags into a function 2022-06-27 20:22:09 -06:00
Behdad Esfahbod 31e985d7d1 [buffer] Likely that not messaging 2022-06-27 16:32:02 -06:00
Behdad Esfahbod 4be074e2cb [gvar] Whitespace 2022-06-27 16:12:42 -06:00
Behdad Esfahbod a96647841a [gvar] Optimize apply_deltas_to_points 2022-06-27 15:41:02 -06:00
Behdad Esfahbod e9af9062c0 [gvar] Optimize unpack_deltas 2022-06-27 15:38:42 -06:00
Behdad Esfahbod 573e77280b [gvar] Optimize unpack_deltas 2022-06-27 15:35:28 -06:00
Behdad Esfahbod 698f51464c [gvar] Share vector allocation across delta-sets 2022-06-27 15:30:19 -06:00
Behdad Esfahbod 39e280c256 [gvar] Handle a couple of error conditions 2022-06-27 15:28:30 -06:00
Behdad Esfahbod 5be6e5dd57 [gvar] Rewrite linear interpolation 2022-06-27 15:22:16 -06:00
Behdad Esfahbod 57519b532d [gvar] Use pointer-to-member instead of function 2022-06-27 15:18:56 -06:00
Behdad Esfahbod ab15fe082a [gvar] Handle a couple of error conditions 2022-06-27 15:13:10 -06:00
Behdad Esfahbod b7e9e8785c [gvar] Optimize deltas and points loading 2022-06-27 15:09:25 -06:00
Behdad Esfahbod 6e72c2e3fa [glyf] Add an assertion 2022-06-27 15:09:25 -06:00
Behdad Esfahbod 5da341ce92 [map] Another try at hiding minus1
To fix https://github.com/harfbuzz/harfbuzz/issues/3684
2022-06-27 14:00:34 -06:00
Behdad Esfahbod c72d3104ed [map] Return const reference in operator[] 2022-06-27 13:31:05 -06:00
Behdad Esfahbod 69d53f3e7f [map] Make default_value() inline
See if it make fix https://github.com/harfbuzz/harfbuzz/issues/3684
2022-06-27 13:17:10 -06:00
Behdad Esfahbod 3a0e27e794 [glyf] Move comment 2022-06-27 13:07:39 -06:00
Behdad Esfahbod d0836dee7a [glyf] Minor typo change 2022-06-27 13:05:58 -06:00
Behdad Esfahbod 5cca25e5d0 [glyf] Accumulate points as int
Everything is int at this stage.
Doesn't seem to matter for performance though.
2022-06-27 13:03:06 -06:00
Behdad Esfahbod d6f60b3c19 [glyf] Minor optimization 2022-06-27 13:00:08 -06:00
Behdad Esfahbod b30a3dcba3 [glyf] Another bounds check
Very unlikely that is needed but technically possible.
2022-06-27 12:56:54 -06:00
Behdad Esfahbod 2e9dbdcbbe [glyf] Protect against an unlikely overflow 2022-06-27 12:55:13 -06:00
Khaled Hosny 8537d68172 4.4.0 2022-06-27 20:51:16 +02:00
Behdad Esfahbod f1fb8c4489 [glyf] Optimize Glyph layout 2022-06-27 12:41:46 -06:00
Behdad Esfahbod 34e3f561b5 [glyf] Fix a bug I introduced recently
Pass gid to Glyph in trim_padding codepath.
2022-06-27 12:39:35 -06:00
Behdad Esfahbod 97cbc2d40a [gvar] Remove condition that font num_coords should match gvar's 2022-06-27 12:37:11 -06:00
Behdad Esfahbod 19cbfb9ce9 [glyf] Relax a condition that font num_coords be equal to gvar's
gvar itself still checks the same.
2022-06-27 12:32:18 -06:00
Behdad Esfahbod d5cfbaa068 [glyf] Optimize composite points loading 2022-06-27 12:24:20 -06:00
Behdad Esfahbod 32dc0641e1 [glyf] Remove an unnecessary condition 2022-06-27 12:22:06 -06:00
Behdad Esfahbod 95bfa0913d [gvar] Optimize translate() 2022-06-27 12:10:16 -06:00
Behdad Esfahbod 9f067582b8 [gvar] Optimize transform() 2022-06-27 12:10:16 -06:00
Behdad Esfahbod cfc57ef862 [glyf] Optimize contour_point_t layout 2022-06-27 12:10:16 -06:00
Behdad Esfahbod 75ca78a6bb [glyf] Optimize hb_contour_points_t::extend 2022-06-27 12:10:16 -06:00
David Corbett 04c4767150 [lao] Decompose and reorder U+0EB3 around U+0EBB 2022-06-27 11:31:32 -06:00
Behdad Esfahbod d3308f4713 [font] Optimize font scaling further 2022-06-27 11:28:57 -06:00
Matthias Clasen e72506d085 Fix the annotation for hb_blob_get_data
This function will return NULL for the the
empty blob. That is important information for
bindings that treat nullability as a type trait.
2022-06-27 10:59:02 -06:00
Behdad Esfahbod 3c49a6a60a [glyf] Fix an allocation error
Try fixing assertion failure found by fuzzers:

hb-draw-fuzzer: ../../src/harfbuzz/src/OT/glyf/glyf.hh:175: bool OT::glyf_accelerator_t::get_points(hb_font_t *, hb_codepoint_t, T) const [T = OT::glyf_impl::path_builder_t]: Assertion `count >= glyf_impl::PHANTOM_COUNT' failed.
2022-06-27 10:57:51 -06:00
Behdad Esfahbod 556e7078f0 [font] Optimize glyph scaling 2022-06-26 17:48:43 -06:00
Behdad Esfahbod a1c45bbb55 [glyf] Minor simplify 2022-06-26 17:30:16 -06:00
Behdad Esfahbod a21a9bb855 [glyf] Optimize flags decoding byte range checking 2022-06-26 17:24:29 -06:00
Behdad Esfahbod 0f1fdf461c [glyf] Optimize points decoding byte range checking 2022-06-26 17:22:45 -06:00
Behdad Esfahbod 51cfcf2957 [glyf] Optimize points decoding 2022-06-26 17:04:47 -06:00
Behdad Esfahbod 86b7022503 [glyf] Optimize flag decoding 2022-06-26 17:02:32 -06:00
Behdad Esfahbod 30d58bfd0f [glyf] Don't translate/transform components if has no effect 2022-06-26 16:49:40 -06:00
Behdad Esfahbod 2bb0fa878a [glyf] Remove unneeded point init() 2022-06-26 16:43:05 -06:00
Behdad Esfahbod fc72a1d22d [glyf] Add a pre-allocation for phantom points 2022-06-26 16:42:01 -06:00
Behdad Esfahbod 8d242aaa8b [glyf] Rewrite a loop harmlessly
I hope...
2022-06-26 16:36:08 -06:00
Behdad Esfahbod cf57f04ddb [glyf/path-builder] Optimize scaling code
Scale each point once upon entry to function.

This makes our shape fetching code as fast as FreeType for all
benchmark cases now.
2022-06-26 16:26:17 -06:00
Behdad Esfahbod 36dd5d32fb [draw] Use multiplication instead of division in quadratic conversion 2022-06-26 16:16:43 -06:00
Behdad Esfahbod b095df1343 [glyf/path-builder] Use operator bool for style 2022-06-26 16:12:50 -06:00
Behdad Esfahbod abb433d0f4 [glyf] Avoid a copy of points in shape fetching for simple glyphs
Matches performance with freetype now.
2022-06-26 16:09:32 -06:00
Behdad Esfahbod 7eac779abf Revert "Revert "[glyf] Optimize shape loading""
This reverts commit 164bd288cf.
2022-06-26 16:02:27 -06:00
Behdad Esfahbod 164bd288cf Revert "[glyf] Optimize shape loading"
This reverts commit f0819301b7.

Broke tests. To be debugged and redone.
2022-06-26 16:01:15 -06:00
Behdad Esfahbod f0819301b7 [glyf] Optimize shape loading
Do away with a copy for simple glyph load.
2022-06-26 15:52:54 -06:00
Behdad Esfahbod 65b066f18e [glyf/path-builder] Simplify initialization 2022-06-26 13:18:00 -06:00
David Corbett b2abd5c7e8 [thai] Reword to include all relevant marks 2022-06-26 13:12:12 -06:00
Behdad Esfahbod 2d4557fe04 [glyf/SimpleGlyph] Use member pointer instead of lambda 2022-06-26 13:08:37 -06:00
Behdad Esfahbod 9ce9773040 [glyf/SimpleGlyph] Minor use constructor for contour_point_t 2022-06-26 13:08:37 -06:00
Behdad Esfahbod f897978f21 [glyf] Adjust a check-range 2022-06-26 13:08:37 -06:00
Behdad Esfahbod db039d97ff [glyf/Composite] Make glyphIndex public 2022-06-26 13:08:37 -06:00
Behdad Esfahbod 1b14bf8aa8 [glyf] Rename CompositeGlyphChain to CompositeGlyphRecord 2022-06-26 13:08:37 -06:00
Behdad Esfahbod a5ac7f2ea6 [glyf/composite_iter_t] Renames 2022-06-26 13:08:37 -06:00
Behdad Esfahbod d15260ca95 [gpos] Limit recursion depth in propagate_attachment_offsets()
Fixes https://github.com/harfbuzz/harfbuzz/issues/2927
2022-06-25 19:53:11 -06:00
Behdad Esfahbod 449bdeed5f [glyf] Rename get_iterator() to iter()
That's the standard name.
2022-06-25 18:32:30 -06:00
Behdad Esfahbod 11d2670676 [glyf] Split off glyf-helpers.hh 2022-06-25 18:19:09 -06:00
Behdad Esfahbod 7c4b8c9bf4 [glyf] path-builder minor header guards fix test 2022-06-25 18:14:42 -06:00
Behdad Esfahbod 499c637922 [glyf] Split off path-builder.hh 2022-06-25 18:07:49 -06:00
Behdad Esfahbod 13aadc8961 [glyf] Split off CompositeGlyph.hh 2022-06-25 18:03:15 -06:00
Behdad Esfahbod f0ec2b728e [glyf] Split off SimpleGlyph.hh 2022-06-25 17:55:16 -06:00
Behdad Esfahbod 8ed78627f0 [glyf] Split off GlyphHeader.hh 2022-06-25 17:53:13 -06:00
Behdad Esfahbod 81315a3016 [glyf] Namespace implementation in glyf_impl
Part of https://github.com/harfbuzz/harfbuzz/issues/3677
2022-06-25 17:50:44 -06:00
Behdad Esfahbod be1d4bcf29 [glyf] Add fast __end__ to composite iterator 2022-06-25 17:45:21 -06:00
Behdad Esfahbod ef250eea7e [glyf] Move a few structs out of Glyph{} 2022-06-25 17:37:59 -06:00
Behdad Esfahbod ae75f066b5 [glyf] Split SubsetGlyph 2022-06-25 17:12:10 -06:00
Behdad Esfahbod 0031069f47 [glyf] Fix includes 2022-06-25 17:05:18 -06:00
Behdad Esfahbod b4a0c30d98 [glyf] Remove hardcoded HB_MAX_COMPOSITE_OPERATIONS 2022-06-25 17:01:11 -06:00
Behdad Esfahbod 36373ee15c [glyf] Move add_gid_and_children to subset-plan where it belongs 2022-06-25 16:55:26 -06:00
Behdad Esfahbod ba1c9eda38 [glyf] Use a range for loop 2022-06-25 16:51:33 -06:00
Behdad Esfahbod e4f2bc9342 [glyf] Split Glyph.hh 2022-06-25 16:47:06 -06:00
Behdad Esfahbod 3f9c6bf3fc [glyf] Minor in _write_loca() 2022-06-25 14:46:26 -06:00
Behdad Esfahbod 852985da0f [glyf] Split loca.hh 2022-06-25 14:41:51 -06:00
Behdad Esfahbod 100576b7b7 [glyf] Start splitting file 2022-06-25 14:38:43 -06:00
Behdad Esfahbod e867ac3aef
Merge pull request #3674 from harfbuzz/use-sinhala-no-hacks
[use] Switch Sinhala to USE
2022-06-25 12:43:04 -06:00
Behdad Esfahbod b1629b0ce0 [gdef] Minor harmless use of HB_OT_LAYOUT_GLYPH_CLASS_UNCLASSIFIED 2022-06-25 12:00:25 -06:00
David Corbett 78c5ae3979 [indic] Remove remnants of Sinhala 2022-06-25 13:49:18 -04:00
Behdad Esfahbod 0cc948b96c [use] Switch Sinhala to USE
https://github.com/harfbuzz/harfbuzz/issues/1044
2022-06-25 13:48:43 -04:00
David Corbett 6059828769 [use] Reintroduce the HVM class for U+0DCA 2022-06-25 13:48:43 -04:00
David Corbett 1555b30081 Add U+25CC to lone Robatic but not after U+17D9 2022-06-25 11:02:39 -06:00
David Corbett 0f15cb12de [indic-table] Fix block headers 2022-06-25 11:02:39 -06:00
Garret Rieger 2674962cf5 [repacker] Add comment to graph class. 2022-06-24 17:16:50 -06:00
Garret Rieger 81a2dd0e80 [repacker] Update Makefile for repacker re-org. 2022-06-24 17:16:50 -06:00
Garret Rieger 7078560e33 [repacker] extract graph serialization code into a seperate file. 2022-06-24 17:16:50 -06:00
Garret Rieger 20b02a672d [repacker] Begin splitting up the repacker implementation into several files. 2022-06-24 17:16:50 -06:00
Behdad Esfahbod ad2ab1ddb4 [indic] Clear syllables at the end of GSUB 2022-06-24 11:08:35 -06:00
Behdad Esfahbod 8bfb3e9df2 [indic] Disable vowel-constraints under uniscribe-bug-compatible 2022-06-23 13:28:07 -06:00
Behdad Esfahbod a5cf1a8738 Another null adjustment 2022-06-20 18:01:39 -06:00
Behdad Esfahbod a7960bdfb0 [config] Add HB_NO_LANGUAGE_LONG and enable in TINY profile
Disables 3letter language tags and more complex ones.

Fixes https://github.com/harfbuzz/harfbuzz/issues/3664
2022-06-20 17:55:28 -06:00
Behdad Esfahbod 0d03123350 Mark a null variable as const 2022-06-20 16:51:35 -06:00
Behdad Esfahbod 91d00ab722 [ucd] Update 2022-06-20 13:36:01 -06:00
Khaled Hosny a15ad778fe [arabic-fallback] Generate PUA table from data
Uses packtab for more compact arrays.
2022-06-19 12:29:10 -06:00
Behdad Esfahbod abc0685749
Merge pull request #3063 from harfbuzz/arabic-pua
Arabic PUA shaping
2022-06-19 11:05:17 -06:00
Behdad Esfahbod 7ec4a556d9 [normalize] Cosmetic
I didn't know this syntax is allowed in old C++.
2022-06-19 11:01:45 -06:00
Behdad Esfahbod 8c27c51c27 [arabic-pua] Rename symbols 2022-06-19 10:47:38 -06:00
Behdad Esfahbod 7698962911 [arabic-fallback] Disable PUA shaping under HB_NO_OT_SHAPER_ARABIC_FALLBACK 2022-06-19 10:42:06 -06:00
Behdad Esfahbod 4520911429 [arabic-fallback] Fix warning 2022-06-19 10:42:06 -06:00
Behdad Esfahbod 55350377b0 [cmap/ft] Only map 0xF000 range if font_page is NONE 2022-06-19 10:42:06 -06:00
Behdad Esfahbod 41a079bdec [arabic-fallback] Make win1256 code build again
Humm. Untested.
2022-06-19 10:42:06 -06:00
Behdad Esfahbod 1db6fddb24 [arabic-fallback.hh] Hook up 3-letter ligatures 2022-06-19 10:42:06 -06:00
Behdad Esfahbod 20e9f0b1d2 [arabic-fallback] Add the component loop
Should be able to support 3-letter ligatures now.  Hooking up next.
2022-06-19 10:42:06 -06:00
Behdad Esfahbod 9684d2d8aa [arabic-fallback] More baby steps 2022-06-19 10:42:06 -06:00
Behdad Esfahbod 08715d75e0 [arabic-fallback] Another baby-step 2022-06-19 10:42:06 -06:00
Behdad Esfahbod 15dd34b515 [arabic-fallback] Another minor rename towards supporting 3-letter ligatures 2022-06-19 10:42:06 -06:00
Behdad Esfahbod d86effa4a6 [arabic-fallback] Rename; towards supporting 3-letter ligatures 2022-06-19 10:42:06 -06:00
Behdad Esfahbod 16c2371352 [arabick-fallback] Apply mark ligatures 2022-06-19 10:42:06 -06:00
Khaled Hosny 7f362196c5 [arabic] Split ligature array
Generate marks and 3-component ligatures in separate arrays. The new
arrays are unused currently.
2022-06-19 10:42:06 -06:00
Khaled Hosny 6e29060af2 [arabic] Add mapping files for the PUA encoding
Unused right now.
2022-06-19 10:42:06 -06:00
Khaled Hosny 189e8c326e [ft] Remap legacy Arabic PUA codepoints
Similar to what ot font finctions does, to support Support legacy
pre-OpenType Windows 3.1-era fonts.
2022-06-19 10:42:05 -06:00
Khaled Hosny 69cbd365cc WIP: manually add data entries for PUA ligatures
Just a test, I’m not entirely convinced we should do this.
2022-06-19 10:42:05 -06:00
Khaled Hosny c3f590bb1e [arabic] Support legacy PUA shaping
Support legacy pre-OpenType Windows 3.1-era fonts, by remapping PUA code
points in cmap table and letting our fallback shaper build the GSUB
table.

Uniscribe applies also mset-like substitution, but our fallback mark
positioning gives better results, so this is not implemented.
2022-06-19 10:42:05 -06:00
Behdad Esfahbod b172f88c7d Fix a warning
D:\a\harfbuzz\harfbuzz\src\hb-bit-set-invertible.hh(83): warning C4805: '^': unsafe mix of type 'uint32_t' and type 'const bool' in operation
[870/1075] Compiling C++ object src/harfbuzz.dll.p/hb-face.cc.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
2022-06-18 14:00:59 -06:00
Garret Rieger af74ab452f [repack] always run the sort in repack.
This is needed to ensure virtual link ordering constraints are respected when repack is being called from fontTools. For subset usage, repack won't be called if the graph doesn't already overflow so this change doesn't cause any extra work.
2022-06-16 15:17:58 -06:00
Behdad Esfahbod 29811a720c Fix typo 2022-06-16 14:04:08 -06:00
Behdad Esfahbod c859cbfb88 Mark an array as static
Not sure how this wasn't flagged before.
2022-06-16 13:55:12 -06:00
Behdad Esfahbod 19802dfdf0 Minor rename of static symbols to namespace them 2022-06-16 13:52:47 -06:00
Behdad Esfahbod e0a5231657 [draw] Lazy-allocate user-data/destroy callback vector 2022-06-16 13:40:44 -06:00
Garret Rieger 823f32a0e2 [subset] Fix potential out of bounds write setting overlap flag on composite glyphs. 2022-06-16 12:30:59 -06:00
Behdad Esfahbod 3f9226da37 [meta] Fix typo 2022-06-16 09:28:47 -06:00
Ryan VanderMeulen 1c0eeb7cb3 Don't try to set _USE_MATH_DEFINES if already defined 2022-06-16 09:28:33 -06:00
Ryan VanderMeulen 25917c780f Fix build warning when __GNUG__ isn't defined 2022-06-16 09:28:33 -06:00
Behdad Esfahbod e9c0a74063 Fix clang -Wcomma warnings
Fixes https://github.com/harfbuzz/harfbuzz/issues/3656
2022-06-15 17:28:36 -06:00
Behdad Esfahbod d9c18cc2f0 [indic-table] Update 2022-06-15 16:50:34 -06:00
Behdad Esfahbod 99a26bc19d [indic-generator] Fix typo 2022-06-15 16:15:21 -06:00
Behdad Esfahbod 2cbb775866 [myanmar] Fold category P into GB
Fixes https://github.com/harfbuzz/harfbuzz/issues/3649

This actually now allows Asat after the Myanmar punctuation marks;
something I see in Wikipedia data.
2022-06-15 16:15:21 -06:00
Behdad Esfahbod b350e30186 [myanmar] Remove category D completely
Fixes https://github.com/harfbuzz/harfbuzz/issues/3651
2022-06-15 16:15:21 -06:00
Behdad Esfahbod 8533214ac5 [khmer] Fold category Coeng completely into category H 2022-06-15 16:15:21 -06:00
Behdad Esfahbod 607a9fe793 [indic-like] Remove category duplication 2022-06-15 16:15:21 -06:00
Behdad Esfahbod 0485192195 [indic-like] Remove dependence on ot_category_t 2022-06-15 16:15:21 -06:00
Behdad Esfahbod 14049003ac [indic-like] Reduce indic-dependency of khmer/myanmar even more 2022-06-15 16:15:21 -06:00
Garret Rieger f9f0969cb6 [subset] switch to hb_memcpy. 2022-06-14 17:49:13 +01:00
Garret Rieger 1e34852f07 [subset] Fix undefined behaviour.
Don't memcpy if there's nothing to copy.
2022-06-14 17:49:13 +01:00
Garret Rieger 311413f16b [subset] Fix fuzzer issue.
Fixes https://oss-fuzz.com/testcase-detail/5693568490012672. new_index should be set from new_index2 when the entry is present in the map.
2022-06-14 17:49:13 +01:00
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