Commit Graph

376 Commits

Author SHA1 Message Date
Behdad Esfahbod 949dad89a8 [kern] Remove accelerator
It wasn't doing anything.
2018-11-02 12:47:55 -04:00
Ebrahim Byagowi c32280b30f
[ot-layout] minor 2018-11-01 15:31:14 +03:30
Behdad Esfahbod bfd549daaa Fix everything-bot 2018-10-30 14:47:27 -07:00
Garret Rieger 0e1ad5a075 [subset] Limit the number of scripts and langsys' that should be checked when collecting features. 2018-10-30 14:15:58 -07:00
Behdad Esfahbod a7aba99baa [name] Rename hb_name_id_t to hb_ot_name_id_t
https://github.com/harfbuzz/harfbuzz/pull/1254
2018-10-30 14:04:09 -07:00
Behdad Esfahbod 3a4e5dd425 Remove a few unnecessary hb_auto_t<>'s
See a85641446c30247c4e948263f0f8c1147ed4efb9
2018-10-29 22:27:20 -07:00
Behdad Esfahbod 6ce49a921a [name] Change hb_name_id_t back to unsigned int
d941f66c75 (commitcomment-31076011)
2018-10-28 08:26:30 -07:00
Behdad Esfahbod 80d9a427cf [docs] Document remaining sections 2018-10-27 04:58:32 -07:00
Ebrahim Byagowi 524e854c15
Merge pull request #1318 from ebraminio/png
Add a non-hooked _png _svg get emoji blob
2018-10-27 15:04:43 +03:30
Behdad Esfahbod d941f66c75 [name] Make hb_name_id_t be the enum
This is like hb_script_t.

