platform/upstream/libHarfBuzzSharp.git
5 years agoAdded CFF1 J font subset to api test
Michiharu Ariza [Wed, 26 Sep 2018 23:30:26 +0000 (16:30 -0700)]
Added CFF1 J font subset to api test

Also fixed FDSelect3_4::get_fd
Fixed test_subset_cff1_strip_hints (wrong font names!)

5 years agofixed memory leaks
Michiharu Ariza [Tue, 25 Sep 2018 05:49:44 +0000 (22:49 -0700)]
fixed memory leaks

in CFF1 & CFF2 accelerators, VORG subsetter

5 years agoAdded CFF1 & CFF2 api tests
Michiharu Ariza [Mon, 24 Sep 2018 23:50:47 +0000 (16:50 -0700)]
Added CFF1 & CFF2 api tests

5 years agoMerge branch 'master' into cff-subset
Michiharu Ariza [Mon, 24 Sep 2018 17:09:25 +0000 (10:09 -0700)]
Merge branch 'master' into cff-subset

5 years ago[circleci] Disable msan and ubsan builds
Behdad Esfahbod [Mon, 24 Sep 2018 16:43:29 +0000 (12:43 -0400)]
[circleci] Disable msan and ubsan builds

https://github.com/harfbuzz/harfbuzz/issues/1174
https://github.com/harfbuzz/harfbuzz/issues/1175

5 years agoIgnore weak symbols in check-symbols.sh
Behdad Esfahbod [Mon, 24 Sep 2018 15:52:22 +0000 (11:52 -0400)]
Ignore weak symbols in check-symbols.sh

Some clang versions leave a std::round(float) weak symbol around...

5 years ago[docs] A few improvements
Behdad Esfahbod [Mon, 24 Sep 2018 14:43:06 +0000 (10:43 -0400)]
[docs] A few improvements

If we wrote just this much every day...

5 years agoReadjust Hebrew composition again
Behdad Esfahbod [Mon, 24 Sep 2018 13:57:52 +0000 (09:57 -0400)]
Readjust Hebrew composition again

5 years agoRevert change that would decompose text if GPOS mark feature is available
Behdad Esfahbod [Mon, 24 Sep 2018 13:56:18 +0000 (09:56 -0400)]
Revert change that would decompose text if GPOS mark feature is available

https://github.com/harfbuzz/harfbuzz/issues/653#issuecomment-423905920

5 years agoFix normalization
Behdad Esfahbod [Mon, 24 Sep 2018 13:54:37 +0000 (09:54 -0400)]
Fix normalization

https://github.com/harfbuzz/harfbuzz/commit/62d1e0852a5549a1b510ad46a4b89f12730bb708#commitcomment-30613091

5 years agoSimplify ZWJ-skipping a bit
Behdad Esfahbod [Mon, 24 Sep 2018 02:33:38 +0000 (22:33 -0400)]
Simplify ZWJ-skipping a bit

Towards disabling ZWJ-skipping in certain GPOS contexts.

Part of https://github.com/flutter/flutter/issues/16886

5 years agoReinit skippy iters when auto_zwj / auto_zwnj change
Behdad Esfahbod [Mon, 24 Sep 2018 02:00:34 +0000 (22:00 -0400)]
Reinit skippy iters when auto_zwj / auto_zwnj change

Ouch.  How did we not hit this bug before...

5 years agoPrefer decomposed form if font has GPOS mark feature
Behdad Esfahbod [Mon, 24 Sep 2018 01:32:18 +0000 (21:32 -0400)]
Prefer decomposed form if font has GPOS mark feature

Fixes https://github.com/harfbuzz/harfbuzz/issues/653

5 years ago[ot-font] Fix leak
Behdad Esfahbod [Sun, 23 Sep 2018 23:12:52 +0000 (19:12 -0400)]
[ot-font] Fix leak

Fixes https://github.com/harfbuzz/harfbuzz/issues/1171

I'm glad we have leak-detector bots now.

5 years agoAdd bots with address- and thread-sanitizer
Ebrahim Byagowi [Sat, 22 Sep 2018 10:52:17 +0000 (14:22 +0330)]
Add bots with address- and thread-sanitizer

