Commit Graph

358 Commits

Author SHA1 Message Date
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
Behdad Esfahbod 74b4df2cde [ot] Move GDEF into tables_t 2018-08-03 16:58:05 -07:00
Behdad Esfahbod 0271c7ab3b [ot] Move GSUB/GPOS into tables_t 2018-08-03 16:45:57 -07:00
Behdad Esfahbod f73d2775cf [ot] More shuffling
Misc. table loading now properly automated.
2018-08-03 16:34:25 -07:00
Behdad Esfahbod 52fbd23d86 [ot] Minor 2018-08-03 16:22:16 -07:00
Behdad Esfahbod 6a0a298aab [ot] Move code around 2018-08-02 23:13:19 -07:00
Behdad Esfahbod 5e718a751e [ot] Use switch for checking for blacklisted GDEF tables
Faster / more compact code.
2018-08-02 23:04:42 -07:00
Behdad Esfahbod b5cdf5280d [ot] In GDEF blacklisting logic, remove the glyph index check for Times
Just blacklist based on table sizes like we do for other fonts.
2018-08-02 22:56:42 -07:00
Behdad Esfahbod ff7826e90b Reduce storage by sharing face amongst lazy_loaders 2018-08-02 01:29:05 -07:00
Behdad Esfahbod ed7b2e58fc Remove OT namespace from hb-machinery-private.hh 2018-08-02 00:08:08 -07:00
Behdad Esfahbod 44d1fb37ef 1.8.5 2018-08-01 14:51:51 -07:00
Ebrahim Byagowi 1a7fed6318
Revert "Add a new API, hb_ot_layout_get_feature_name_ids (#976)" (#1121)
This reverts commit 0c1b287b72.
2018-08-01 12:15:44 +04:30
Garret Rieger 89733755a4 [subset] use add_array to populate feature_indexes.
This is much faster then calling a bunch of individual add()'s.
2018-07-31 18:26:09 -07:00
Garret Rieger 7d92bef9c5 [subset] collect features first, then use those to collect lookups. 2018-07-31 18:26:09 -07:00
Garret Rieger 5edf454aa6 [subset] During lookup collection remember the features we've already processed. 2018-07-27 17:29:00 -07:00
Garret Rieger 85646fdadb [subset] Limit the iterations of the closure algorithm.
Prevents O(n^2) run times.
2018-07-23 16:01:57 -07:00
Behdad Esfahbod 9583e0077d Port more off of Sanitizer<> 2018-07-22 22:43:25 -07:00
Ebrahim Byagowi 0c1b287b72
Add a new API, hb_ot_layout_get_feature_name_ids (#976)
This new API returns cvXX and ssXX related NameId, things like
featUiLabelNameId, featUiTooltipTextNameId, sampleTextNameId, ... of cvXX
and UINameId of ssXX, in a unified way.

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-07-21 21:14:48 +04:30
Behdad Esfahbod db5d430eff [aat] Update for blob changes
Also, uncomment code again, just "if (0)" it out, so it doesn't get stale again.
2018-07-17 18:14:45 +02:00