We had this exposed as unsigned int since 2.0.0 release in two APIs,
as well as hb_ot_layout_get_size_params() from earlier.
But since no one uses those (right?!), let's just fix this now.
2018-10-27 03:06:14 -07:00
Behdad Esfahbod 4025ad8043 Document new API 2018-10-27 03:06:14 -07:00
Ebrahim Byagowi c7a4e3dfb5 [svg] Add public API
* hb_ot_color_has_svg
* hb_ot_color_glyph_svg_create_blob
2018-10-26 09:16:44 +03:30
Behdad Esfahbod e98af6d1ed [layout] Try to speed up collect_lookups some more
Barely made a dent :(.
2018-10-25 22:25:29 -07:00
Behdad Esfahbod eb44bfc864 [layout] Memoize collect_features
Fixes https://github.com/harfbuzz/harfbuzz/pull/1317
Fixes https://oss-fuzz.com/v2/testcase-detail/6543700493598720
2018-10-25 22:15:11 -07:00
Behdad Esfahbod 941600a9e0 [layout] Add hb_collect_features_context_t
Towards https://github.com/harfbuzz/harfbuzz/pull/1317
2018-10-25 21:26:56 -07:00
Behdad Esfahbod c237cdfcc7 [lookup] Fold another function inline 2018-10-25 21:17:30 -07:00
Behdad Esfahbod fe5520ddea [layout] More prep work to memoize collect_features() work 2018-10-25 21:14:32 -07:00
Behdad Esfahbod e8e67503ff [lookup] More prep work for memoizing collect_features
https://github.com/harfbuzz/harfbuzz/pull/1317
2018-10-25 20:48:20 -07:00
Behdad Esfahbod 96828b97a8 [layout] Minor
We were returning the accelerator's lookup count.  Returns table's.
They are the same except for OOM cases.  Just shorter code.
2018-10-25 20:34:29 -07:00
Behdad Esfahbod 73449cd213 [layout] Fold one function inline
Preparation for fixing https://github.com/harfbuzz/harfbuzz/pull/1317
2018-10-25 20:32:05 -07:00
Behdad Esfahbod a5ad8c658d [docs] More fixes 2018-10-20 16:52:55 -07:00
Behdad Esfahbod 3d9a0306eb 2.0.0 2018-10-18 05:58:17 -07:00
HinTak 49bdb54427 typo in gobject annotation - "in/out" should be "inout"
"in/out" should be "inout"
2018-10-16 16:41:12 -07:00
Ebrahim Byagowi 63109432cf Cosmetic and minor changes 2018-10-13 07:23:33 -04:00
Behdad Esfahbod c0a6814b49 Touch up new API
New API:
+hb_ot_layout_feature_get_name_ids()
+hb_ot_layout_feature_get_characters()
2018-10-12 16:06:39 -04:00
Ebrahim Byagowi dc49bd8d81 Add two APIs for getting stylistic set labels
* hb_ot_layout_feature_get_characters
* hb_ot_layout_feature_get_name_ids

However HarfBuzz currently doesn't expose an API for retrieving the actual
information associated with NameId from the `name` table and that should be
done separately.
2018-10-12 16:06:39 -04:00
Behdad Esfahbod 8061664ad1 Add doc stubs for recently added API
Thanks to David Corbett who revamped our script and language processing
and implemented full BCP 47 support.

https://github.com/harfbuzz/harfbuzz/pull/730

New API:
+hb_ot_layout_table_select_script()
+hb_ot_layout_script_select_language()
+HB_OT_MAX_TAGS_PER_SCRIPT
+HB_OT_MAX_TAGS_PER_LANGUAGE
+hb_ot_tags_from_script_and_language()
+hb_ot_tags_to_script_and_language()

Deprecated API:
-hb_ot_layout_table_choose_script()
-hb_ot_layout_script_find_language()
-hb_ot_tags_from_script()
-hb_ot_tag_from_language()
2018-10-11 14:17:17 -04:00
Behdad Esfahbod cf975ac653 Remove use of deprecated function 2018-10-11 14:07:44 -04:00
David Corbett 91067716f5 Refactor the selection of script and language tags
The old hb-ot-tag.cc functions, `hb_ot_tags_from_script` and
`hb_ot_tag_from_language`, are now wrappers around a new function:
`hb_ot_tags`. It converts a script and a language to arrays of script
tags and language tags. This will make it easier to add new script tags
to scripts, like 'dev3'. It also allows for language fallback chains;
nothing produces more than one language yet though.

Where the old functions return the default tags 'DFLT' and 'dflt',
`hb_ot_tags` returns an empty array. The caller is responsible for
using the default tag in that case.

The new function also adds a new private use subtag syntax for script
overrides: "x-hbscabcd" requests a script tag of 'abcd'.

The old hb-ot-layout.cc functions,`hb_ot_layout_table_choose_script` and
`hb_ot_layout_script_find_language` are now wrappers around the new
functions `hb_ot_layout_table_select_script` and
`hb_ot_layout_script_select_language`. They are essentially the same as
the old ones plus a tag count parameter.

Closes #495.
2018-10-11 13:54:28 -04:00
Behdad Esfahbod e78549edfb Move apply down into subtables accel 2018-10-10 11:54:48 -04:00
Behdad Esfahbod 78c09bf213 Move subtable array into lookup accel 2018-10-10 11:50:46 -04:00
Behdad Esfahbod 97e5913d5a Move more code 2018-10-10 11:41:05 -04:00
Behdad Esfahbod c8f2d9334c Move code
In preparation to move add per-subtable set digests...
2018-10-10 11:36:28 -04:00
Behdad Esfahbod a51958819f Apply TrueType/OpenType kern table when GPOS kern feature is not available
Fixes https://github.com/harfbuzz/harfbuzz/issues/250
2018-10-08 23:57:45 -04:00
Behdad Esfahbod 606bf57430 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 94bfea0ce6.
This reverts commit 4e62627831.
2018-09-16 19:34:39 +02:00
Behdad Esfahbod 4e62627831 Enforce single-param static_assert() only
So we don't accidentally break it again.
2018-09-16 18:09:36 +02:00
David Corbett b545e27d88 Don't seed the RNG from the contents of the buffer 2018-09-11 10:47:59 +02:00
David Corbett c2a75e07e5 Implement 'rand' 2018-09-11 10:47:59 +02:00
Behdad Esfahbod fda994e1d4 Use enum instead of "static const" in class scope
Technically, static const needs an out-of-class definition.  Eg:

  CXXLD    libharfbuzz-subset.la
Undefined symbols for architecture x86_64:
  "OT::FeatureVariationRecord::min_size", referenced from:
      bool OT::GSUBGPOS::subset<OT::PosLookup>(hb_subset_context_t*) constin libharfbuzz_subset_la-hb-subset.o
      bool OT::GSUBGPOS::subset<OT::SubstLookup>(hb_subset_context_t*) constin libharfbuzz_subset_la-hb-subset.o
  "OT::Record<OT::LangSys>::min_size", referenced from:
      OT::Script::subset(hb_subset_context_t*) constin libharfbuzz_subset_la-hb-subset.o
  "OT::IntType<unsigned short, 2u>::min_size", referenced from:
      OT::Script::subset(hb_subset_context_t*) constin libharfbuzz_subset_la-hb-subset.o
      OT::RecordListOf<OT::Feature>::subset(hb_subset_context_t*) const  in libharfbuzz_subset_la-hb-subset.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[4]: *** [libharfbuzz-subset.la] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Exited with code 2
2018-09-07 15:02:57 -04:00
Behdad Esfahbod fee0f41c6c Don't declare extern symbols as inline
clang -O3 was completely removing _get_gdef(), causing link
failure when needed from another compilation unit.  Surprisingly,
"extern inline" didn't fix it.
2018-08-28 18:27:41 -07:00
Behdad Esfahbod a268068010 [ot-face] Remove tables_t. The face_data_t is what tables_t was 2018-08-26 15:18:46 -07:00
Behdad Esfahbod c624e18a24 [OT] Move code around 2018-08-26 09:19:20 -07:00
Behdad Esfahbod 3999094682 [OT] Use relaxed ops for recursing into GSUB/GPOS lookups again 2018-08-26 09:12:25 -07:00
Behdad Esfahbod d8c57e85d9 [GDEF] Move code around 2018-08-26 09:04:34 -07:00
Behdad Esfahbod 4096fbe487 [ot-face] Port GDEF to unified table accelerator model as well 2018-08-26 01:25:54 -07:00
Behdad Esfahbod b929100f87 [ot-face] Unify GSUB/GPOS accelerators in the table accelerator framework 2018-08-26 01:15:47 -07:00
Behdad Esfahbod d950022c8a Add hb-ot-face.cc/hh 2018-08-25 23:06:37 -07:00
Behdad Esfahbod c77ae40852 Rename hb-*private.hh to hb-*.hh
Sorry for the noise, downstream custom builders.  Please adjust.
2018-08-25 22:36:36 -07:00
Behdad Esfahbod 1c6b369324 [ot] Rename hb_ot_layout_t to hb_ot_face_data_t 2018-08-23 11:30:21 -07:00
Behdad Esfahbod b912fbea17 Remove most uses of direct comparison to Null objects 2018-08-06 06:38:59 -07:00