5 years agosrc/hb-blob.cc: Fix mmap functionality with UWP.
Matt Oliver [Sun, 23 Sep 2018 08:08:30 +0000 (18:08 +1000)]
src/hb-blob.cc: Fix mmap functionality with UWP.

5 years ago[test] Fix printing subprocess error messages
Khaled Hosny [Sat, 22 Sep 2018 14:41:56 +0000 (16:41 +0200)]
[test] Fix printing subprocess error messages

Decode the string as Python 3 returns bytes string, and also don’t
assume that it ends with a new line.

5 years agoFix test-subset-* leak issues
Ebrahim Byagowi [Sat, 22 Sep 2018 13:54:03 +0000 (17:24 +0330)]
Fix test-subset-* leak issues

See also https://github.com/harfbuzz/harfbuzz/pull/1169

5 years agoFix test-ot-math leak issue
Ebrahim Byagowi [Sat, 22 Sep 2018 13:35:52 +0000 (17:05 +0330)]
Fix test-ot-math leak issue

See also https://github.com/harfbuzz/harfbuzz/pull/1169

5 years agoFix test-set leak issue
Ebrahim Byagowi [Sat, 22 Sep 2018 13:19:23 +0000 (16:49 +0330)]
Fix test-set leak issue

See also https://github.com/harfbuzz/harfbuzz/pull/1169

5 years agoFix test-font leak issue
Ebrahim Byagowi [Sat, 22 Sep 2018 13:15:31 +0000 (16:45 +0330)]
Fix test-font leak issue

See also https://github.com/harfbuzz/harfbuzz/pull/1169

5 years agofixed subroutinized CFF2 flattening
Michiharu Ariza [Fri, 21 Sep 2018 19:16:36 +0000 (12:16 -0700)]
fixed subroutinized CFF2 flattening

and some code cleanup

5 years agoAdded desubroutinize option to generate-expected-outputs.py
Michiharu Ariza [Thu, 20 Sep 2018 17:31:06 +0000 (10:31 -0700)]
Added desubroutinize option to generate-expected-outputs.py

Currently hb-subset always desubroutinizes CFF fonts.
Note that even with this option fonttools won't generate the expected subset CFF fonts. They were manually created & tweaked to match hb-subset output.

5 years agoAdded VORG struct and its subsetter
Michiharu Ariza [Thu, 20 Sep 2018 16:45:43 +0000 (09:45 -0700)]
Added VORG struct and its subsetter

new file: hb-ot-vorg-table.hh

5 years ago[morx] Fix mark_set check
Behdad Esfahbod [Thu, 20 Sep 2018 02:34:09 +0000 (22:34 -0400)]
[morx] Fix mark_set check

5 years agoAdded SourceHanSans-Regular for CFF subset test
Michiharu Ariza [Thu, 20 Sep 2018 00:00:10 +0000 (17:00 -0700)]
Added SourceHanSans-Regular for CFF subset test

Disabled FDSelect serialization to format 0 for compatibility with fonttools

5 years ago[aat] Minor
Behdad Esfahbod [Wed, 19 Sep 2018 21:32:21 +0000 (17:32 -0400)]
[aat] Minor

5 years ago[coretext] Minor
Behdad Esfahbod [Wed, 19 Sep 2018 21:10:26 +0000 (17:10 -0400)]
[coretext] Minor

5 years ago[morx] Implement forward/backward processing
Behdad Esfahbod [Wed, 19 Sep 2018 20:46:41 +0000 (16:46 -0400)]
[morx] Implement forward/backward processing

We reverse too many times. Can be optimized. But I doubt many fonts
use reverse lookups, so doesn't matter.

Other than not applying user features, this completes morx table
implementation.

5 years ago[morx] Implement horiz-only/vert-only subtables
Behdad Esfahbod [Wed, 19 Sep 2018 20:24:34 +0000 (16:24 -0400)]
[morx] Implement horiz-only/vert-only subtables

5 years ago[morx] Improve buffer position in Insertion w DontAdvance and wo
Behdad Esfahbod [Wed, 19 Sep 2018 20:02:56 +0000 (16:02 -0400)]
[morx] Improve buffer position in Insertion w DontAdvance and wo

Just speculation. Needs tests to determine which is correct behavior.

5 years agofixed char widths & standard Encoding in subset CFF
Michiharu Ariza [Wed, 19 Sep 2018 00:24:30 +0000 (17:24 -0700)]
fixed char widths & standard Encoding in subset CFF

also merged flush_n_args to flush_args into one
takes start index of the arguments on stack instead of count

5 years agoAdded SourceSansPro-Regular along as CFF full-font test case
Michiharu Ariza [Tue, 18 Sep 2018 22:53:37 +0000 (15:53 -0700)]
Added SourceSansPro-Regular along as CFF full-font test case

derived "expected" subset fonts from fonttools then manually tweaked further so they resemble hb-subset output

5 years agoinclude curve control points in extents
Michiharu Ariza [Mon, 17 Sep 2018 22:34:39 +0000 (15:34 -0700)]
include curve control points in extents

this makes results consistent with FT
also optimized handling of path end points

5 years agofix static_assert failure in OffsetTo<TopDict>
Michiharu Ariza [Mon, 17 Sep 2018 20:56:39 +0000 (13:56 -0700)]
fix static_assert failure in OffsetTo<TopDict>

5 years agoMerge branch 'master' into cff-subset
Michiharu Ariza [Mon, 17 Sep 2018 20:07:29 +0000 (13:07 -0700)]
Merge branch 'master' into cff-subset

5 years agofix build attempt ^3
Michiharu Ariza [Mon, 17 Sep 2018 19:11:56 +0000 (12:11 -0700)]
fix build attempt ^3

5 years agofix attempt ^2: unuse INT32_MAX/MIN
Michiharu Ariza [Mon, 17 Sep 2018 19:02:12 +0000 (12:02 -0700)]
fix attempt ^2: unuse INT32_MAX/MIN

5 years agofix build attempt
Michiharu Ariza [Mon, 17 Sep 2018 18:28:33 +0000 (11:28 -0700)]
fix build attempt

5 years ago[morx] Implement InsertionChain
Behdad Esfahbod [Mon, 17 Sep 2018 17:29:34 +0000 (19:29 +0200)]
[morx] Implement InsertionChain

5 years agoimplemented get_glyph_extents with CFF1
Michiharu Ariza [Mon, 17 Sep 2018 18:14:56 +0000 (11:14 -0700)]
implemented get_glyph_extents with CFF1

Implemented path operators in a new struct PathProc hooked up to CSOpSet
Added current point to CSInterpEnv

5 years agoDon't enforce a native direction for Old Hungarian
David Corbett [Mon, 17 Sep 2018 15:09:51 +0000 (11:09 -0400)]
Don't enforce a native direction for Old Hungarian

5 years agoFix installation of cmake config when building with cmake (#1161)
Simon Hausmann [Mon, 17 Sep 2018 08:33:34 +0000 (10:33 +0200)]
Fix installation of cmake config when building with cmake (#1161)

When building with the auto tools, the manually mantained
harfbuzz-config.cmake is installed. When building with cmake, we can use
cmake to generate the correct config files for us and install them.

5 years agoRevert forcing use of single-parameter static_assert()
Behdad Esfahbod [Sun, 16 Sep 2018 17:33:48 +0000 (19:33 +0200)]
Revert forcing use of single-parameter static_assert()

Some clang versions define static_assert as a macro apparently, so we cannot
redefine it...

This reverts commit 94bfea0ce6a7b4d5641c198d50751748a353df11.
This reverts commit 4e62627831e7457ed60ff87712570065b14b200a.

5 years agoOne more bot fix
Behdad Esfahbod [Sun, 16 Sep 2018 17:25:19 +0000 (19:25 +0200)]
One more bot fix

5 years agoFix build, another try
Behdad Esfahbod [Sun, 16 Sep 2018 17:12:19 +0000 (19:12 +0200)]
Fix build, another try

5 years agoFix bots
Behdad Esfahbod [Sun, 16 Sep 2018 16:11:46 +0000 (18:11 +0200)]
Fix bots

"Unused private member" warning turned error.  ugh.

5 years agoEnforce single-param static_assert() only
Behdad Esfahbod [Sun, 16 Sep 2018 16:09:36 +0000 (18:09 +0200)]
Enforce single-param static_assert() only

So we don't accidentally break it again.

5 years agoRemove unused try
Behdad Esfahbod [Sun, 16 Sep 2018 16:01:32 +0000 (18:01 +0200)]
Remove unused try

5 years agoFix static_assert
Behdad Esfahbod [Sun, 16 Sep 2018 15:57:12 +0000 (17:57 +0200)]
Fix static_assert

5 years agoDisallow null-enabled offsets to unsized structures...
Behdad Esfahbod [Sat, 15 Sep 2018 17:43:33 +0000 (19:43 +0200)]
Disallow null-enabled offsets to unsized structures...

...like UnsizedArrayOf<>.

This fixes a class of crasher bugs, mostly with color and AAT tables.  We
cannot use nullable offsets to varsized data that does not declare min_size,
because it's nost safe to use our fixed-size null pool for types that have
their size external.  So, use non_null'able offsets for these.

A further enhancement would be to make use of min_size in Null<> itself.
Will try that after.

5 years ago[morx] Respect default feature settings
Behdad Esfahbod [Sat, 15 Sep 2018 16:31:14 +0000 (18:31 +0200)]
[morx] Respect default feature settings

Does NOT apply user-selected features.  But at least now enables
correct subtables.

5 years ago[aat] Change version field
Behdad Esfahbod [Sat, 15 Sep 2018 12:51:50 +0000 (14:51 +0200)]
[aat] Change version field

5 years ago[morx] Add stub for InsertionChain
Behdad Esfahbod [Sat, 15 Sep 2018 12:47:18 +0000 (14:47 +0200)]
[morx] Add stub for InsertionChain

5 years ago[dfont] Disable null-processsing for offsets
Behdad Esfahbod [Fri, 14 Sep 2018 16:59:53 +0000 (18:59 +0200)]
[dfont] Disable null-processsing for offsets

An offset to unsized arrayis not safe to be redirected to our fixed-sized
null pool.  Plus, we want to reject, not repair, bad-looking dfonts.

5 years ago[unicode] Move Fitzpatrick hack from ot-layout into unicode.hh
Behdad Esfahbod [Fri, 14 Sep 2018 12:23:09 +0000 (14:23 +0200)]
[unicode] Move Fitzpatrick hack from ot-layout into unicode.hh

5 years agoMinor
Behdad Esfahbod [Fri, 14 Sep 2018 10:15:53 +0000 (12:15 +0200)]
Minor

5 years agoFix builds
Behdad Esfahbod [Fri, 14 Sep 2018 10:14:42 +0000 (12:14 +0200)]
Fix builds

5 years ago[aat] Add enums for pre-defined state and classes
Behdad Esfahbod [Fri, 14 Sep 2018 09:31:33 +0000 (11:31 +0200)]
[aat] Add enums for pre-defined state and classes

Not sure how I didn't add before...

5 years agoDon't dereference offset before check_struct()
Behdad Esfahbod [Fri, 14 Sep 2018 08:58:00 +0000 (10:58 +0200)]
Don't dereference offset before check_struct()

5 years agoMerge branch 'master' into cff-subset
Michiharu Ariza [Thu, 13 Sep 2018 19:44:00 +0000 (12:44 -0700)]
Merge branch 'master' into cff-subset

5 years ago[dfont] Also check dataLen range in sanitize
Behdad Esfahbod [Thu, 13 Sep 2018 18:35:21 +0000 (20:35 +0200)]
[dfont] Also check dataLen range in sanitize

Just to disagree with myself re being done with this code...

5 years ago[dfont] Solve the mystery +2 offset thing!
Behdad Esfahbod [Thu, 13 Sep 2018 18:30:04 +0000 (20:30 +0200)]
[dfont] Solve the mystery +2 offset thing!

Previously, ResourceForkHeader was defined as 30 bytes, having the typeCountM1 as last member.
There was a mysterious offset-by-2 in the code, derived from FontTools and JDK code this was
ported from.

In testing, I observed that typeListZ offset is actually 28.  Suggesting that the typeCountM1
does NOT actually belong to ResourceForkHeader, but belongs to the array itself.  Adjusting for
that resolves the mystery +2 offset hack, so everything is clean and good now.

This, concludes my dfont hacking.  The code looks great now, and I'm happy to leave it.
Fuzzers might disagree though, we will see!

5 years agoRename HeadlessArrayOf::len to lenP1
Behdad Esfahbod [Thu, 13 Sep 2018 18:21:54 +0000 (20:21 +0200)]
Rename HeadlessArrayOf::len to lenP1

So it doesn't accidentally match our templates, etc.

5 years agoadd head table to CFF/CFF2
Michiharu Ariza [Thu, 13 Sep 2018 17:55:56 +0000 (10:55 -0700)]
add head table to CFF/CFF2

5 years ago[dfont] Some more
Behdad Esfahbod [Thu, 13 Sep 2018 17:19:57 +0000 (19:19 +0200)]
[dfont] Some more

5 years ago[dfont] Push methods further down
Behdad Esfahbod [Thu, 13 Sep 2018 17:13:01 +0000 (19:13 +0200)]
[dfont] Push methods further down

5 years ago[dfont] Minor
Behdad Esfahbod [Thu, 13 Sep 2018 17:08:22 +0000 (19:08 +0200)]
[dfont] Minor

5 years ago[dfon]t Sanitize OpenTypeFontFace
Behdad Esfahbod [Thu, 13 Sep 2018 17:05:59 +0000 (19:05 +0200)]
[dfon]t Sanitize OpenTypeFontFace

5 years ago[dfont] Minor
Behdad Esfahbod [Thu, 13 Sep 2018 16:49:16 +0000 (18:49 +0200)]
[dfont] Minor

5 years ago[dfont] Make test pass
Behdad Esfahbod [Thu, 13 Sep 2018 16:47:53 +0000 (18:47 +0200)]
[dfont] Make test pass

Offset 0 is not null in this context.

5 years agoAllow Offset<>'s that have no 0==null
Behdad Esfahbod [Thu, 13 Sep 2018 16:45:35 +0000 (18:45 +0200)]
Allow Offset<>'s that have no 0==null

5 years ago[dfont] Minor
Behdad Esfahbod [Thu, 13 Sep 2018 16:27:20 +0000 (18:27 +0200)]
[dfont] Minor

5 years ago[bytes] Rename content to arrayZ
Behdad Esfahbod [Thu, 13 Sep 2018 15:39:09 +0000 (17:39 +0200)]
[bytes] Rename content to arrayZ

5 years ago[dfont] Clean up sanitize()
Behdad Esfahbod [Thu, 13 Sep 2018 14:49:26 +0000 (16:49 +0200)]
[dfont] Clean up sanitize()

I don't think I broke anything.  Fuzzers will let me know..

5 years agoFix OffsetTo::sanitize() after reshuffling
Behdad Esfahbod [Thu, 13 Sep 2018 14:47:33 +0000 (16:47 +0200)]
Fix OffsetTo::sanitize() after reshuffling

5 years agoOffsetTo::sanitize() Add version with three user_data
Behdad Esfahbod [Thu, 13 Sep 2018 14:39:30 +0000 (16:39 +0200)]
OffsetTo::sanitize() Add version with three user_data

5 years agoOffsetTo::sanitize() more shuffling
Behdad Esfahbod [Thu, 13 Sep 2018 14:31:31 +0000 (16:31 +0200)]
OffsetTo::sanitize() more shuffling

5 years agoOffsetTo::sanitize() reshuffling
Behdad Esfahbod [Thu, 13 Sep 2018 14:29:49 +0000 (16:29 +0200)]
OffsetTo::sanitize() reshuffling

5 years agofixed hb_plan_subset_cff_fdselect
Michiharu Ariza [Thu, 13 Sep 2018 00:23:08 +0000 (17:23 -0700)]
fixed hb_plan_subset_cff_fdselect

FDSelect3/4 sentinel size wasn't taken into account

5 years agofixed serialize_fdselect_3_4
Michiharu Ariza [Wed, 12 Sep 2018 23:08:54 +0000 (16:08 -0700)]
fixed serialize_fdselect_3_4

5 years agofixed bugs in Charset serialization
Michiharu Ariza [Wed, 12 Sep 2018 20:22:19 +0000 (13:22 -0700)]
fixed bugs in Charset serialization

also some code cleanup

5 years agofixed name mixup in Remap::reset
Michiharu Ariza [Wed, 12 Sep 2018 05:41:50 +0000 (22:41 -0700)]
fixed name mixup in Remap::reset

it was causing inconsistent Strings Index subset results

5 years agomisc bug fixes
Michiharu Ariza [Tue, 11 Sep 2018 23:47:55 +0000 (16:47 -0700)]
misc bug fixes

Added OpCode_FontMatrix to TopDictOpSet (yet to parse values)
fixed a wrong assert in encode_int

5 years agofixed off-by-one error with offSize
Michiharu Ariza [Tue, 11 Sep 2018 23:20:39 +0000 (16:20 -0700)]
fixed off-by-one error with offSize

5 years agofixed a bug
Michiharu Ariza [Tue, 11 Sep 2018 20:56:52 +0000 (13:56 -0700)]
fixed a bug

5 years agomake parse_bcd locale free
Michiharu Ariza [Tue, 11 Sep 2018 20:24:27 +0000 (13:24 -0700)]
make parse_bcd locale free

5 years agoImplement parse_bcd
Michiharu Ariza [Tue, 11 Sep 2018 17:43:15 +0000 (10:43 -0700)]
Implement parse_bcd

5 years agoMerge branch 'master' into cff-subset
Michiharu Ariza [Tue, 11 Sep 2018 16:46:37 +0000 (09:46 -0700)]
Merge branch 'master' into cff-subset

5 years ago[dfont] Some renaming, plus add link to reference doc
Behdad Esfahbod [Tue, 11 Sep 2018 16:12:26 +0000 (18:12 +0200)]
[dfont] Some renaming, plus add link to reference doc

5 years ago[dfont] Sanitize only sfnt resources as OpenTypeFontFile
Behdad Esfahbod [Tue, 11 Sep 2018 15:56:03 +0000 (17:56 +0200)]
[dfont] Sanitize only sfnt resources as OpenTypeFontFile

5 years ago[dfont] Minor
Behdad Esfahbod [Tue, 11 Sep 2018 15:26:24 +0000 (17:26 +0200)]
[dfont] Minor

5 years ago[dfont] Fix test expecatation and minor touch up
Behdad Esfahbod [Tue, 11 Sep 2018 15:18:21 +0000 (17:18 +0200)]
[dfont] Fix test expecatation and minor touch up

I have no way to authoritatively know, but looks like test font only has one
face.  So, adjust test expectation instead.

5 years ago[dfont] Add test
Ebrahim Byagowi [Mon, 2 Jul 2018 12:56:43 +0000 (17:26 +0430)]
[dfont] Add test

5 years ago[dfont] Re-enable and fix offset handling
Behdad Esfahbod [Tue, 11 Sep 2018 14:41:26 +0000 (16:41 +0200)]
[dfont] Re-enable and fix offset handling

Fixes https://github.com/harfbuzz/harfbuzz/pull/1085

5 years agoWhitespace
Behdad Esfahbod [Tue, 11 Sep 2018 12:45:23 +0000 (14:45 +0200)]
Whitespace

5 years ago[ft] Invalidate advance cache if font size changed
Behdad Esfahbod [Tue, 11 Sep 2018 12:41:19 +0000 (14:41 +0200)]
[ft] Invalidate advance cache if font size changed

5 years ago[ft] Cache advances
Behdad Esfahbod [Tue, 11 Sep 2018 12:35:26 +0000 (14:35 +0200)]
[ft] Cache advances

I decided to always use the cache, instead of my previous sketch direction
that was to only allocate and use cache if fast advances are not available.
The cache is a mere 1kb, so just use it...

TODO: Invalidate cache on font size change.

Fixes https://github.com/harfbuzz/harfbuzz/issues/651
Fixes https://github.com/harfbuzz/harfbuzz/pull/1082

5 years ago[util] Add --ft-load-flags
Behdad Esfahbod [Tue, 11 Sep 2018 12:21:15 +0000 (14:21 +0200)]
[util] Add --ft-load-flags

Useful for performance testing.

Not hooked to cairo yet.  Just changes shaping, not rasterization.

5 years ago[util] Add -n shorthand for --num-iterations
Behdad Esfahbod [Tue, 11 Sep 2018 12:11:10 +0000 (14:11 +0200)]
[util] Add -n shorthand for --num-iterations

Meh.