[HarfBuzz] harfbuzz: Branch 'master' - 27 commits

Behdad Esfahbod behdad at kemper.freedesktop.org
Mon Aug 27 17:19:42 UTC 2018


 docs/harfbuzz-sections.txt                      |    4 
 src/Makefile.sources                            |   77 ++++-----
 src/check-includes.sh                           |    8 
 src/dump-indic-data.cc                          |    2 
 src/dump-khmer-data.cc                          |    2 
 src/dump-myanmar-data.cc                        |    2 
 src/dump-use-data.cc                            |    2 
 src/gen-indic-table.py                          |    2 
 src/gen-use-table.py                            |    2 
 src/hb-aat-layout-ankr-table.hh                 |    2 
 src/hb-aat-layout-bsln-table.hh                 |    2 
 src/hb-aat-layout-common.hh                     |    8 
 src/hb-aat-layout-feat-table.hh                 |    2 
 src/hb-aat-layout-kerx-table.hh                 |    4 
 src/hb-aat-layout-morx-table.hh                 |    6 
 src/hb-aat-layout-trak-table.hh                 |    6 
 src/hb-aat-layout.cc                            |   12 -
 src/hb-aat-layout.hh                            |   14 -
 src/hb-aat-ltag-table.hh                        |    2 
 src/hb-atomic.hh                                |    8 
 src/hb-blob.cc                                  |    4 
 src/hb-blob.hh                                  |    8 
 src/hb-buffer-deserialize-json.hh               |    2 
 src/hb-buffer-deserialize-json.rl               |    2 
 src/hb-buffer-deserialize-text.hh               |    2 
 src/hb-buffer-deserialize-text.rl               |    2 
 src/hb-buffer-serialize.cc                      |    2 
 src/hb-buffer.cc                                |    4 
 src/hb-buffer.hh                                |   10 -
 src/hb-common.cc                                |    4 
 src/hb-coretext.cc                              |    4 
 src/hb-debug.hh                                 |    4 
 src/hb-directwrite.cc                           |    4 
 src/hb-dsalgs.hh                                |    3 
 src/hb-face.cc                                  |   68 +++++++-
 src/hb-face.h                                   |   19 ++
 src/hb-face.hh                                  |   12 -
 src/hb-fallback-shape.cc                        |    2 
 src/hb-font.cc                                  |    6 
 src/hb-font.hh                                  |   12 -
 src/hb-ft.cc                                    |    6 
 src/hb-glib.cc                                  |    6 
 src/hb-gobject-enums.cc.tmpl                    |    2 
 src/hb-gobject-structs.cc                       |    2 
 src/hb-graphite2.cc                             |    2 
 src/hb-icu.cc                                   |    6 
 src/hb-iter.hh                                  |    8 
 src/hb-machinery.hh                             |   21 +-
 src/hb-map.cc                                   |    2 
 src/hb-map.hh                                   |    8 
 src/hb-mutex.hh                                 |    8 
 src/hb-null.hh                                  |    2 
 src/hb-object.hh                                |   14 -
 src/hb-open-file.hh                             |    8 
 src/hb-open-type.hh                             |   14 -
 src/hb-ot-cmap-table.hh                         |   43 +++--
 src/hb-ot-color-cbdt-table.hh                   |    4 
 src/hb-ot-color-colr-table.hh                   |    2 
 src/hb-ot-color-cpal-table.hh                   |    2 
 src/hb-ot-color-sbix-table.hh                   |    2 
 src/hb-ot-color-svg-table.hh                    |    2 
 src/hb-ot-color.cc                              |    6 
 src/hb-ot-face.cc                               |   76 +++++++++
 src/hb-ot-face.hh                               |  116 ++++++++++++++
 src/hb-ot-font.cc                               |  130 ++++------------
 src/hb-ot-glyf-table.hh                         |    6 
 src/hb-ot-hdmx-table.hh                         |    2 
 src/hb-ot-head-table.hh                         |    2 
 src/hb-ot-hhea-table.hh                         |    2 
 src/hb-ot-hmtx-table.hh                         |    5 
 src/hb-ot-kern-table.hh                         |    4 
 src/hb-ot-layout-base-table.hh                  |    4 
 src/hb-ot-layout-common.hh                      |   79 ++++++---
 src/hb-ot-layout-gdef-table.hh                  |   18 +-
 src/hb-ot-layout-gpos-table.hh                  |   10 -
 src/hb-ot-layout-gsub-table.hh                  |   57 +------
 src/hb-ot-layout-gsubgpos.hh                    |   52 +++++-
 src/hb-ot-layout-jstf-table.hh                  |    2 
 src/hb-ot-layout.cc                             |  194 ++++++++++--------------
 src/hb-ot-layout.hh                             |  151 ++++--------------
 src/hb-ot-map.cc                                |    4 
 src/hb-ot-map.hh                                |    8 
 src/hb-ot-math-table.hh                         |    4 
 src/hb-ot-math.cc                               |    8 
 src/hb-ot-maxp-table.hh                         |    2 
 src/hb-ot-name-table.hh                         |    2 
 src/hb-ot-os2-table.hh                          |    2 
 src/hb-ot-os2-unicode-ranges.hh                 |    2 
 src/hb-ot-post-macroman.hh                      |    2 
 src/hb-ot-post-table.hh                         |    4 
 src/hb-ot-shape-complex-arabic-fallback.hh      |    4 
 src/hb-ot-shape-complex-arabic-win1256.hh       |    2 
 src/hb-ot-shape-complex-arabic.cc               |    6 
 src/hb-ot-shape-complex-arabic.hh               |   10 -
 src/hb-ot-shape-complex-default.cc              |    2 
 src/hb-ot-shape-complex-hangul.cc               |    2 
 src/hb-ot-shape-complex-hebrew.cc               |    2 
 src/hb-ot-shape-complex-indic-machine.hh        |    2 
 src/hb-ot-shape-complex-indic-machine.rl        |    2 
 src/hb-ot-shape-complex-indic-table.cc          |    2 
 src/hb-ot-shape-complex-indic.cc                |    4 
 src/hb-ot-shape-complex-indic.hh                |   12 -
 src/hb-ot-shape-complex-khmer-machine.hh        |    2 
 src/hb-ot-shape-complex-khmer-machine.rl        |    2 
 src/hb-ot-shape-complex-khmer.cc                |    4 
 src/hb-ot-shape-complex-khmer.hh                |   10 -
 src/hb-ot-shape-complex-myanmar-machine.hh      |    2 
 src/hb-ot-shape-complex-myanmar-machine.rl      |    2 
 src/hb-ot-shape-complex-myanmar.cc              |    2 
 src/hb-ot-shape-complex-myanmar.hh              |   10 -
 src/hb-ot-shape-complex-thai.cc                 |    2 
 src/hb-ot-shape-complex-tibetan.cc              |    2 
 src/hb-ot-shape-complex-use-machine.hh          |    2 
 src/hb-ot-shape-complex-use-machine.rl          |    2 
 src/hb-ot-shape-complex-use-table.cc            |    2 
 src/hb-ot-shape-complex-use.cc                  |    4 
 src/hb-ot-shape-complex-use.hh                  |   10 -
 src/hb-ot-shape-complex.hh                      |   12 -
 src/hb-ot-shape-fallback.cc                     |    4 
 src/hb-ot-shape-fallback.hh                     |   10 -
 src/hb-ot-shape-normalize.cc                    |    6 
 src/hb-ot-shape-normalize.hh                    |    8 
 src/hb-ot-shape.cc                              |   21 +-
 src/hb-ot-shape.hh                              |   12 -
 src/hb-ot-tag.cc                                |    2 
 src/hb-ot-var-avar-table.hh                     |    2 
 src/hb-ot-var-fvar-table.hh                     |    2 
 src/hb-ot-var-hvar-table.hh                     |    2 
 src/hb-ot-var-mvar-table.hh                     |    2 
 src/hb-ot-var.cc                                |    8 
 src/hb-set-digest.hh                            |    8 
 src/hb-set.cc                                   |    2 
 src/hb-set.hh                                   |    8 
 src/hb-shape-plan.cc                            |   10 -
 src/hb-shape-plan.hh                            |   10 -
 src/hb-shape.cc                                 |   12 -
 src/hb-shaper-impl.hh                           |   16 -
 src/hb-shaper.cc                                |    6 
 src/hb-shaper.hh                                |    8 
 src/hb-static.cc                                |    8 
 src/hb-string-array.hh                          |    2 
 src/hb-subset-glyf.cc                           |    2 
 src/hb-subset-glyf.hh                           |    2 
 src/hb-subset-input.cc                          |    4 
 src/hb-subset-plan.cc                           |    6 
 src/hb-subset-plan.hh                           |    6 
 src/hb-subset.cc                                |   67 --------
 src/hb-subset.h                                 |   15 -
 src/hb-subset.hh                                |   13 -
 src/hb-ucdn.cc                                  |    6 
 src/hb-unicode.cc                               |    6 
 src/hb-unicode.h                                |    3 
 src/hb-unicode.hh                               |    8 
 src/hb-uniscribe.cc                             |    6 
 src/hb-utf.hh                                   |    8 
 src/hb-vector.hh                                |    8 
 src/hb-warning.cc                               |    6 
 src/hb.hh                                       |   12 -
 src/main.cc                                     |    4 
 src/test-buffer-serialize.cc                    |    2 
 src/test-size-params.cc                         |    2 
 src/test-unicode-ranges.cc                      |    2 
 src/test-would-substitute.cc                    |    2 
 src/test.cc                                     |    2 
 test/api/test-common.c                          |    1 
 test/api/test-subset-codepoints.c               |    6 
 test/fuzzing/hb-subset-get-codepoints-fuzzer.cc |    2 
 test/shaping/data/in-house/tests/vertical.tests |    2 
 util/Makefile.am                                |    4 
 util/ansi-print.hh                              |    3 
 util/hb-subset.cc                               |    2 
 util/helper-cairo-ansi.hh                       |    2 
 util/helper-cairo.hh                            |    2 
 util/main-font-text.hh                          |    2 
 util/options.hh                                 |    2 
 util/shape-consumer.hh                          |    2 
 util/view-cairo.hh                              |    2 
 177 files changed, 1046 insertions(+), 926 deletions(-)

New commits:
commit a26806801005c28115ae9e48bdcf3bbbc1bcd767
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sun Aug 26 15:18:46 2018 -0700

    [ot-face] Remove tables_t. The face_data_t is what tables_t was

diff --git a/src/hb-aat-layout.cc b/src/hb-aat-layout.cc
index c481e6a8..a5e36a40 100644
--- a/src/hb-aat-layout.cc
+++ b/src/hb-aat-layout.cc
@@ -49,9 +49,9 @@ _get_morx (hb_face_t *face, hb_blob_t **blob = nullptr)
       *blob = hb_blob_get_empty ();
     return Null(AAT::morx);
   }
-  const AAT::morx& morx = *(hb_ot_face_data (face)->table.morx.get ());
+  const AAT::morx& morx = *(hb_ot_face_data (face)->morx.get ());
   if (blob)
-    *blob = hb_ot_face_data (face)->table.morx.get_blob ();
+    *blob = hb_ot_face_data (face)->morx.get_blob ();
   return morx;
 }
 
diff --git a/src/hb-face.cc b/src/hb-face.cc
index ddf8e488..2fb5a0a3 100644
--- a/src/hb-face.cc
+++ b/src/hb-face.cc
@@ -533,7 +533,7 @@ hb_face_collect_unicodes (hb_face_t *face,
 			  hb_set_t  *out)
 {
   if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return;
-  hb_ot_face_data (face)->table.cmap->collect_unicodes (out);
+  hb_ot_face_data (face)->cmap->collect_unicodes (out);
 }
 
 /**
@@ -550,7 +550,7 @@ hb_face_collect_variation_selectors (hb_face_t *face,
 				     hb_set_t  *out)
 {
   if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return;
-  hb_ot_face_data (face)->table.cmap->collect_variation_selectors (out);
+  hb_ot_face_data (face)->cmap->collect_variation_selectors (out);
 }
 
 /**
@@ -568,7 +568,7 @@ hb_face_collect_variation_unicodes (hb_face_t *face,
 				    hb_set_t  *out)
 {
   if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return;
-  hb_ot_face_data (face)->table.cmap->collect_variation_unicodes (variation_selector, out);
+  hb_ot_face_data (face)->cmap->collect_variation_unicodes (variation_selector, out);
 }
 
 
diff --git a/src/hb-ot-face.cc b/src/hb-ot-face.cc
index c6c4ff9e..388a5972 100644
--- a/src/hb-ot-face.cc
+++ b/src/hb-ot-face.cc
@@ -37,7 +37,7 @@
 #include "hb-ot-layout-gpos-table.hh"
 
 
-void hb_ot_face_data_t::tables_t::init0 (hb_face_t *face)
+void hb_ot_face_data_t::init0 (hb_face_t *face)
 {
   this->face = face;
 #define HB_OT_LAYOUT_TABLE(Namespace, Type) Type.init0 ();
@@ -46,7 +46,7 @@ void hb_ot_face_data_t::tables_t::init0 (hb_face_t *face)
 #undef HB_OT_LAYOUT_ACCELERATOR
 #undef HB_OT_LAYOUT_TABLE
 }
-void hb_ot_face_data_t::tables_t::fini (void)
+void hb_ot_face_data_t::fini (void)
 {
 #define HB_OT_LAYOUT_TABLE(Namespace, Type) Type.fini ();
 #define HB_OT_LAYOUT_ACCELERATOR(Namespace, Type) HB_OT_LAYOUT_TABLE (Namespace, Type)
@@ -62,7 +62,7 @@ _hb_ot_face_data_create (hb_face_t *face)
   if (unlikely (!data))
     return nullptr;
 
-  data->table.init0 (face);
+  data->init0 (face);
 
   return data;
 }
@@ -70,7 +70,7 @@ _hb_ot_face_data_create (hb_face_t *face)
 void
 _hb_ot_face_data_destroy (hb_ot_face_data_t *data)
 {
-  data->table.fini ();
+  data->fini ();
   free (data);
 }
 
diff --git a/src/hb-ot-face.hh b/src/hb-ot-face.hh
index 765627de..5ac3538e 100644
--- a/src/hb-ot-face.hh
+++ b/src/hb-ot-face.hh
@@ -80,33 +80,29 @@ HB_OT_LAYOUT_TABLES
 
 struct hb_ot_face_data_t
 {
-  /* All the president's tables. */
-  struct tables_t
-  {
-    HB_INTERNAL void init0 (hb_face_t *face);
-    HB_INTERNAL void fini (void);
+  HB_INTERNAL void init0 (hb_face_t *face);
+  HB_INTERNAL void fini (void);
 
 #define HB_OT_LAYOUT_TABLE_ORDER(Namespace, Type) \
-      HB_PASTE (ORDER_, HB_PASTE (Namespace, HB_PASTE (_, Type)))
-    enum order_t
-    {
-      ORDER_ZERO,
+    HB_PASTE (ORDER_, HB_PASTE (Namespace, HB_PASTE (_, Type)))
+  enum order_t
+  {
+    ORDER_ZERO,
 #define HB_OT_LAYOUT_TABLE(Namespace, Type) HB_OT_LAYOUT_TABLE_ORDER (Namespace, Type),
 #define HB_OT_LAYOUT_ACCELERATOR(Namespace, Type) HB_OT_LAYOUT_TABLE (Namespace, Type)
-      HB_OT_LAYOUT_TABLES
+    HB_OT_LAYOUT_TABLES
 #undef HB_OT_LAYOUT_ACCELERATOR
 #undef HB_OT_LAYOUT_TABLE
-    };
+  };
 
-    hb_face_t *face; /* MUST be JUST before the lazy loaders. */
+  hb_face_t *face; /* MUST be JUST before the lazy loaders. */
 #define HB_OT_LAYOUT_TABLE(Namespace, Type) \
-    hb_table_lazy_loader_t<Namespace::Type, HB_OT_LAYOUT_TABLE_ORDER (Namespace, Type)> Type;
+  hb_table_lazy_loader_t<Namespace::Type, HB_OT_LAYOUT_TABLE_ORDER (Namespace, Type)> Type;
 #define HB_OT_LAYOUT_ACCELERATOR(Namespace, Type) \
-    hb_face_lazy_loader_t<Namespace::Type##_accelerator_t, HB_OT_LAYOUT_TABLE_ORDER (Namespace, Type)> Type;
-    HB_OT_LAYOUT_TABLES
+  hb_face_lazy_loader_t<Namespace::Type##_accelerator_t, HB_OT_LAYOUT_TABLE_ORDER (Namespace, Type)> Type;
+  HB_OT_LAYOUT_TABLES
 #undef HB_OT_LAYOUT_ACCELERATOR
 #undef HB_OT_LAYOUT_TABLE
-  } table;
 };
 
 
diff --git a/src/hb-ot-font.cc b/src/hb-ot-font.cc
index e441aad4..a4c5584f 100644
--- a/src/hb-ot-font.cc
+++ b/src/hb-ot-font.cc
@@ -40,9 +40,6 @@
 #include "hb-ot-color-cbdt-table.hh"
 
 
-typedef hb_ot_face_data_t::tables_t hb_ot_font_t;
-
-
 static hb_bool_t
 hb_ot_get_nominal_glyph (hb_font_t *font HB_UNUSED,
 			 void *font_data,
@@ -51,7 +48,7 @@ hb_ot_get_nominal_glyph (hb_font_t *font HB_UNUSED,
 			 void *user_data HB_UNUSED)
 
 {
-  const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
+  const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data;
   return ot_font->cmap.get_relaxed()->get_nominal_glyph (unicode, glyph);
 }
 
@@ -63,7 +60,7 @@ hb_ot_get_variation_glyph (hb_font_t *font HB_UNUSED,
 			   hb_codepoint_t *glyph,
 			   void *user_data HB_UNUSED)
 {
-  const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
+  const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data;
   return ot_font->cmap.get_relaxed ()->get_variation_glyph (unicode, variation_selector, glyph);
 }
 
@@ -73,7 +70,7 @@ hb_ot_get_glyph_h_advance (hb_font_t *font,
 			   hb_codepoint_t glyph,
 			   void *user_data HB_UNUSED)
 {
-  const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
+  const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data;
   return font->em_scale_x (ot_font->hmtx.get_relaxed ()->get_advance (glyph, font));
 }
 
@@ -83,7 +80,7 @@ hb_ot_get_glyph_v_advance (hb_font_t *font,
 			   hb_codepoint_t glyph,
 			   void *user_data HB_UNUSED)
 {
-  const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
+  const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data;
   return font->em_scale_y (-(int) ot_font->vmtx.get_relaxed ()->get_advance (glyph, font));
 }
 
@@ -94,7 +91,7 @@ hb_ot_get_glyph_h_kerning (hb_font_t *font,
 			   hb_codepoint_t right_glyph,
 			   void *user_data HB_UNUSED)
 {
-  const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
+  const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data;
   return font->em_scale_x (ot_font->kern->get_h_kerning (left_glyph, right_glyph));
 }
 
@@ -105,7 +102,7 @@ hb_ot_get_glyph_extents (hb_font_t *font,
 			 hb_glyph_extents_t *extents,
 			 void *user_data HB_UNUSED)
 {
-  const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
+  const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data;
   bool ret = ot_font->glyf->get_extents (glyph, extents);
   if (!ret)
     ret = ot_font->CBDT->get_extents (glyph, extents);
@@ -124,7 +121,7 @@ hb_ot_get_glyph_name (hb_font_t *font HB_UNUSED,
                       char *name, unsigned int size,
                       void *user_data HB_UNUSED)
 {
-  const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
+  const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data;
   return ot_font->post->get_glyph_name (glyph, name, size);
 }
 
@@ -135,7 +132,7 @@ hb_ot_get_glyph_from_name (hb_font_t *font HB_UNUSED,
                            hb_codepoint_t *glyph,
                            void *user_data HB_UNUSED)
 {
-  const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
+  const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data;
   return ot_font->post->get_glyph_from_name (name, len, glyph);
 }
 
@@ -145,7 +142,7 @@ hb_ot_get_font_h_extents (hb_font_t *font,
 			  hb_font_extents_t *metrics,
 			  void *user_data HB_UNUSED)
 {
-  const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
+  const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data;
   metrics->ascender = font->em_scale_y (ot_font->hmtx.get_relaxed ()->ascender);
   metrics->descender = font->em_scale_y (ot_font->hmtx.get_relaxed ()->descender);
   metrics->line_gap = font->em_scale_y (ot_font->hmtx.get_relaxed ()->line_gap);
@@ -159,7 +156,7 @@ hb_ot_get_font_v_extents (hb_font_t *font,
 			  hb_font_extents_t *metrics,
 			  void *user_data HB_UNUSED)
 {
-  const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
+  const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data;
   metrics->ascender = font->em_scale_x (ot_font->vmtx.get_relaxed ()->ascender);
   metrics->descender = font->em_scale_x (ot_font->vmtx.get_relaxed ()->descender);
   metrics->line_gap = font->em_scale_x (ot_font->vmtx.get_relaxed ()->line_gap);
@@ -226,7 +223,7 @@ void
 hb_ot_font_set_funcs (hb_font_t *font)
 {
   if (unlikely (!hb_ot_shaper_face_data_ensure (font->face))) return;
-  hb_ot_font_t *ot_font =  &hb_ot_face_data (font->face)->table;
+  hb_ot_face_data_t *ot_font = hb_ot_face_data (font->face);
 
   /* Load them lazies.  We access them with get_relaxed() for performance. */
   ot_font->cmap.get ();
diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc
index 27635328..8b247704 100644
--- a/src/hb-ot-layout.cc
+++ b/src/hb-ot-layout.cc
@@ -59,35 +59,35 @@
 inline const OT::GDEF& _get_gdef (hb_face_t *face)
 {
   if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::GDEF);
-  return *hb_ot_face_data (face)->table.GDEF->table;
+  return *hb_ot_face_data (face)->GDEF->table;
 }
 static hb_blob_t * _get_gsub_blob (hb_face_t *face)
 {
   if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return hb_blob_get_empty ();
-  return hb_ot_face_data (face)->table.GSUB->blob;
+  return hb_ot_face_data (face)->GSUB->blob;
 }
 static inline const OT::GSUB& _get_gsub (hb_face_t *face)
 {
   if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::GSUB);
-  return *hb_ot_face_data (face)->table.GSUB->table;
+  return *hb_ot_face_data (face)->GSUB->table;
 }
 inline const OT::GSUB& _get_gsub_relaxed (hb_face_t *face)
 {
-  return *hb_ot_face_data (face)->table.GSUB.get_relaxed ()->table;
+  return *hb_ot_face_data (face)->GSUB.get_relaxed ()->table;
 }
 static hb_blob_t * _get_gpos_blob (hb_face_t *face)
 {
   if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return hb_blob_get_empty ();
-  return hb_ot_face_data (face)->table.GPOS->blob;
+  return hb_ot_face_data (face)->GPOS->blob;
 }
 static inline const OT::GPOS& _get_gpos (hb_face_t *face)
 {
   if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::GPOS);
-  return *hb_ot_face_data (face)->table.GPOS->table;
+  return *hb_ot_face_data (face)->GPOS->table;
 }
 inline const OT::GPOS& _get_gpos_relaxed (hb_face_t *face)
 {
-  return *hb_ot_face_data (face)->table.GPOS.get_relaxed ()->table;
+  return *hb_ot_face_data (face)->GPOS.get_relaxed ()->table;
 }
 
 
@@ -614,11 +614,11 @@ hb_ot_layout_table_get_lookup_count (hb_face_t    *face,
   {
     case HB_OT_TAG_GSUB:
     {
-      return hb_ot_face_data (face)->table.GSUB->lookup_count;
+      return hb_ot_face_data (face)->GSUB->lookup_count;
     }
     case HB_OT_TAG_GPOS:
     {
-      return hb_ot_face_data (face)->table.GPOS->lookup_count;
+      return hb_ot_face_data (face)->GPOS->lookup_count;
     }
   }
   return 0;
@@ -832,13 +832,13 @@ hb_ot_layout_lookup_collect_glyphs (hb_face_t    *face,
   {
     case HB_OT_TAG_GSUB:
     {
-      const OT::SubstLookup& l = hb_ot_face_data (face)->table.GSUB->table->get_lookup (lookup_index);
+      const OT::SubstLookup& l = hb_ot_face_data (face)->GSUB->table->get_lookup (lookup_index);
       l.collect_glyphs (&c);
       return;
     }
     case HB_OT_TAG_GPOS:
     {
-      const OT::PosLookup& l = hb_ot_face_data (face)->table.GPOS->table->get_lookup (lookup_index);
+      const OT::PosLookup& l = hb_ot_face_data (face)->GPOS->table->get_lookup (lookup_index);
       l.collect_glyphs (&c);
       return;
     }
@@ -911,12 +911,12 @@ hb_ot_layout_lookup_would_substitute_fast (hb_face_t            *face,
 					   unsigned int          glyphs_length,
 					   hb_bool_t             zero_context)
 {
-  if (unlikely (lookup_index >= hb_ot_face_data (face)->table.GSUB->lookup_count)) return false;
+  if (unlikely (lookup_index >= hb_ot_face_data (face)->GSUB->lookup_count)) return false;
   OT::hb_would_apply_context_t c (face, glyphs, glyphs_length, (bool) zero_context);
 
-  const OT::SubstLookup& l = hb_ot_face_data (face)->table.GSUB->table->get_lookup (lookup_index);
+  const OT::SubstLookup& l = hb_ot_face_data (face)->GSUB->table->get_lookup (lookup_index);
 
-  return l.would_apply (&c, &hb_ot_face_data (face)->table.GSUB->accels[lookup_index]);
+  return l.would_apply (&c, &hb_ot_face_data (face)->GSUB->accels[lookup_index]);
 }
 
 void
@@ -1073,8 +1073,8 @@ struct GSUBProxy
   typedef OT::SubstLookup Lookup;
 
   GSUBProxy (hb_face_t *face) :
-    table (*hb_ot_face_data (face)->table.GSUB->table),
-    accels (hb_ot_face_data (face)->table.GSUB->accels) {}
+    table (*hb_ot_face_data (face)->GSUB->table),
+    accels (hb_ot_face_data (face)->GSUB->accels) {}
 
   const OT::GSUB &table;
   const hb_ot_layout_lookup_accelerator_t *accels;
@@ -1087,8 +1087,8 @@ struct GPOSProxy
   typedef OT::PosLookup Lookup;
 
   GPOSProxy (hb_face_t *face) :
-    table (*hb_ot_face_data (face)->table.GPOS->table),
-    accels (hb_ot_face_data (face)->table.GPOS->accels) {}
+    table (*hb_ot_face_data (face)->GPOS->table),
+    accels (hb_ot_face_data (face)->GPOS->accels) {}
 
   const OT::GPOS &table;
   const hb_ot_layout_lookup_accelerator_t *accels;
diff --git a/src/hb-ot-math.cc b/src/hb-ot-math.cc
index 645c3d62..c693f480 100644
--- a/src/hb-ot-math.cc
+++ b/src/hb-ot-math.cc
@@ -33,8 +33,8 @@ static inline const OT::MATH&
 _get_math (hb_face_t *face)
 {
   if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::MATH);
-  hb_ot_face_data_t * layout = hb_ot_face_data (face);
-  return *(layout->table.MATH.get ());
+  hb_ot_face_data_t * data = hb_ot_face_data (face);
+  return *(data->MATH.get ());
 }
 
 /*
diff --git a/src/hb-ot-var.cc b/src/hb-ot-var.cc
index a2f2d3e5..472ee845 100644
--- a/src/hb-ot-var.cc
+++ b/src/hb-ot-var.cc
@@ -41,14 +41,14 @@ _get_fvar (hb_face_t *face)
 {
   if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::fvar);
   hb_ot_face_data_t *layout = hb_ot_face_data (face);
-  return *(layout->table.fvar.get ());
+  return *(layout->fvar.get ());
 }
 static inline const OT::avar&
 _get_avar (hb_face_t *face)
 {
   if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::avar);
   hb_ot_face_data_t *layout = hb_ot_face_data (face);
-  return *(layout->table.avar.get ());
+  return *(layout->avar.get ());
 }
 
 /**
commit 3a0b3a29cc246d0b1e5989c9e8c1e6d544046dcc
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sun Aug 26 15:11:24 2018 -0700

    Free up hb-ot-face.hh from includes
    
    There might be a better way to do this, but I couldn't find...

diff --git a/src/hb-face.cc b/src/hb-face.cc
index e4e0e05a..ddf8e488 100644
--- a/src/hb-face.cc
+++ b/src/hb-face.cc
@@ -32,6 +32,7 @@
 #include "hb-blob.hh"
 #include "hb-open-file.hh"
 #include "hb-ot-face.hh"
+#include "hb-ot-cmap-table.hh"
 
 
 /**
diff --git a/src/hb-ot-cmap-table.hh b/src/hb-ot-cmap-table.hh
index c357714e..aca5de2e 100644
--- a/src/hb-ot-cmap-table.hh
+++ b/src/hb-ot-cmap-table.hh
@@ -1173,6 +1173,7 @@ struct cmap
   DEFINE_SIZE_ARRAY (4, encodingRecord);
 };
 
+struct cmap_accelerator_t : cmap::accelerator_t {};
 
 } /* namespace OT */
 
diff --git a/src/hb-ot-color-cbdt-table.hh b/src/hb-ot-color-cbdt-table.hh
index 8533b036..8bedf222 100644
--- a/src/hb-ot-color-cbdt-table.hh
+++ b/src/hb-ot-color-cbdt-table.hh
@@ -533,6 +533,8 @@ struct CBDT
   DEFINE_SIZE_ARRAY(4, dataZ);
 };
 
+struct CBDT_accelerator_t : CBDT::accelerator_t {};
+
 } /* namespace OT */
 
 #endif /* HB_OT_COLOR_CBDT_TABLE_HH */
diff --git a/src/hb-ot-face.cc b/src/hb-ot-face.cc
index ffac3d06..c6c4ff9e 100644
--- a/src/hb-ot-face.cc
+++ b/src/hb-ot-face.cc
@@ -26,6 +26,16 @@
 
 #include "hb-ot-face.hh"
 
+#include "hb-ot-cmap-table.hh"
+#include "hb-ot-glyf-table.hh"
+#include "hb-ot-hmtx-table.hh"
+#include "hb-ot-kern-table.hh"
+#include "hb-ot-post-table.hh"
+#include "hb-ot-color-cbdt-table.hh"
+#include "hb-ot-layout-gdef-table.hh"
+#include "hb-ot-layout-gsub-table.hh"
+#include "hb-ot-layout-gpos-table.hh"
+
 
 void hb_ot_face_data_t::tables_t::init0 (hb_face_t *face)
 {
diff --git a/src/hb-ot-face.hh b/src/hb-ot-face.hh
index 6e7ff2ce..765627de 100644
--- a/src/hb-ot-face.hh
+++ b/src/hb-ot-face.hh
@@ -37,17 +37,6 @@
 #define hb_ot_face_data(face) ((hb_ot_face_data_t *) face->shaper_data.ot.get_relaxed ())
 
 
-#include "hb-ot-cmap-table.hh"
-#include "hb-ot-glyf-table.hh"
-#include "hb-ot-hmtx-table.hh"
-#include "hb-ot-kern-table.hh"
-#include "hb-ot-post-table.hh"
-#include "hb-ot-color-cbdt-table.hh"
-#include "hb-ot-layout-gdef-table.hh"
-#include "hb-ot-layout-gsub-table.hh"
-#include "hb-ot-layout-gpos-table.hh"
-
-
 /*
  * hb_ot_face_data_t
  */
@@ -84,7 +73,7 @@
 
 /* Declare tables. */
 #define HB_OT_LAYOUT_TABLE(Namespace, Type) namespace Namespace { struct Type; }
-#define HB_OT_LAYOUT_ACCELERATOR(Namespace, Type) HB_OT_LAYOUT_TABLE (Namespace, Type)
+#define HB_OT_LAYOUT_ACCELERATOR(Namespace, Type) HB_OT_LAYOUT_TABLE (Namespace, Type##_accelerator_t)
 HB_OT_LAYOUT_TABLES
 #undef HB_OT_LAYOUT_ACCELERATOR
 #undef HB_OT_LAYOUT_TABLE
@@ -113,7 +102,7 @@ struct hb_ot_face_data_t
 #define HB_OT_LAYOUT_TABLE(Namespace, Type) \
     hb_table_lazy_loader_t<Namespace::Type, HB_OT_LAYOUT_TABLE_ORDER (Namespace, Type)> Type;
 #define HB_OT_LAYOUT_ACCELERATOR(Namespace, Type) \
-    hb_face_lazy_loader_t<Namespace::Type::accelerator_t, HB_OT_LAYOUT_TABLE_ORDER (Namespace, Type)> Type;
+    hb_face_lazy_loader_t<Namespace::Type##_accelerator_t, HB_OT_LAYOUT_TABLE_ORDER (Namespace, Type)> Type;
     HB_OT_LAYOUT_TABLES
 #undef HB_OT_LAYOUT_ACCELERATOR
 #undef HB_OT_LAYOUT_TABLE
diff --git a/src/hb-ot-font.cc b/src/hb-ot-font.cc
index c96cba41..e441aad4 100644
--- a/src/hb-ot-font.cc
+++ b/src/hb-ot-font.cc
@@ -32,6 +32,13 @@
 #include "hb-machinery.hh"
 #include "hb-ot-face.hh"
 
+#include "hb-ot-cmap-table.hh"
+#include "hb-ot-hmtx-table.hh"
+#include "hb-ot-kern-table.hh"
+#include "hb-ot-post-table.hh"
+#include "hb-ot-glyf-table.hh"
+#include "hb-ot-color-cbdt-table.hh"
+
 
 typedef hb_ot_face_data_t::tables_t hb_ot_font_t;
 
diff --git a/src/hb-ot-glyf-table.hh b/src/hb-ot-glyf-table.hh
index a23269e5..65758861 100644
--- a/src/hb-ot-glyf-table.hh
+++ b/src/hb-ot-glyf-table.hh
@@ -490,6 +490,8 @@ struct glyf
   DEFINE_SIZE_ARRAY (0, dataZ);
 };
 
+struct glyf_accelerator_t : glyf::accelerator_t {};
+
 } /* namespace OT */
 
 
diff --git a/src/hb-ot-hmtx-table.hh b/src/hb-ot-hmtx-table.hh
index 6849172b..9bdca7eb 100644
--- a/src/hb-ot-hmtx-table.hh
+++ b/src/hb-ot-hmtx-table.hh
@@ -332,6 +332,9 @@ struct vmtx : hmtxvmtx<vmtx, vhea> {
   static const hb_tag_t os2Tag		= HB_TAG_NONE;
 };
 
+struct hmtx_accelerator_t : hmtx::accelerator_t {};
+struct vmtx_accelerator_t : vmtx::accelerator_t {};
+
 } /* namespace OT */
 
 
diff --git a/src/hb-ot-kern-table.hh b/src/hb-ot-kern-table.hh
index ac6e9e45..40f94be2 100644
--- a/src/hb-ot-kern-table.hh
+++ b/src/hb-ot-kern-table.hh
@@ -390,6 +390,8 @@ struct kern
   DEFINE_SIZE_UNION (2, major);
 };
 
+struct kern_accelerator_t : kern::accelerator_t {};
+
 } /* namespace OT */
 
 
diff --git a/src/hb-ot-layout-gdef-table.hh b/src/hb-ot-layout-gdef-table.hh
index 1f19c028..79308649 100644
--- a/src/hb-ot-layout-gdef-table.hh
+++ b/src/hb-ot-layout-gdef-table.hh
@@ -467,6 +467,7 @@ struct GDEF
   DEFINE_SIZE_MIN (12);
 };
 
+struct GDEF_accelerator_t : GDEF::accelerator_t {};
 
 } /* namespace OT */
 
diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh
index 08a99b35..16b54793 100644
--- a/src/hb-ot-layout-gpos-table.hh
+++ b/src/hb-ot-layout-gpos-table.hh
@@ -1647,6 +1647,8 @@ template <typename context_t>
   return ret;
 }
 
+struct GPOS_accelerator_t : GPOS::accelerator_t {};
+
 
 #undef attach_chain
 #undef attach_type
diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh
index 11fe7cf4..55696c5a 100644
--- a/src/hb-ot-layout-gsub-table.hh
+++ b/src/hb-ot-layout-gsub-table.hh
@@ -1350,6 +1350,7 @@ template <typename context_t>
   return ret;
 }
 
+struct GSUB_accelerator_t : GSUB::accelerator_t {};
 
 } /* namespace OT */
 
diff --git a/src/hb-ot-post-table.hh b/src/hb-ot-post-table.hh
index 44918b1d..0c3e596a 100644
--- a/src/hb-ot-post-table.hh
+++ b/src/hb-ot-post-table.hh
@@ -295,6 +295,8 @@ struct post
   DEFINE_SIZE_STATIC (32);
 };
 
+struct post_accelerator_t : post::accelerator_t {};
+
 } /* namespace OT */
 
 
commit a84309afc8817cd386e555af21dfcdc03388b329
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sun Aug 26 09:33:01 2018 -0700

    [face] Use saved cmap in collect_unicodes() APIs

diff --git a/src/hb-face.cc b/src/hb-face.cc
index 286b1f2c..e4e0e05a 100644
--- a/src/hb-face.cc
+++ b/src/hb-face.cc
@@ -31,7 +31,7 @@
 #include "hb-face.hh"
 #include "hb-blob.hh"
 #include "hb-open-file.hh"
-#include "hb-ot-cmap-table.hh"
+#include "hb-ot-face.hh"
 
 
 /**
@@ -519,6 +519,7 @@ hb_face_get_table_tags (const hb_face_t *face,
  * Character set.
  */
 
+
 /**
  * hb_face_collect_unicodes:
  * @face: font face.
@@ -530,9 +531,8 @@ void
 hb_face_collect_unicodes (hb_face_t *face,
 			  hb_set_t  *out)
 {
-  /* XXX Use saved accel. */
-  hb_auto_t<OT::cmap::accelerator_t> cmap (face);
-  cmap.collect_unicodes (out);
+  if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return;
+  hb_ot_face_data (face)->table.cmap->collect_unicodes (out);
 }
 
 /**
@@ -548,9 +548,8 @@ void
 hb_face_collect_variation_selectors (hb_face_t *face,
 				     hb_set_t  *out)
 {
-  /* XXX Use saved accel. */
-  hb_auto_t<OT::cmap::accelerator_t> cmap (face);
-  cmap.collect_variation_selectors (out);
+  if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return;
+  hb_ot_face_data (face)->table.cmap->collect_variation_selectors (out);
 }
 
 /**
@@ -567,9 +566,8 @@ hb_face_collect_variation_unicodes (hb_face_t *face,
 				    hb_codepoint_t variation_selector,
 				    hb_set_t  *out)
 {
-  /* XXX Use saved accel. */
-  hb_auto_t<OT::cmap::accelerator_t> cmap (face);
-  cmap.collect_variation_unicodes (variation_selector, out);
+  if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return;
+  hb_ot_face_data (face)->table.cmap->collect_variation_unicodes (variation_selector, out);
 }
 
 
commit c624e18a24311c66737dde4ce515aa1eca892b94
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sun Aug 26 09:19:20 2018 -0700

    [OT] Move code around

diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh
index 8911a5eb..11fe7cf4 100644
--- a/src/hb-ot-layout-gsub-table.hh
+++ b/src/hb-ot-layout-gsub-table.hh
@@ -1308,8 +1308,6 @@ struct GSUB : GSUBGPOS
   inline const SubstLookup& get_lookup (unsigned int i) const
   { return CastR<SubstLookup> (GSUBGPOS::get_lookup (i)); }
 
-  static inline void substitute_start (hb_font_t *font, hb_buffer_t *buffer);
-
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
@@ -1322,22 +1320,6 @@ struct GSUB : GSUBGPOS
 };
 
 
-void
-GSUB::substitute_start (hb_font_t *font, hb_buffer_t *buffer)
-{
-  _hb_buffer_assert_gsubgpos_vars (buffer);
-
-  const GDEF &gdef = _get_gdef (font->face);
-  unsigned int count = buffer->len;
-  for (unsigned int i = 0; i < count; i++)
-  {
-    _hb_glyph_info_set_glyph_props (&buffer->info[i], gdef.get_glyph_props (buffer->info[i].codepoint));
-    _hb_glyph_info_clear_lig_props (&buffer->info[i]);
-    buffer->info[i].syllable() = 0;
-  }
-}
-
-
 /* Out-of-class implementation for methods recursing */
 
 /*static*/ inline bool ExtensionSubst::is_reverse (void) const
diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc
index 4d2aeeee..27635328 100644
--- a/src/hb-ot-layout.cc
+++ b/src/hb-ot-layout.cc
@@ -213,6 +213,24 @@ OT::GDEF::accelerator_t::init (hb_face_t *face)
   table = this->blob->as<GDEF> ();
 }
 
+static void
+_hb_ot_layout_set_glyph_props (hb_font_t *font,
+			       hb_buffer_t *buffer)
+{
+  _hb_buffer_assert_gsubgpos_vars (buffer);
+
+  const OT::GDEF &gdef = _get_gdef (font->face);
+  unsigned int count = buffer->len;
+  for (unsigned int i = 0; i < count; i++)
+  {
+    _hb_glyph_info_set_glyph_props (&buffer->info[i], gdef.get_glyph_props (buffer->info[i].codepoint));
+    _hb_glyph_info_clear_lig_props (&buffer->info[i]);
+    buffer->info[i].syllable() = 0;
+  }
+}
+
+/* Public API */
+
 hb_bool_t
 hb_ot_layout_has_glyph_classes (hb_face_t *face)
 {
@@ -902,9 +920,10 @@ hb_ot_layout_lookup_would_substitute_fast (hb_face_t            *face,
 }
 
 void
-hb_ot_layout_substitute_start (hb_font_t *font, hb_buffer_t *buffer)
+hb_ot_layout_substitute_start (hb_font_t    *font,
+			       hb_buffer_t  *buffer)
 {
-  OT::GSUB::substitute_start (font, buffer);
+_hb_ot_layout_set_glyph_props (font, buffer);
 }
 
 /**
commit 399909468204b76769857508e74f802d648ca0a5
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sun Aug 26 09:12:25 2018 -0700

    [OT] Use relaxed ops for recursing into GSUB/GPOS lookups again

diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh
index 7d3c3bad..08a99b35 100644
--- a/src/hb-ot-layout-gpos-table.hh
+++ b/src/hb-ot-layout-gpos-table.hh
@@ -1630,13 +1630,13 @@ GPOS::position_finish_offsets (hb_font_t *font HB_UNUSED, hb_buffer_t *buffer)
 template <typename context_t>
 /*static*/ inline typename context_t::return_t PosLookup::dispatch_recurse_func (context_t *c, unsigned int lookup_index)
 {
-  const PosLookup &l = _get_gpos (c->face)->get_lookup (lookup_index);
+  const PosLookup &l = _get_gpos_relaxed (c->face)->get_lookup (lookup_index);
   return l.dispatch (c);
 }
 
 /*static*/ inline bool PosLookup::apply_recurse_func (hb_ot_apply_context_t *c, unsigned int lookup_index)
 {
-  const PosLookup &l = _get_gpos (c->face).get_lookup (lookup_index);
+  const PosLookup &l = _get_gpos_relaxed (c->face).get_lookup (lookup_index);
   unsigned int saved_lookup_props = c->lookup_props;
   unsigned int saved_lookup_index = c->lookup_index;
   c->set_lookup_index (lookup_index);
diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh
index 991b5566..8911a5eb 100644
--- a/src/hb-ot-layout-gsub-table.hh
+++ b/src/hb-ot-layout-gsub-table.hh
@@ -1351,13 +1351,13 @@ GSUB::substitute_start (hb_font_t *font, hb_buffer_t *buffer)
 template <typename context_t>
 /*static*/ inline typename context_t::return_t SubstLookup::dispatch_recurse_func (context_t *c, unsigned int lookup_index)
 {
-  const SubstLookup &l = _get_gsub (c->face).get_lookup (lookup_index);
+  const SubstLookup &l = _get_gsub_relaxed (c->face).get_lookup (lookup_index);
   return l.dispatch (c);
 }
 
 /*static*/ inline bool SubstLookup::apply_recurse_func (hb_ot_apply_context_t *c, unsigned int lookup_index)
 {
-  const SubstLookup &l = _get_gsub (c->face).get_lookup (lookup_index);
+  const SubstLookup &l = _get_gsub_relaxed (c->face).get_lookup (lookup_index);
   unsigned int saved_lookup_props = c->lookup_props;
   unsigned int saved_lookup_index = c->lookup_index;
   c->set_lookup_index (lookup_index);
diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc
index 6e9b5f80..4d2aeeee 100644
--- a/src/hb-ot-layout.cc
+++ b/src/hb-ot-layout.cc
@@ -66,21 +66,29 @@ static hb_blob_t * _get_gsub_blob (hb_face_t *face)
   if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return hb_blob_get_empty ();
   return hb_ot_face_data (face)->table.GSUB->blob;
 }
-inline const OT::GSUB& _get_gsub (hb_face_t *face)
+static inline const OT::GSUB& _get_gsub (hb_face_t *face)
 {
   if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::GSUB);
   return *hb_ot_face_data (face)->table.GSUB->table;
 }
+inline const OT::GSUB& _get_gsub_relaxed (hb_face_t *face)
+{
+  return *hb_ot_face_data (face)->table.GSUB.get_relaxed ()->table;
+}
 static hb_blob_t * _get_gpos_blob (hb_face_t *face)
 {
   if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return hb_blob_get_empty ();
   return hb_ot_face_data (face)->table.GPOS->blob;
 }
-inline const OT::GPOS& _get_gpos (hb_face_t *face)
+static inline const OT::GPOS& _get_gpos (hb_face_t *face)
 {
   if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::GPOS);
   return *hb_ot_face_data (face)->table.GPOS->table;
 }
+inline const OT::GPOS& _get_gpos_relaxed (hb_face_t *face)
+{
+  return *hb_ot_face_data (face)->table.GPOS.get_relaxed ()->table;
+}
 
 
 /*
diff --git a/src/hb-ot-layout.hh b/src/hb-ot-layout.hh
index 7abaaaa5..84981391 100644
--- a/src/hb-ot-layout.hh
+++ b/src/hb-ot-layout.hh
@@ -45,8 +45,8 @@ namespace OT
 }
 
 HB_INTERNAL const OT::GDEF& _get_gdef (hb_face_t *face);
-HB_INTERNAL const OT::GSUB& _get_gsub (hb_face_t *face);
-HB_INTERNAL const OT::GPOS& _get_gpos (hb_face_t *face);
+HB_INTERNAL const OT::GSUB& _get_gsub_relaxed (hb_face_t *face);
+HB_INTERNAL const OT::GPOS& _get_gpos_relaxed (hb_face_t *face);
 
 
 /* Private API corresponding to hb-ot-layout.h: */
commit d8c57e85d9981b4c7a11fae4f31100359574cf13
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sun Aug 26 09:03:31 2018 -0700

    [GDEF] Move code around

diff --git a/src/hb-ot-layout-gdef-table.hh b/src/hb-ot-layout-gdef-table.hh
index 950b654f..1f19c028 100644
--- a/src/hb-ot-layout-gdef-table.hh
+++ b/src/hb-ot-layout-gdef-table.hh
@@ -337,109 +337,6 @@ struct MarkGlyphSets
  * https://docs.microsoft.com/en-us/typography/opentype/spec/gdef
  */
 
-static bool
-_hb_ot_blacklist_gdef (unsigned int gdef_len,
-		       unsigned int gsub_len,
-		       unsigned int gpos_len)
-{
-  /* The ugly business of blacklisting individual fonts' tables happen here!
-   * See this thread for why we finally had to bend in and do this:
-   * https://lists.freedesktop.org/archives/harfbuzz/2016-February/005489.html
-   *
-   * In certain versions of Times New Roman Italic and Bold Italic,
-   * ASCII double quotation mark U+0022 has wrong glyph class 3 (mark)
-   * in GDEF.  Many versions of Tahoma have bad GDEF tables that
-   * incorrectly classify some spacing marks such as certain IPA
-   * symbols as glyph class 3. So do older versions of Microsoft
-   * Himalaya, and the version of Cantarell shipped by Ubuntu 16.04.
-   *
-   * Nuke the GDEF tables of to avoid unwanted width-zeroing.
-   *
-   * See https://bugzilla.mozilla.org/show_bug.cgi?id=1279925
-   *     https://bugzilla.mozilla.org/show_bug.cgi?id=1279693
-   *     https://bugzilla.mozilla.org/show_bug.cgi?id=1279875
-   */
-#define ENCODE(x,y,z) ((int64_t) (x) << 32 | (int64_t) (y) << 16 | (z))
-  switch ENCODE(gdef_len, gsub_len, gpos_len)
-  {
-    /* sha1sum:c5ee92f0bca4bfb7d06c4d03e8cf9f9cf75d2e8a Windows 7? timesi.ttf */
-    case ENCODE (442, 2874, 42038):
-    /* sha1sum:37fc8c16a0894ab7b749e35579856c73c840867b Windows 7? timesbi.ttf */
-    case ENCODE (430, 2874, 40662):
-    /* sha1sum:19fc45110ea6cd3cdd0a5faca256a3797a069a80 Windows 7 timesi.ttf */
-    case ENCODE (442, 2874, 39116):
-    /* sha1sum:6d2d3c9ed5b7de87bc84eae0df95ee5232ecde26 Windows 7 timesbi.ttf */
-    case ENCODE (430, 2874, 39374):
-    /* sha1sum:8583225a8b49667c077b3525333f84af08c6bcd8 OS X 10.11.3 Times New Roman Italic.ttf */
-    case ENCODE (490, 3046, 41638):
-    /* sha1sum:ec0f5a8751845355b7c3271d11f9918a966cb8c9 OS X 10.11.3 Times New Roman Bold Italic.ttf */
-    case ENCODE (478, 3046, 41902):
-    /* sha1sum:96eda93f7d33e79962451c6c39a6b51ee893ce8c  tahoma.ttf from Windows 8 */
-    case ENCODE (898, 12554, 46470):
-    /* sha1sum:20928dc06014e0cd120b6fc942d0c3b1a46ac2bc  tahomabd.ttf from Windows 8 */
-    case ENCODE (910, 12566, 47732):
-    /* sha1sum:4f95b7e4878f60fa3a39ca269618dfde9721a79e  tahoma.ttf from Windows 8.1 */
-    case ENCODE (928, 23298, 59332):
-    /* sha1sum:6d400781948517c3c0441ba42acb309584b73033  tahomabd.ttf from Windows 8.1 */
-    case ENCODE (940, 23310, 60732):
-    /* tahoma.ttf v6.04 from Windows 8.1 x64, see https://bugzilla.mozilla.org/show_bug.cgi?id=1279925 */
-    case ENCODE (964, 23836, 60072):
-    /* tahomabd.ttf v6.04 from Windows 8.1 x64, see https://bugzilla.mozilla.org/show_bug.cgi?id=1279925 */
-    case ENCODE (976, 23832, 61456):
-    /* sha1sum:e55fa2dfe957a9f7ec26be516a0e30b0c925f846  tahoma.ttf from Windows 10 */
-    case ENCODE (994, 24474, 60336):
-    /* sha1sum:7199385abb4c2cc81c83a151a7599b6368e92343  tahomabd.ttf from Windows 10 */
-    case ENCODE (1006, 24470, 61740):
-    /* tahoma.ttf v6.91 from Windows 10 x64, see https://bugzilla.mozilla.org/show_bug.cgi?id=1279925 */
-    case ENCODE (1006, 24576, 61346):
-    /* tahomabd.ttf v6.91 from Windows 10 x64, see https://bugzilla.mozilla.org/show_bug.cgi?id=1279925 */
-    case ENCODE (1018, 24572, 62828):
-    /* sha1sum:b9c84d820c49850d3d27ec498be93955b82772b5  tahoma.ttf from Windows 10 AU */
-    case ENCODE (1006, 24576, 61352):
-    /* sha1sum:2bdfaab28174bdadd2f3d4200a30a7ae31db79d2  tahomabd.ttf from Windows 10 AU */
-    case ENCODE (1018, 24572, 62834):
-    /* sha1sum:b0d36cf5a2fbe746a3dd277bffc6756a820807a7  Tahoma.ttf from Mac OS X 10.9 */
-    case ENCODE (832, 7324, 47162):
-    /* sha1sum:12fc4538e84d461771b30c18b5eb6bd434e30fba  Tahoma Bold.ttf from Mac OS X 10.9 */
-    case ENCODE (844, 7302, 45474):
-    /* sha1sum:eb8afadd28e9cf963e886b23a30b44ab4fd83acc  himalaya.ttf from Windows 7 */
-    case ENCODE (180, 13054, 7254):
-    /* sha1sum:73da7f025b238a3f737aa1fde22577a6370f77b0  himalaya.ttf from Windows 8 */
-    case ENCODE (192, 12638, 7254):
-    /* sha1sum:6e80fd1c0b059bbee49272401583160dc1e6a427  himalaya.ttf from Windows 8.1 */
-    case ENCODE (192, 12690, 7254):
-    /* 8d9267aea9cd2c852ecfb9f12a6e834bfaeafe44  cantarell-fonts-0.0.21/otf/Cantarell-Regular.otf */
-    /* 983988ff7b47439ab79aeaf9a45bd4a2c5b9d371  cantarell-fonts-0.0.21/otf/Cantarell-Oblique.otf */
-    case ENCODE (188, 248, 3852):
-    /* 2c0c90c6f6087ffbfea76589c93113a9cbb0e75f  cantarell-fonts-0.0.21/otf/Cantarell-Bold.otf */
-    /* 55461f5b853c6da88069ffcdf7f4dd3f8d7e3e6b  cantarell-fonts-0.0.21/otf/Cantarell-Bold-Oblique.otf */
-    case ENCODE (188, 264, 3426):
-    /* d125afa82a77a6475ac0e74e7c207914af84b37a padauk-2.80/Padauk.ttf RHEL 7.2 */
-    case ENCODE (1058, 47032, 11818):
-    /* 0f7b80437227b90a577cc078c0216160ae61b031 padauk-2.80/Padauk-Bold.ttf RHEL 7.2*/
-    case ENCODE (1046, 47030, 12600):
-    /* d3dde9aa0a6b7f8f6a89ef1002e9aaa11b882290 padauk-2.80/Padauk.ttf Ubuntu 16.04 */
-    case ENCODE (1058, 71796, 16770):
-    /* 5f3c98ccccae8a953be2d122c1b3a77fd805093f padauk-2.80/Padauk-Bold.ttf Ubuntu 16.04 */
-    case ENCODE (1046, 71790, 17862):
-    /* 6c93b63b64e8b2c93f5e824e78caca555dc887c7 padauk-2.80/Padauk-book.ttf */
-    case ENCODE (1046, 71788, 17112):
-    /* d89b1664058359b8ec82e35d3531931125991fb9 padauk-2.80/Padauk-bookbold.ttf */
-    case ENCODE (1058, 71794, 17514):
-    /* 824cfd193aaf6234b2b4dc0cf3c6ef576c0d00ef padauk-3.0/Padauk-book.ttf */
-    case ENCODE (1330, 109904, 57938):
-    /* 91fcc10cf15e012d27571e075b3b4dfe31754a8a padauk-3.0/Padauk-bookbold.ttf */
-    case ENCODE (1330, 109904, 58972):
-    /* sha1sum: c26e41d567ed821bed997e937bc0c41435689e85  Padauk.ttf
-     *  "Padauk Regular" "Version 2.5", see https://crbug.com/681813 */
-    case ENCODE (1004, 59092, 14836):
-      return true;
-#undef ENCODE
-  }
-  return false;
-}
-
-
 
 struct GDEF
 {
@@ -526,20 +423,7 @@ struct GDEF
 
   struct accelerator_t
   {
-    inline void init (hb_face_t *face)
-    {
-      this->blob = hb_sanitize_context_t().reference_table<GDEF> (face);
-
-      if (unlikely (_hb_ot_blacklist_gdef (this->blob->length,
-					   _get_gsub_blob (face)->length,
-					   _get_gpos_blob (face)->length)))
-      {
-	hb_blob_destroy (this->blob);
-	this->blob = hb_blob_get_empty ();
-      }
-
-      table = this->blob->as<GDEF> ();
-    }
+    HB_INTERNAL inline void init (hb_face_t *face);
 
     inline void fini (void)
     {
diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc
index a2482326..6e9b5f80 100644
--- a/src/hb-ot-layout.cc
+++ b/src/hb-ot-layout.cc
@@ -56,41 +56,155 @@
 //   return *(data->base.get ());
 // }
 
-inline const OT::GDEF&
-_get_gdef (hb_face_t *face)
+inline const OT::GDEF& _get_gdef (hb_face_t *face)
 {
   if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::GDEF);
   return *hb_ot_face_data (face)->table.GDEF->table;
 }
-hb_blob_t *
-_get_gsub_blob (hb_face_t *face)
+static hb_blob_t * _get_gsub_blob (hb_face_t *face)
 {
   if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return hb_blob_get_empty ();
   return hb_ot_face_data (face)->table.GSUB->blob;
 }
-inline const OT::GSUB&
-_get_gsub (hb_face_t *face)
+inline const OT::GSUB& _get_gsub (hb_face_t *face)
 {
   if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::GSUB);
   return *hb_ot_face_data (face)->table.GSUB->table;
 }
-hb_blob_t *
-_get_gpos_blob (hb_face_t *face)
+static hb_blob_t * _get_gpos_blob (hb_face_t *face)
 {
   if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return hb_blob_get_empty ();
   return hb_ot_face_data (face)->table.GPOS->blob;
 }
-inline const OT::GPOS&
-_get_gpos (hb_face_t *face)
+inline const OT::GPOS& _get_gpos (hb_face_t *face)
 {
   if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::GPOS);
   return *hb_ot_face_data (face)->table.GPOS->table;
 }
 
+
 /*
  * GDEF
  */
 
+static bool
+_hb_ot_blacklist_gdef (unsigned int gdef_len,
+		       unsigned int gsub_len,
+		       unsigned int gpos_len)
+{
+  /* The ugly business of blacklisting individual fonts' tables happen here!
+   * See this thread for why we finally had to bend in and do this:
+   * https://lists.freedesktop.org/archives/harfbuzz/2016-February/005489.html
+   *
+   * In certain versions of Times New Roman Italic and Bold Italic,
+   * ASCII double quotation mark U+0022 has wrong glyph class 3 (mark)
+   * in GDEF.  Many versions of Tahoma have bad GDEF tables that
+   * incorrectly classify some spacing marks such as certain IPA
+   * symbols as glyph class 3. So do older versions of Microsoft
+   * Himalaya, and the version of Cantarell shipped by Ubuntu 16.04.
+   *
+   * Nuke the GDEF tables of to avoid unwanted width-zeroing.
+   *
+   * See https://bugzilla.mozilla.org/show_bug.cgi?id=1279925
+   *     https://bugzilla.mozilla.org/show_bug.cgi?id=1279693
+   *     https://bugzilla.mozilla.org/show_bug.cgi?id=1279875
+   */
+#define ENCODE(x,y,z) ((int64_t) (x) << 32 | (int64_t) (y) << 16 | (z))
+  switch ENCODE(gdef_len, gsub_len, gpos_len)
+  {
+    /* sha1sum:c5ee92f0bca4bfb7d06c4d03e8cf9f9cf75d2e8a Windows 7? timesi.ttf */
+    case ENCODE (442, 2874, 42038):
+    /* sha1sum:37fc8c16a0894ab7b749e35579856c73c840867b Windows 7? timesbi.ttf */
+    case ENCODE (430, 2874, 40662):
+    /* sha1sum:19fc45110ea6cd3cdd0a5faca256a3797a069a80 Windows 7 timesi.ttf */
+    case ENCODE (442, 2874, 39116):
+    /* sha1sum:6d2d3c9ed5b7de87bc84eae0df95ee5232ecde26 Windows 7 timesbi.ttf */
+    case ENCODE (430, 2874, 39374):
+    /* sha1sum:8583225a8b49667c077b3525333f84af08c6bcd8 OS X 10.11.3 Times New Roman Italic.ttf */
+    case ENCODE (490, 3046, 41638):
+    /* sha1sum:ec0f5a8751845355b7c3271d11f9918a966cb8c9 OS X 10.11.3 Times New Roman Bold Italic.ttf */
+    case ENCODE (478, 3046, 41902):
+    /* sha1sum:96eda93f7d33e79962451c6c39a6b51ee893ce8c  tahoma.ttf from Windows 8 */
+    case ENCODE (898, 12554, 46470):
+    /* sha1sum:20928dc06014e0cd120b6fc942d0c3b1a46ac2bc  tahomabd.ttf from Windows 8 */
+    case ENCODE (910, 12566, 47732):
+    /* sha1sum:4f95b7e4878f60fa3a39ca269618dfde9721a79e  tahoma.ttf from Windows 8.1 */
+    case ENCODE (928, 23298, 59332):
+    /* sha1sum:6d400781948517c3c0441ba42acb309584b73033  tahomabd.ttf from Windows 8.1 */
+    case ENCODE (940, 23310, 60732):
+    /* tahoma.ttf v6.04 from Windows 8.1 x64, see https://bugzilla.mozilla.org/show_bug.cgi?id=1279925 */
+    case ENCODE (964, 23836, 60072):
+    /* tahomabd.ttf v6.04 from Windows 8.1 x64, see https://bugzilla.mozilla.org/show_bug.cgi?id=1279925 */
+    case ENCODE (976, 23832, 61456):
+    /* sha1sum:e55fa2dfe957a9f7ec26be516a0e30b0c925f846  tahoma.ttf from Windows 10 */
+    case ENCODE (994, 24474, 60336):
+    /* sha1sum:7199385abb4c2cc81c83a151a7599b6368e92343  tahomabd.ttf from Windows 10 */
+    case ENCODE (1006, 24470, 61740):
+    /* tahoma.ttf v6.91 from Windows 10 x64, see https://bugzilla.mozilla.org/show_bug.cgi?id=1279925 */
+    case ENCODE (1006, 24576, 61346):
+    /* tahomabd.ttf v6.91 from Windows 10 x64, see https://bugzilla.mozilla.org/show_bug.cgi?id=1279925 */
+    case ENCODE (1018, 24572, 62828):
+    /* sha1sum:b9c84d820c49850d3d27ec498be93955b82772b5  tahoma.ttf from Windows 10 AU */
+    case ENCODE (1006, 24576, 61352):
+    /* sha1sum:2bdfaab28174bdadd2f3d4200a30a7ae31db79d2  tahomabd.ttf from Windows 10 AU */
+    case ENCODE (1018, 24572, 62834):
+    /* sha1sum:b0d36cf5a2fbe746a3dd277bffc6756a820807a7  Tahoma.ttf from Mac OS X 10.9 */
+    case ENCODE (832, 7324, 47162):
+    /* sha1sum:12fc4538e84d461771b30c18b5eb6bd434e30fba  Tahoma Bold.ttf from Mac OS X 10.9 */
+    case ENCODE (844, 7302, 45474):
+    /* sha1sum:eb8afadd28e9cf963e886b23a30b44ab4fd83acc  himalaya.ttf from Windows 7 */
+    case ENCODE (180, 13054, 7254):
+    /* sha1sum:73da7f025b238a3f737aa1fde22577a6370f77b0  himalaya.ttf from Windows 8 */
+    case ENCODE (192, 12638, 7254):
+    /* sha1sum:6e80fd1c0b059bbee49272401583160dc1e6a427  himalaya.ttf from Windows 8.1 */
+    case ENCODE (192, 12690, 7254):
+    /* 8d9267aea9cd2c852ecfb9f12a6e834bfaeafe44  cantarell-fonts-0.0.21/otf/Cantarell-Regular.otf */
+    /* 983988ff7b47439ab79aeaf9a45bd4a2c5b9d371  cantarell-fonts-0.0.21/otf/Cantarell-Oblique.otf */
+    case ENCODE (188, 248, 3852):
+    /* 2c0c90c6f6087ffbfea76589c93113a9cbb0e75f  cantarell-fonts-0.0.21/otf/Cantarell-Bold.otf */
+    /* 55461f5b853c6da88069ffcdf7f4dd3f8d7e3e6b  cantarell-fonts-0.0.21/otf/Cantarell-Bold-Oblique.otf */
+    case ENCODE (188, 264, 3426):
+    /* d125afa82a77a6475ac0e74e7c207914af84b37a padauk-2.80/Padauk.ttf RHEL 7.2 */
+    case ENCODE (1058, 47032, 11818):
+    /* 0f7b80437227b90a577cc078c0216160ae61b031 padauk-2.80/Padauk-Bold.ttf RHEL 7.2*/
+    case ENCODE (1046, 47030, 12600):
+    /* d3dde9aa0a6b7f8f6a89ef1002e9aaa11b882290 padauk-2.80/Padauk.ttf Ubuntu 16.04 */
+    case ENCODE (1058, 71796, 16770):
+    /* 5f3c98ccccae8a953be2d122c1b3a77fd805093f padauk-2.80/Padauk-Bold.ttf Ubuntu 16.04 */
+    case ENCODE (1046, 71790, 17862):
+    /* 6c93b63b64e8b2c93f5e824e78caca555dc887c7 padauk-2.80/Padauk-book.ttf */
+    case ENCODE (1046, 71788, 17112):
+    /* d89b1664058359b8ec82e35d3531931125991fb9 padauk-2.80/Padauk-bookbold.ttf */
+    case ENCODE (1058, 71794, 17514):
+    /* 824cfd193aaf6234b2b4dc0cf3c6ef576c0d00ef padauk-3.0/Padauk-book.ttf */
+    case ENCODE (1330, 109904, 57938):
+    /* 91fcc10cf15e012d27571e075b3b4dfe31754a8a padauk-3.0/Padauk-bookbold.ttf */
+    case ENCODE (1330, 109904, 58972):
+    /* sha1sum: c26e41d567ed821bed997e937bc0c41435689e85  Padauk.ttf
+     *  "Padauk Regular" "Version 2.5", see https://crbug.com/681813 */
+    case ENCODE (1004, 59092, 14836):
+      return true;
+#undef ENCODE
+  }
+  return false;
+}
+
+inline void
+OT::GDEF::accelerator_t::init (hb_face_t *face)
+{
+  this->blob = hb_sanitize_context_t().reference_table<GDEF> (face);
+
+  if (unlikely (_hb_ot_blacklist_gdef (this->blob->length,
+				       _get_gsub_blob (face)->length,
+				       _get_gpos_blob (face)->length)))
+  {
+    hb_blob_destroy (this->blob);
+    this->blob = hb_blob_get_empty ();
+  }
+
+  table = this->blob->as<GDEF> ();
+}
+
 hb_bool_t
 hb_ot_layout_has_glyph_classes (hb_face_t *face)
 {
diff --git a/src/hb-ot-layout.hh b/src/hb-ot-layout.hh
index 03ae9b73..7abaaaa5 100644
--- a/src/hb-ot-layout.hh
+++ b/src/hb-ot-layout.hh
@@ -44,17 +44,9 @@ namespace OT
   struct GPOS;
 }
 
-HB_INTERNAL const OT::GDEF&
-_get_gdef (hb_face_t *face);
-HB_INTERNAL hb_blob_t *
-_get_gsub_blob (hb_face_t *face);
-HB_INTERNAL const OT::GSUB&
-_get_gsub (hb_face_t *face);
-
-HB_INTERNAL hb_blob_t *
-_get_gpos_blob (hb_face_t *face);
-HB_INTERNAL const OT::GPOS&
-_get_gpos (hb_face_t *face);
+HB_INTERNAL const OT::GDEF& _get_gdef (hb_face_t *face);
+HB_INTERNAL const OT::GSUB& _get_gsub (hb_face_t *face);
+HB_INTERNAL const OT::GPOS& _get_gpos (hb_face_t *face);
 
 
 /* Private API corresponding to hb-ot-layout.h: */
commit 453e0c60b1c87d2cd2527d6d2de673f65458a9fd
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sun Aug 26 01:30:52 2018 -0700

    Add template keyword
    
    I swear I have no idea why this is needed, but it is...

diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh
index e7d20fd0..3727dd9e 100644
--- a/src/hb-ot-layout-gsubgpos.hh
+++ b/src/hb-ot-layout-gsubgpos.hh
@@ -2387,7 +2387,7 @@ struct GSUBGPOS
     inline void init (hb_face_t *face)
     {
       this->blob = hb_sanitize_context_t().reference_table<T> (face);
-      table = this->blob->as<T> ();
+      table = this->blob->template as<T> ();
 
       this->lookup_count = table->get_lookup_count ();
 
commit c44b0caf0d0cddb7228dcec0b9d25bb62f641abc
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sun Aug 26 01:29:30 2018 -0700

    Fixup

diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh
index f55df207..7d3c3bad 100644
--- a/src/hb-ot-layout-gpos-table.hh
+++ b/src/hb-ot-layout-gpos-table.hh
@@ -1630,7 +1630,7 @@ GPOS::position_finish_offsets (hb_font_t *font HB_UNUSED, hb_buffer_t *buffer)
 template <typename context_t>
 /*static*/ inline typename context_t::return_t PosLookup::dispatch_recurse_func (context_t *c, unsigned int lookup_index)
 {
-  const PosLookup &l = hb_ot_face_data (c->face)->table.GPOS->get_lookup (lookup_index);
+  const PosLookup &l = _get_gpos (c->face)->get_lookup (lookup_index);
   return l.dispatch (c);
 }
 
commit 4096fbe487d90de04020e32e8487295ecd4d8836
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sun Aug 26 01:25:54 2018 -0700

    [ot-face] Port GDEF to unified table accelerator model as well

diff --git a/src/hb-ot-face.cc b/src/hb-ot-face.cc
index 52411d5c..ffac3d06 100644
--- a/src/hb-ot-face.cc
+++ b/src/hb-ot-face.cc
@@ -27,109 +27,6 @@
 #include "hb-ot-face.hh"
 
 
-static bool
-_hb_ot_blacklist_gdef (unsigned int gdef_len,
-		       unsigned int gsub_len,
-		       unsigned int gpos_len)
-{
-  /* The ugly business of blacklisting individual fonts' tables happen here!
-   * See this thread for why we finally had to bend in and do this:
-   * https://lists.freedesktop.org/archives/harfbuzz/2016-February/005489.html
-   *
-   * In certain versions of Times New Roman Italic and Bold Italic,
-   * ASCII double quotation mark U+0022 has wrong glyph class 3 (mark)
-   * in GDEF.  Many versions of Tahoma have bad GDEF tables that
-   * incorrectly classify some spacing marks such as certain IPA
-   * symbols as glyph class 3. So do older versions of Microsoft
-   * Himalaya, and the version of Cantarell shipped by Ubuntu 16.04.
-   *
-   * Nuke the GDEF tables of to avoid unwanted width-zeroing.
-   *
-   * See https://bugzilla.mozilla.org/show_bug.cgi?id=1279925
-   *     https://bugzilla.mozilla.org/show_bug.cgi?id=1279693
-   *     https://bugzilla.mozilla.org/show_bug.cgi?id=1279875
-   */
-#define ENCODE(x,y,z) ((int64_t) (x) << 32 | (int64_t) (y) << 16 | (z))
-  switch ENCODE(gdef_len, gsub_len, gpos_len)
-  {
-    /* sha1sum:c5ee92f0bca4bfb7d06c4d03e8cf9f9cf75d2e8a Windows 7? timesi.ttf */
-    case ENCODE (442, 2874, 42038):
-    /* sha1sum:37fc8c16a0894ab7b749e35579856c73c840867b Windows 7? timesbi.ttf */
-    case ENCODE (430, 2874, 40662):
-    /* sha1sum:19fc45110ea6cd3cdd0a5faca256a3797a069a80 Windows 7 timesi.ttf */
-    case ENCODE (442, 2874, 39116):
-    /* sha1sum:6d2d3c9ed5b7de87bc84eae0df95ee5232ecde26 Windows 7 timesbi.ttf */
-    case ENCODE (430, 2874, 39374):
-    /* sha1sum:8583225a8b49667c077b3525333f84af08c6bcd8 OS X 10.11.3 Times New Roman Italic.ttf */
-    case ENCODE (490, 3046, 41638):
-    /* sha1sum:ec0f5a8751845355b7c3271d11f9918a966cb8c9 OS X 10.11.3 Times New Roman Bold Italic.ttf */
-    case ENCODE (478, 3046, 41902):
-    /* sha1sum:96eda93f7d33e79962451c6c39a6b51ee893ce8c  tahoma.ttf from Windows 8 */
-    case ENCODE (898, 12554, 46470):
-    /* sha1sum:20928dc06014e0cd120b6fc942d0c3b1a46ac2bc  tahomabd.ttf from Windows 8 */
-    case ENCODE (910, 12566, 47732):
-    /* sha1sum:4f95b7e4878f60fa3a39ca269618dfde9721a79e  tahoma.ttf from Windows 8.1 */
-    case ENCODE (928, 23298, 59332):
-    /* sha1sum:6d400781948517c3c0441ba42acb309584b73033  tahomabd.ttf from Windows 8.1 */
-    case ENCODE (940, 23310, 60732):
-    /* tahoma.ttf v6.04 from Windows 8.1 x64, see https://bugzilla.mozilla.org/show_bug.cgi?id=1279925 */
-    case ENCODE (964, 23836, 60072):
-    /* tahomabd.ttf v6.04 from Windows 8.1 x64, see https://bugzilla.mozilla.org/show_bug.cgi?id=1279925 */
-    case ENCODE (976, 23832, 61456):
-    /* sha1sum:e55fa2dfe957a9f7ec26be516a0e30b0c925f846  tahoma.ttf from Windows 10 */
-    case ENCODE (994, 24474, 60336):
-    /* sha1sum:7199385abb4c2cc81c83a151a7599b6368e92343  tahomabd.ttf from Windows 10 */
-    case ENCODE (1006, 24470, 61740):
-    /* tahoma.ttf v6.91 from Windows 10 x64, see https://bugzilla.mozilla.org/show_bug.cgi?id=1279925 */
-    case ENCODE (1006, 24576, 61346):
-    /* tahomabd.ttf v6.91 from Windows 10 x64, see https://bugzilla.mozilla.org/show_bug.cgi?id=1279925 */
-    case ENCODE (1018, 24572, 62828):
-    /* sha1sum:b9c84d820c49850d3d27ec498be93955b82772b5  tahoma.ttf from Windows 10 AU */
-    case ENCODE (1006, 24576, 61352):
-    /* sha1sum:2bdfaab28174bdadd2f3d4200a30a7ae31db79d2  tahomabd.ttf from Windows 10 AU */
-    case ENCODE (1018, 24572, 62834):
-    /* sha1sum:b0d36cf5a2fbe746a3dd277bffc6756a820807a7  Tahoma.ttf from Mac OS X 10.9 */
-    case ENCODE (832, 7324, 47162):
-    /* sha1sum:12fc4538e84d461771b30c18b5eb6bd434e30fba  Tahoma Bold.ttf from Mac OS X 10.9 */
-    case ENCODE (844, 7302, 45474):
-    /* sha1sum:eb8afadd28e9cf963e886b23a30b44ab4fd83acc  himalaya.ttf from Windows 7 */
-    case ENCODE (180, 13054, 7254):
-    /* sha1sum:73da7f025b238a3f737aa1fde22577a6370f77b0  himalaya.ttf from Windows 8 */
-    case ENCODE (192, 12638, 7254):
-    /* sha1sum:6e80fd1c0b059bbee49272401583160dc1e6a427  himalaya.ttf from Windows 8.1 */
-    case ENCODE (192, 12690, 7254):
-    /* 8d9267aea9cd2c852ecfb9f12a6e834bfaeafe44  cantarell-fonts-0.0.21/otf/Cantarell-Regular.otf */
-    /* 983988ff7b47439ab79aeaf9a45bd4a2c5b9d371  cantarell-fonts-0.0.21/otf/Cantarell-Oblique.otf */
-    case ENCODE (188, 248, 3852):
-    /* 2c0c90c6f6087ffbfea76589c93113a9cbb0e75f  cantarell-fonts-0.0.21/otf/Cantarell-Bold.otf */
-    /* 55461f5b853c6da88069ffcdf7f4dd3f8d7e3e6b  cantarell-fonts-0.0.21/otf/Cantarell-Bold-Oblique.otf */
-    case ENCODE (188, 264, 3426):
-    /* d125afa82a77a6475ac0e74e7c207914af84b37a padauk-2.80/Padauk.ttf RHEL 7.2 */
-    case ENCODE (1058, 47032, 11818):
-    /* 0f7b80437227b90a577cc078c0216160ae61b031 padauk-2.80/Padauk-Bold.ttf RHEL 7.2*/
-    case ENCODE (1046, 47030, 12600):
-    /* d3dde9aa0a6b7f8f6a89ef1002e9aaa11b882290 padauk-2.80/Padauk.ttf Ubuntu 16.04 */
-    case ENCODE (1058, 71796, 16770):
-    /* 5f3c98ccccae8a953be2d122c1b3a77fd805093f padauk-2.80/Padauk-Bold.ttf Ubuntu 16.04 */
-    case ENCODE (1046, 71790, 17862):
-    /* 6c93b63b64e8b2c93f5e824e78caca555dc887c7 padauk-2.80/Padauk-book.ttf */
-    case ENCODE (1046, 71788, 17112):
-    /* d89b1664058359b8ec82e35d3531931125991fb9 padauk-2.80/Padauk-bookbold.ttf */
-    case ENCODE (1058, 71794, 17514):
-    /* 824cfd193aaf6234b2b4dc0cf3c6ef576c0d00ef padauk-3.0/Padauk-book.ttf */
-    case ENCODE (1330, 109904, 57938):
-    /* 91fcc10cf15e012d27571e075b3b4dfe31754a8a padauk-3.0/Padauk-bookbold.ttf */
-    case ENCODE (1330, 109904, 58972):
-    /* sha1sum: c26e41d567ed821bed997e937bc0c41435689e85  Padauk.ttf
-     *  "Padauk Regular" "Version 2.5", see https://crbug.com/681813 */
-    case ENCODE (1004, 59092, 14836):
-      return true;
-#undef ENCODE
-  }
-  return false;
-}
-
-
 void hb_ot_face_data_t::tables_t::init0 (hb_face_t *face)
 {
   this->face = face;
@@ -157,11 +54,6 @@ _hb_ot_face_data_create (hb_face_t *face)
 
   data->table.init0 (face);
 
-  if (unlikely (_hb_ot_blacklist_gdef (data->table.GDEF.get_blob ()->length,
-				       data->table.GSUB->blob->length,
-				       data->table.GPOS->blob->length)))
-    data->table.GDEF.set_stored (hb_blob_get_empty ());
-
   return data;
 }
 
diff --git a/src/hb-ot-face.hh b/src/hb-ot-face.hh
index dd17fbc8..6e7ff2ce 100644
--- a/src/hb-ot-face.hh
+++ b/src/hb-ot-face.hh
@@ -56,7 +56,6 @@
  * This is as good as any place. */
 #define HB_OT_LAYOUT_TABLES \
     /* OpenType shaping. */ \
-    HB_OT_LAYOUT_TABLE(OT, GDEF) \
     HB_OT_LAYOUT_TABLE(OT, JSTF) \
     HB_OT_LAYOUT_TABLE(OT, BASE) \
     /* AAT shaping. */ \
@@ -71,6 +70,7 @@
     /* OpenType math. */ \
     HB_OT_LAYOUT_TABLE(OT, MATH) \
     /* OpenType fundamentals. */ \
+    HB_OT_LAYOUT_ACCELERATOR(OT, GDEF) \
     HB_OT_LAYOUT_ACCELERATOR(OT, GSUB) \
     HB_OT_LAYOUT_ACCELERATOR(OT, GPOS) \
     HB_OT_LAYOUT_ACCELERATOR(OT, cmap) \
diff --git a/src/hb-ot-layout-gdef-table.hh b/src/hb-ot-layout-gdef-table.hh
index 637f7f5c..950b654f 100644
--- a/src/hb-ot-layout-gdef-table.hh
+++ b/src/hb-ot-layout-gdef-table.hh
@@ -337,6 +337,110 @@ struct MarkGlyphSets
  * https://docs.microsoft.com/en-us/typography/opentype/spec/gdef
  */
 
+static bool
+_hb_ot_blacklist_gdef (unsigned int gdef_len,
+		       unsigned int gsub_len,
+		       unsigned int gpos_len)
+{
+  /* The ugly business of blacklisting individual fonts' tables happen here!
+   * See this thread for why we finally had to bend in and do this:
+   * https://lists.freedesktop.org/archives/harfbuzz/2016-February/005489.html
+   *
+   * In certain versions of Times New Roman Italic and Bold Italic,
+   * ASCII double quotation mark U+0022 has wrong glyph class 3 (mark)
+   * in GDEF.  Many versions of Tahoma have bad GDEF tables that
+   * incorrectly classify some spacing marks such as certain IPA
+   * symbols as glyph class 3. So do older versions of Microsoft
+   * Himalaya, and the version of Cantarell shipped by Ubuntu 16.04.
+   *
+   * Nuke the GDEF tables of to avoid unwanted width-zeroing.
+   *
+   * See https://bugzilla.mozilla.org/show_bug.cgi?id=1279925
+   *     https://bugzilla.mozilla.org/show_bug.cgi?id=1279693
+   *     https://bugzilla.mozilla.org/show_bug.cgi?id=1279875
+   */
+#define ENCODE(x,y,z) ((int64_t) (x) << 32 | (int64_t) (y) << 16 | (z))
+  switch ENCODE(gdef_len, gsub_len, gpos_len)
+  {
+    /* sha1sum:c5ee92f0bca4bfb7d06c4d03e8cf9f9cf75d2e8a Windows 7? timesi.ttf */
+    case ENCODE (442, 2874, 42038):
+    /* sha1sum:37fc8c16a0894ab7b749e35579856c73c840867b Windows 7? timesbi.ttf */
+    case ENCODE (430, 2874, 40662):
+    /* sha1sum:19fc45110ea6cd3cdd0a5faca256a3797a069a80 Windows 7 timesi.ttf */
+    case ENCODE (442, 2874, 39116):
+    /* sha1sum:6d2d3c9ed5b7de87bc84eae0df95ee5232ecde26 Windows 7 timesbi.ttf */
+    case ENCODE (430, 2874, 39374):
+    /* sha1sum:8583225a8b49667c077b3525333f84af08c6bcd8 OS X 10.11.3 Times New Roman Italic.ttf */
+    case ENCODE (490, 3046, 41638):
+    /* sha1sum:ec0f5a8751845355b7c3271d11f9918a966cb8c9 OS X 10.11.3 Times New Roman Bold Italic.ttf */
+    case ENCODE (478, 3046, 41902):
+    /* sha1sum:96eda93f7d33e79962451c6c39a6b51ee893ce8c  tahoma.ttf from Windows 8 */
+    case ENCODE (898, 12554, 46470):
+    /* sha1sum:20928dc06014e0cd120b6fc942d0c3b1a46ac2bc  tahomabd.ttf from Windows 8 */
+    case ENCODE (910, 12566, 47732):
+    /* sha1sum:4f95b7e4878f60fa3a39ca269618dfde9721a79e  tahoma.ttf from Windows 8.1 */
+    case ENCODE (928, 23298, 59332):
+    /* sha1sum:6d400781948517c3c0441ba42acb309584b73033  tahomabd.ttf from Windows 8.1 */
+    case ENCODE (940, 23310, 60732):
+    /* tahoma.ttf v6.04 from Windows 8.1 x64, see https://bugzilla.mozilla.org/show_bug.cgi?id=1279925 */
+    case ENCODE (964, 23836, 60072):
+    /* tahomabd.ttf v6.04 from Windows 8.1 x64, see https://bugzilla.mozilla.org/show_bug.cgi?id=1279925 */
+    case ENCODE (976, 23832, 61456):
+    /* sha1sum:e55fa2dfe957a9f7ec26be516a0e30b0c925f846  tahoma.ttf from Windows 10 */
+    case ENCODE (994, 24474, 60336):
+    /* sha1sum:7199385abb4c2cc81c83a151a7599b6368e92343  tahomabd.ttf from Windows 10 */
+    case ENCODE (1006, 24470, 61740):
+    /* tahoma.ttf v6.91 from Windows 10 x64, see https://bugzilla.mozilla.org/show_bug.cgi?id=1279925 */
+    case ENCODE (1006, 24576, 61346):
+    /* tahomabd.ttf v6.91 from Windows 10 x64, see https://bugzilla.mozilla.org/show_bug.cgi?id=1279925 */
+    case ENCODE (1018, 24572, 62828):
+    /* sha1sum:b9c84d820c49850d3d27ec498be93955b82772b5  tahoma.ttf from Windows 10 AU */
+    case ENCODE (1006, 24576, 61352):
+    /* sha1sum:2bdfaab28174bdadd2f3d4200a30a7ae31db79d2  tahomabd.ttf from Windows 10 AU */
+    case ENCODE (1018, 24572, 62834):
+    /* sha1sum:b0d36cf5a2fbe746a3dd277bffc6756a820807a7  Tahoma.ttf from Mac OS X 10.9 */
+    case ENCODE (832, 7324, 47162):
+    /* sha1sum:12fc4538e84d461771b30c18b5eb6bd434e30fba  Tahoma Bold.ttf from Mac OS X 10.9 */
+    case ENCODE (844, 7302, 45474):
+    /* sha1sum:eb8afadd28e9cf963e886b23a30b44ab4fd83acc  himalaya.ttf from Windows 7 */
+    case ENCODE (180, 13054, 7254):
+    /* sha1sum:73da7f025b238a3f737aa1fde22577a6370f77b0  himalaya.ttf from Windows 8 */
+    case ENCODE (192, 12638, 7254):
+    /* sha1sum:6e80fd1c0b059bbee49272401583160dc1e6a427  himalaya.ttf from Windows 8.1 */
+    case ENCODE (192, 12690, 7254):
+    /* 8d9267aea9cd2c852ecfb9f12a6e834bfaeafe44  cantarell-fonts-0.0.21/otf/Cantarell-Regular.otf */
+    /* 983988ff7b47439ab79aeaf9a45bd4a2c5b9d371  cantarell-fonts-0.0.21/otf/Cantarell-Oblique.otf */
+    case ENCODE (188, 248, 3852):
+    /* 2c0c90c6f6087ffbfea76589c93113a9cbb0e75f  cantarell-fonts-0.0.21/otf/Cantarell-Bold.otf */
+    /* 55461f5b853c6da88069ffcdf7f4dd3f8d7e3e6b  cantarell-fonts-0.0.21/otf/Cantarell-Bold-Oblique.otf */
+    case ENCODE (188, 264, 3426):
+    /* d125afa82a77a6475ac0e74e7c207914af84b37a padauk-2.80/Padauk.ttf RHEL 7.2 */
+    case ENCODE (1058, 47032, 11818):
+    /* 0f7b80437227b90a577cc078c0216160ae61b031 padauk-2.80/Padauk-Bold.ttf RHEL 7.2*/
+    case ENCODE (1046, 47030, 12600):
+    /* d3dde9aa0a6b7f8f6a89ef1002e9aaa11b882290 padauk-2.80/Padauk.ttf Ubuntu 16.04 */
+    case ENCODE (1058, 71796, 16770):
+    /* 5f3c98ccccae8a953be2d122c1b3a77fd805093f padauk-2.80/Padauk-Bold.ttf Ubuntu 16.04 */
+    case ENCODE (1046, 71790, 17862):
+    /* 6c93b63b64e8b2c93f5e824e78caca555dc887c7 padauk-2.80/Padauk-book.ttf */
+    case ENCODE (1046, 71788, 17112):
+    /* d89b1664058359b8ec82e35d3531931125991fb9 padauk-2.80/Padauk-bookbold.ttf */
+    case ENCODE (1058, 71794, 17514):
+    /* 824cfd193aaf6234b2b4dc0cf3c6ef576c0d00ef padauk-3.0/Padauk-book.ttf */
+    case ENCODE (1330, 109904, 57938):
+    /* 91fcc10cf15e012d27571e075b3b4dfe31754a8a padauk-3.0/Padauk-bookbold.ttf */
+    case ENCODE (1330, 109904, 58972):
+    /* sha1sum: c26e41d567ed821bed997e937bc0c41435689e85  Padauk.ttf
+     *  "Padauk Regular" "Version 2.5", see https://crbug.com/681813 */
+    case ENCODE (1004, 59092, 14836):
+      return true;
+#undef ENCODE
+  }
+  return false;
+}
+
+
+
 struct GDEF
 {
   static const hb_tag_t tableTag	= HB_OT_TAG_GDEF;
@@ -420,6 +524,31 @@ struct GDEF
     }
   }
 
+  struct accelerator_t
+  {
+    inline void init (hb_face_t *face)
+    {
+      this->blob = hb_sanitize_context_t().reference_table<GDEF> (face);
+
+      if (unlikely (_hb_ot_blacklist_gdef (this->blob->length,
+					   _get_gsub_blob (face)->length,
+					   _get_gpos_blob (face)->length)))
+      {
+	hb_blob_destroy (this->blob);
+	this->blob = hb_blob_get_empty ();
+      }
+
+      table = this->blob->as<GDEF> ();
+    }
+
+    inline void fini (void)
+    {
+      hb_blob_destroy (this->blob);
+    }
+
+    hb_blob_t *blob;
+    const GDEF *table;
+  };
 
   protected:
   FixedVersion<>version;		/* Version of the GDEF table--currently
diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc
index ffbb38bb..a2482326 100644
--- a/src/hb-ot-layout.cc
+++ b/src/hb-ot-layout.cc
@@ -60,7 +60,13 @@ inline const OT::GDEF&
 _get_gdef (hb_face_t *face)
 {
   if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::GDEF);
-  return *hb_ot_face_data (face)->table.GDEF;
+  return *hb_ot_face_data (face)->table.GDEF->table;
+}
+hb_blob_t *
+_get_gsub_blob (hb_face_t *face)
+{
+  if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return hb_blob_get_empty ();
+  return hb_ot_face_data (face)->table.GSUB->blob;
 }
 inline const OT::GSUB&
 _get_gsub (hb_face_t *face)
@@ -68,6 +74,12 @@ _get_gsub (hb_face_t *face)
   if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::GSUB);
   return *hb_ot_face_data (face)->table.GSUB->table;
 }
+hb_blob_t *
+_get_gpos_blob (hb_face_t *face)
+{
+  if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return hb_blob_get_empty ();
+  return hb_ot_face_data (face)->table.GPOS->blob;
+}
 inline const OT::GPOS&
 _get_gpos (hb_face_t *face)
 {
diff --git a/src/hb-ot-layout.hh b/src/hb-ot-layout.hh
index ea66d108..03ae9b73 100644
--- a/src/hb-ot-layout.hh
+++ b/src/hb-ot-layout.hh
@@ -46,10 +46,13 @@ namespace OT
 
 HB_INTERNAL const OT::GDEF&
 _get_gdef (hb_face_t *face);
-
+HB_INTERNAL hb_blob_t *
+_get_gsub_blob (hb_face_t *face);
 HB_INTERNAL const OT::GSUB&
 _get_gsub (hb_face_t *face);
 
+HB_INTERNAL hb_blob_t *
+_get_gpos_blob (hb_face_t *face);
 HB_INTERNAL const OT::GPOS&
 _get_gpos (hb_face_t *face);
 
commit b929100f8782816c2621715f6c007ecefc419d83
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sun Aug 26 01:15:47 2018 -0700

    [ot-face] Unify GSUB/GPOS accelerators in the table accelerator framework

diff --git a/src/hb-aat-layout.cc b/src/hb-aat-layout.cc
index 24ec53bc..c481e6a8 100644
--- a/src/hb-aat-layout.cc
+++ b/src/hb-aat-layout.cc
@@ -26,9 +26,7 @@
 
 #include "hb-open-type.hh"
 
-#include "hb-ot-layout.hh"
-#include "hb-ot-layout-gsubgpos.hh"
-
+#include "hb-ot-face.hh"
 #include "hb-aat-layout.hh"
 #include "hb-aat-layout-ankr-table.hh"
 #include "hb-aat-layout-bsln-table.hh" // Just so we compile it; unused otherwise.
diff --git a/src/hb-ot-face.cc b/src/hb-ot-face.cc
index 7b97ce51..52411d5c 100644
--- a/src/hb-ot-face.cc
+++ b/src/hb-ot-face.cc
@@ -26,10 +26,6 @@
 
 #include "hb-ot-face.hh"
 
-#include "hb-ot-layout-gdef-table.hh"
-#include "hb-ot-layout-gsub-table.hh"
-#include "hb-ot-layout-gpos-table.hh"
-
 
 static bool
 _hb_ot_blacklist_gdef (unsigned int gdef_len,
@@ -161,50 +157,18 @@ _hb_ot_face_data_create (hb_face_t *face)
 
   data->table.init0 (face);
 
-  const OT::GSUB &gsub = *data->table.GSUB;
-  const OT::GPOS &gpos = *data->table.GPOS;
-
   if (unlikely (_hb_ot_blacklist_gdef (data->table.GDEF.get_blob ()->length,
-				       data->table.GSUB.get_blob ()->length,
-				       data->table.GPOS.get_blob ()->length)))
+				       data->table.GSUB->blob->length,
+				       data->table.GPOS->blob->length)))
     data->table.GDEF.set_stored (hb_blob_get_empty ());
 
-  unsigned int gsub_lookup_count = data->gsub_lookup_count = gsub.get_lookup_count ();
-  unsigned int gpos_lookup_count = data->gpos_lookup_count = gpos.get_lookup_count ();
-
-  data->gsub_accels = (hb_ot_layout_lookup_accelerator_t *) calloc (gsub_lookup_count, sizeof (hb_ot_layout_lookup_accelerator_t));
-  data->gpos_accels = (hb_ot_layout_lookup_accelerator_t *) calloc (gpos_lookup_count, sizeof (hb_ot_layout_lookup_accelerator_t));
-
-  if (unlikely ((gsub_lookup_count && !data->gsub_accels) ||
-		(gpos_lookup_count && !data->gpos_accels)))
-  {
-    _hb_ot_face_data_destroy (data);
-    return nullptr;
-  }
-
-  for (unsigned int i = 0; i < gsub_lookup_count; i++)
-    data->gsub_accels[i].init (gsub.get_lookup (i));
-  for (unsigned int i = 0; i < gpos_lookup_count; i++)
-    data->gpos_accels[i].init (gpos.get_lookup (i));
-
   return data;
 }
 
 void
 _hb_ot_face_data_destroy (hb_ot_face_data_t *data)
 {
-  if (data->gsub_accels)
-    for (unsigned int i = 0; i < data->gsub_lookup_count; i++)
-      data->gsub_accels[i].fini ();
-  if (data->gpos_accels)
-    for (unsigned int i = 0; i < data->gpos_lookup_count; i++)
-      data->gpos_accels[i].fini ();
-
-  free (data->gsub_accels);
-  free (data->gpos_accels);
-
   data->table.fini ();
-
   free (data);
 }
 
diff --git a/src/hb-ot-face.hh b/src/hb-ot-face.hh
index 1466f11b..dd17fbc8 100644
--- a/src/hb-ot-face.hh
+++ b/src/hb-ot-face.hh
@@ -33,12 +33,19 @@
 
 #include "hb-machinery.hh"
 
+
+#define hb_ot_face_data(face) ((hb_ot_face_data_t *) face->shaper_data.ot.get_relaxed ())
+
+
 #include "hb-ot-cmap-table.hh"
 #include "hb-ot-glyf-table.hh"
 #include "hb-ot-hmtx-table.hh"
 #include "hb-ot-kern-table.hh"
 #include "hb-ot-post-table.hh"
 #include "hb-ot-color-cbdt-table.hh"
+#include "hb-ot-layout-gdef-table.hh"
+#include "hb-ot-layout-gsub-table.hh"
+#include "hb-ot-layout-gpos-table.hh"
 
 
 /*
@@ -50,8 +57,6 @@
 #define HB_OT_LAYOUT_TABLES \
     /* OpenType shaping. */ \
     HB_OT_LAYOUT_TABLE(OT, GDEF) \
-    HB_OT_LAYOUT_TABLE(OT, GSUB) \
-    HB_OT_LAYOUT_TABLE(OT, GPOS) \
     HB_OT_LAYOUT_TABLE(OT, JSTF) \
     HB_OT_LAYOUT_TABLE(OT, BASE) \
     /* AAT shaping. */ \
@@ -66,6 +71,8 @@
     /* OpenType math. */ \
     HB_OT_LAYOUT_TABLE(OT, MATH) \
     /* OpenType fundamentals. */ \
+    HB_OT_LAYOUT_ACCELERATOR(OT, GSUB) \
+    HB_OT_LAYOUT_ACCELERATOR(OT, GPOS) \
     HB_OT_LAYOUT_ACCELERATOR(OT, cmap) \
     HB_OT_LAYOUT_ACCELERATOR(OT, hmtx) \
     HB_OT_LAYOUT_ACCELERATOR(OT, vmtx) \
@@ -104,19 +111,13 @@ struct hb_ot_face_data_t
 
     hb_face_t *face; /* MUST be JUST before the lazy loaders. */
 #define HB_OT_LAYOUT_TABLE(Namespace, Type) \
-    hb_table_lazy_loader_t<struct Namespace::Type, HB_OT_LAYOUT_TABLE_ORDER (Namespace, Type)> Type;
+    hb_table_lazy_loader_t<Namespace::Type, HB_OT_LAYOUT_TABLE_ORDER (Namespace, Type)> Type;
 #define HB_OT_LAYOUT_ACCELERATOR(Namespace, Type) \
-    hb_face_lazy_loader_t<struct Namespace::Type::accelerator_t, HB_OT_LAYOUT_TABLE_ORDER (Namespace, Type)> Type;
+    hb_face_lazy_loader_t<Namespace::Type::accelerator_t, HB_OT_LAYOUT_TABLE_ORDER (Namespace, Type)> Type;
     HB_OT_LAYOUT_TABLES
 #undef HB_OT_LAYOUT_ACCELERATOR
 #undef HB_OT_LAYOUT_TABLE
   } table;
-
-  /* More accelerators.  Merge into previous. */
-  unsigned int gsub_lookup_count;
-  unsigned int gpos_lookup_count;
-  hb_ot_layout_lookup_accelerator_t *gsub_accels;
-  hb_ot_layout_lookup_accelerator_t *gpos_accels;
 };
 
 
@@ -127,8 +128,4 @@ HB_INTERNAL void
 _hb_ot_face_data_destroy (hb_ot_face_data_t *data);
 
 
-#define hb_ot_face_data(face) ((hb_ot_face_data_t *) face->shaper_data.ot.get_relaxed ())
-
-
-
 #endif /* HB_OT_FACE_HH */
diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh
index e1a40506..f55df207 100644
--- a/src/hb-ot-layout-gpos-table.hh
+++ b/src/hb-ot-layout-gpos-table.hh
@@ -1636,7 +1636,7 @@ template <typename context_t>
 
 /*static*/ inline bool PosLookup::apply_recurse_func (hb_ot_apply_context_t *c, unsigned int lookup_index)
 {
-  const PosLookup &l = hb_ot_face_data (c->face)->table.GPOS->get_lookup (lookup_index);
+  const PosLookup &l = _get_gpos (c->face).get_lookup (lookup_index);
   unsigned int saved_lookup_props = c->lookup_props;
   unsigned int saved_lookup_index = c->lookup_index;
   c->set_lookup_index (lookup_index);
diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh
index 59e8a43f..991b5566 100644
--- a/src/hb-ot-layout-gsub-table.hh
+++ b/src/hb-ot-layout-gsub-table.hh
@@ -1327,7 +1327,7 @@ GSUB::substitute_start (hb_font_t *font, hb_buffer_t *buffer)
 {
   _hb_buffer_assert_gsubgpos_vars (buffer);
 
-  const GDEF &gdef = *hb_ot_face_data (font->face)->table.GDEF;
+  const GDEF &gdef = _get_gdef (font->face);
   unsigned int count = buffer->len;
   for (unsigned int i = 0; i < count; i++)
   {
@@ -1351,13 +1351,13 @@ GSUB::substitute_start (hb_font_t *font, hb_buffer_t *buffer)
 template <typename context_t>
 /*static*/ inline typename context_t::return_t SubstLookup::dispatch_recurse_func (context_t *c, unsigned int lookup_index)
 {
-  const SubstLookup &l = hb_ot_face_data (c->face)->table.GSUB->get_lookup (lookup_index);
+  const SubstLookup &l = _get_gsub (c->face).get_lookup (lookup_index);
   return l.dispatch (c);
 }
 
 /*static*/ inline bool SubstLookup::apply_recurse_func (hb_ot_apply_context_t *c, unsigned int lookup_index)
 {
-  const SubstLookup &l = hb_ot_face_data (c->face)->table.GSUB->get_lookup (lookup_index);
+  const SubstLookup &l = _get_gsub (c->face).get_lookup (lookup_index);
   unsigned int saved_lookup_props = c->lookup_props;
   unsigned int saved_lookup_index = c->lookup_index;
   c->set_lookup_index (lookup_index);
diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh
index 44b595ae..e7d20fd0 100644
--- a/src/hb-ot-layout-gsubgpos.hh
+++ b/src/hb-ot-layout-gsubgpos.hh
@@ -32,9 +32,9 @@
 #include "hb.hh"
 #include "hb-buffer.hh"
 #include "hb-map.hh"
-#include "hb-ot-face.hh"
-#include "hb-ot-layout-gdef-table.hh"
 #include "hb-set.hh"
+#include "hb-ot-layout-common.hh"
+#include "hb-ot-layout-gdef-table.hh"
 
 
 namespace OT {
@@ -481,7 +481,7 @@ struct hb_ot_apply_context_t :
 			iter_input (), iter_context (),
 			font (font_), face (font->face), buffer (buffer_),
 			recurse_func (nullptr),
-			gdef (*hb_ot_face_data (face)->table.GDEF),
+			gdef (_get_gdef (face)),
 			var_store (gdef.get_var_store ()),
 			direction (buffer_->props.direction),
 			lookup_mask (1),
@@ -2387,28 +2387,30 @@ struct GSUBGPOS
     inline void init (hb_face_t *face)
     {
       this->blob = hb_sanitize_context_t().reference_table<T> (face);
-      const T &table = *this->blob->as<T> ();
+      table = this->blob->as<T> ();
 
-      this->lookup_count = table.get_lookup_count ();
+      this->lookup_count = table->get_lookup_count ();
 
       this->accels = (hb_ot_layout_lookup_accelerator_t *) calloc (this->lookup_count, sizeof (hb_ot_layout_lookup_accelerator_t));
       if (unlikely (!this->accels))
         this->lookup_count = 0;
 
       for (unsigned int i = 0; i < this->lookup_count; i++)
-	this->accels[i].init (table.get_lookup (i));
+	this->accels[i].init (table->get_lookup (i));
     }
 
     inline void fini (void)
     {
+      for (unsigned int i = 0; i < this->lookup_count; i++)
+	this->accels[i].fini ();
+      free (this->accels);
       hb_blob_destroy (this->blob);
-      free (accels);
     }
 
-    private:
-      hb_blob_t *blob;
-      unsigned int lookup_count;
-      hb_ot_layout_lookup_accelerator_t *accels;
+    hb_blob_t *blob;
+    const T *table;
+    unsigned int lookup_count;
+    hb_ot_layout_lookup_accelerator_t *accels;
   };
 
   protected:
diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc
index b9bb17fc..ffbb38bb 100644
--- a/src/hb-ot-layout.cc
+++ b/src/hb-ot-layout.cc
@@ -30,6 +30,7 @@
 
 #include "hb-open-type.hh"
 #include "hb-ot-layout.hh"
+#include "hb-ot-face.hh"
 #include "hb-ot-map.hh"
 #include "hb-map.hh"
 
@@ -55,23 +56,23 @@
 //   return *(data->base.get ());
 // }
 
-static inline const OT::GDEF&
+inline const OT::GDEF&
 _get_gdef (hb_face_t *face)
 {
   if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::GDEF);
   return *hb_ot_face_data (face)->table.GDEF;
 }
-static inline const OT::GSUB&
+inline const OT::GSUB&
 _get_gsub (hb_face_t *face)
 {
   if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::GSUB);
-  return *hb_ot_face_data (face)->table.GSUB;
+  return *hb_ot_face_data (face)->table.GSUB->table;
 }
-static inline const OT::GPOS&
+inline const OT::GPOS&
 _get_gpos (hb_face_t *face)
 {
   if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::GPOS);
-  return *hb_ot_face_data (face)->table.GPOS;
+  return *hb_ot_face_data (face)->table.GPOS->table;
 }
 
 /*
@@ -461,11 +462,11 @@ hb_ot_layout_table_get_lookup_count (hb_face_t    *face,
   {
     case HB_OT_TAG_GSUB:
     {
-      return hb_ot_face_data (face)->gsub_lookup_count;
+      return hb_ot_face_data (face)->table.GSUB->lookup_count;
     }
     case HB_OT_TAG_GPOS:
     {
-      return hb_ot_face_data (face)->gpos_lookup_count;
+      return hb_ot_face_data (face)->table.GPOS->lookup_count;
     }
   }
   return 0;
@@ -679,13 +680,13 @@ hb_ot_layout_lookup_collect_glyphs (hb_face_t    *face,
   {
     case HB_OT_TAG_GSUB:
     {
-      const OT::SubstLookup& l = hb_ot_face_data (face)->table.GSUB->get_lookup (lookup_index);
+      const OT::SubstLookup& l = hb_ot_face_data (face)->table.GSUB->table->get_lookup (lookup_index);
       l.collect_glyphs (&c);
       return;
     }
     case HB_OT_TAG_GPOS:
     {
-      const OT::PosLookup& l = hb_ot_face_data (face)->table.GPOS->get_lookup (lookup_index);
+      const OT::PosLookup& l = hb_ot_face_data (face)->table.GPOS->table->get_lookup (lookup_index);
       l.collect_glyphs (&c);
       return;
     }
@@ -758,12 +759,12 @@ hb_ot_layout_lookup_would_substitute_fast (hb_face_t            *face,
 					   unsigned int          glyphs_length,
 					   hb_bool_t             zero_context)
 {
-  if (unlikely (lookup_index >= hb_ot_face_data (face)->gsub_lookup_count)) return false;
+  if (unlikely (lookup_index >= hb_ot_face_data (face)->table.GSUB->lookup_count)) return false;
   OT::hb_would_apply_context_t c (face, glyphs, glyphs_length, (bool) zero_context);
 
-  const OT::SubstLookup& l = hb_ot_face_data (face)->table.GSUB->get_lookup (lookup_index);
+  const OT::SubstLookup& l = hb_ot_face_data (face)->table.GSUB->table->get_lookup (lookup_index);
 
-  return l.would_apply (&c, &hb_ot_face_data (face)->gsub_accels[lookup_index]);
+  return l.would_apply (&c, &hb_ot_face_data (face)->table.GSUB->accels[lookup_index]);
 }
 
 void
@@ -919,8 +920,8 @@ struct GSUBProxy
   typedef OT::SubstLookup Lookup;
 
   GSUBProxy (hb_face_t *face) :
-    table (*hb_ot_face_data (face)->table.GSUB),
-    accels (hb_ot_face_data (face)->gsub_accels) {}
+    table (*hb_ot_face_data (face)->table.GSUB->table),
+    accels (hb_ot_face_data (face)->table.GSUB->accels) {}
 
   const OT::GSUB &table;
   const hb_ot_layout_lookup_accelerator_t *accels;
@@ -933,8 +934,8 @@ struct GPOSProxy
   typedef OT::PosLookup Lookup;
 
   GPOSProxy (hb_face_t *face) :
-    table (*hb_ot_face_data (face)->table.GPOS),
-    accels (hb_ot_face_data (face)->gpos_accels) {}
+    table (*hb_ot_face_data (face)->table.GPOS->table),
+    accels (hb_ot_face_data (face)->table.GPOS->accels) {}
 
   const OT::GPOS &table;
   const hb_ot_layout_lookup_accelerator_t *accels;
diff --git a/src/hb-ot-layout.hh b/src/hb-ot-layout.hh
index 02c8c7b2..ea66d108 100644
--- a/src/hb-ot-layout.hh
+++ b/src/hb-ot-layout.hh
@@ -37,6 +37,23 @@
 #include "hb-set-digest.hh"
 
 
+namespace OT
+{
+  struct GDEF;
+  struct GSUB;
+  struct GPOS;
+}
+
+HB_INTERNAL const OT::GDEF&
+_get_gdef (hb_face_t *face);
+
+HB_INTERNAL const OT::GSUB&
+_get_gsub (hb_face_t *face);
+
+HB_INTERNAL const OT::GPOS&
+_get_gpos (hb_face_t *face);
+
+
 /* Private API corresponding to hb-ot-layout.h: */
 
 HB_INTERNAL hb_bool_t
diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc
index e571bd8a..63102f6b 100644
--- a/src/hb-ot-shape.cc
+++ b/src/hb-ot-shape.cc
@@ -35,6 +35,7 @@
 #include "hb-ot-shape-fallback.hh"
 #include "hb-ot-shape-normalize.hh"
 
+#include "hb-ot-face.hh"
 #include "hb-ot-layout.hh"
 #include "hb-unicode.hh"
 #include "hb-set.hh"
commit 963413fc5454d92621ae83a8d9c9324e404b8166
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sun Aug 26 00:47:55 2018 -0700

    WIP

diff --git a/src/hb-ot-cmap-table.hh b/src/hb-ot-cmap-table.hh
index cdf67f1e..c357714e 100644
--- a/src/hb-ot-cmap-table.hh
+++ b/src/hb-ot-cmap-table.hh
@@ -1018,7 +1018,6 @@ struct cmap
   {
     inline void init (hb_face_t *face)
     {
-      /* TODO Switch to using table from face->ot.table. */
       this->blob = hb_sanitize_context_t().reference_table<cmap> (face);
       const cmap *table = this->blob->as<cmap> ();
       const CmapSubtableFormat14 *subtable_uvs = nullptr;
diff --git a/src/hb-ot-face.hh b/src/hb-ot-face.hh
index bbbc6e2c..1466f11b 100644
--- a/src/hb-ot-face.hh
+++ b/src/hb-ot-face.hh
@@ -32,7 +32,6 @@
 #include "hb.hh"
 
 #include "hb-machinery.hh"
-#include "hb-set-digest.hh"
 
 #include "hb-ot-cmap-table.hh"
 #include "hb-ot-glyf-table.hh"
@@ -46,27 +45,6 @@
  * hb_ot_face_data_t
  */
 
-struct hb_ot_layout_lookup_accelerator_t
-{
-  template <typename TLookup>
-  inline void init (const TLookup &lookup)
-  {
-    digest.init ();
-    lookup.add_coverage (&digest);
-  }
-
-  inline void fini (void)
-  {
-  }
-
-  inline bool may_have (hb_codepoint_t g) const {
-    return digest.may_have (g);
-  }
-
-  private:
-  hb_set_digest_t digest;
-};
-
 /* Most of these tables are NOT needed for shaping.  But we need to hook them *somewhere*.
  * This is as good as any place. */
 #define HB_OT_LAYOUT_TABLES \
diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh
index 66767dfd..e1a40506 100644
--- a/src/hb-ot-layout-gpos-table.hh
+++ b/src/hb-ot-layout-gpos-table.hh
@@ -1522,6 +1522,8 @@ struct GPOS : GSUBGPOS
     const OffsetTo<PosLookupList> &list = CastR<OffsetTo<PosLookupList> > (lookupList);
     return_trace (list.sanitize (c, this));
   }
+
+  typedef GSUBGPOS::accelerator_t<GPOS> accelerator_t;
 };
 
 
diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh
index d2c1fb9a..59e8a43f 100644
--- a/src/hb-ot-layout-gsub-table.hh
+++ b/src/hb-ot-layout-gsub-table.hh
@@ -1317,6 +1317,8 @@ struct GSUB : GSUBGPOS
     const OffsetTo<SubstLookupList> &list = CastR<OffsetTo<SubstLookupList> > (lookupList);
     return_trace (list.sanitize (c, this));
   }
+
+  typedef GSUBGPOS::accelerator_t<GSUB> accelerator_t;
 };
 
 
diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh
index d21c3dea..44b595ae 100644
--- a/src/hb-ot-layout-gsubgpos.hh
+++ b/src/hb-ot-layout-gsubgpos.hh
@@ -988,7 +988,6 @@ struct LookupRecord
   DEFINE_SIZE_STATIC (4);
 };
 
-
 template <typename context_t>
 static inline void recurse_lookups (context_t *c,
 				    unsigned int lookupCount,
@@ -2382,6 +2381,36 @@ struct GSUBGPOS
 		  (version.to_int () < 0x00010001u || featureVars.sanitize (c, this)));
   }
 
+  template <typename T>
+  struct accelerator_t
+  {
+    inline void init (hb_face_t *face)
+    {
+      this->blob = hb_sanitize_context_t().reference_table<T> (face);
+      const T &table = *this->blob->as<T> ();
+
+      this->lookup_count = table.get_lookup_count ();
+
+      this->accels = (hb_ot_layout_lookup_accelerator_t *) calloc (this->lookup_count, sizeof (hb_ot_layout_lookup_accelerator_t));
+      if (unlikely (!this->accels))
+        this->lookup_count = 0;
+
+      for (unsigned int i = 0; i < this->lookup_count; i++)
+	this->accels[i].init (table.get_lookup (i));
+    }
+
+    inline void fini (void)
+    {
+      hb_blob_destroy (this->blob);
+      free (accels);
+    }
+
+    private:
+      hb_blob_t *blob;
+      unsigned int lookup_count;
+      hb_ot_layout_lookup_accelerator_t *accels;
+  };
+
   protected:
   FixedVersion<>version;	/* Version of the GSUB/GPOS table--initially set
 				 * to 0x00010000u */
diff --git a/src/hb-ot-layout.hh b/src/hb-ot-layout.hh
index fcc0998f..02c8c7b2 100644
--- a/src/hb-ot-layout.hh
+++ b/src/hb-ot-layout.hh
@@ -34,6 +34,7 @@
 #include "hb-font.hh"
 #include "hb-buffer.hh"
 #include "hb-open-type.hh"
+#include "hb-set-digest.hh"
 
 
 /* Private API corresponding to hb-ot-layout.h: */
@@ -86,7 +87,22 @@ hb_ot_layout_substitute_start (hb_font_t    *font,
 			       hb_buffer_t  *buffer);
 
 
-struct hb_ot_layout_lookup_accelerator_t;
+struct hb_ot_layout_lookup_accelerator_t
+{
+  template <typename TLookup>
+  inline void init (const TLookup &lookup)
+  {
+    digest.init ();
+    lookup.add_coverage (&digest);
+  }
+  inline void fini (void) {}
+
+  inline bool may_have (hb_codepoint_t g) const
+  { return digest.may_have (g); }
+
+  private:
+  hb_set_digest_t digest;
+};
 
 namespace OT {
   struct hb_ot_apply_context_t;
commit e6cb9380651c753485f721bd3df523d03be41d91
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sun Aug 26 00:21:29 2018 -0700

    [ot-face] Unify accelerators and tables

diff --git a/src/hb-machinery.hh b/src/hb-machinery.hh
index 293b64a3..35a8b6c1 100644
--- a/src/hb-machinery.hh
+++ b/src/hb-machinery.hh
@@ -815,9 +815,9 @@ struct hb_lazy_loader_t : hb_data_wrapper_t<Data, WheresData>
 
 /* Specializations. */
 
-template <unsigned int WheresFace, typename T>
+template <typename T, unsigned int WheresFace>
 struct hb_face_lazy_loader_t : hb_lazy_loader_t<T,
-						hb_face_lazy_loader_t<WheresFace, T>,
+						hb_face_lazy_loader_t<T, WheresFace>,
 						hb_face_t, WheresFace> {};
 
 template <typename T, unsigned int WheresFace>
diff --git a/src/hb-ot-cmap-table.hh b/src/hb-ot-cmap-table.hh
index 6ff23e3d..cdf67f1e 100644
--- a/src/hb-ot-cmap-table.hh
+++ b/src/hb-ot-cmap-table.hh
@@ -843,7 +843,8 @@ struct cmap
 {
   static const hb_tag_t tableTag	= HB_OT_TAG_cmap;
 
-  struct subset_plan {
+  struct subset_plan
+  {
     subset_plan(void)
     {
       format4_segments.init();
diff --git a/src/hb-ot-face.cc b/src/hb-ot-face.cc
index 121037f8..7b97ce51 100644
--- a/src/hb-ot-face.cc
+++ b/src/hb-ot-face.cc
@@ -138,13 +138,17 @@ void hb_ot_face_data_t::tables_t::init0 (hb_face_t *face)
 {
   this->face = face;
 #define HB_OT_LAYOUT_TABLE(Namespace, Type) Type.init0 ();
+#define HB_OT_LAYOUT_ACCELERATOR(Namespace, Type) HB_OT_LAYOUT_TABLE (Namespace, Type)
   HB_OT_LAYOUT_TABLES
+#undef HB_OT_LAYOUT_ACCELERATOR
 #undef HB_OT_LAYOUT_TABLE
 }
 void hb_ot_face_data_t::tables_t::fini (void)
 {
 #define HB_OT_LAYOUT_TABLE(Namespace, Type) Type.fini ();
+#define HB_OT_LAYOUT_ACCELERATOR(Namespace, Type) HB_OT_LAYOUT_TABLE (Namespace, Type)
   HB_OT_LAYOUT_TABLES
+#undef HB_OT_LAYOUT_ACCELERATOR
 #undef HB_OT_LAYOUT_TABLE
 }
 
@@ -156,7 +160,6 @@ _hb_ot_face_data_create (hb_face_t *face)
     return nullptr;
 
   data->table.init0 (face);
-  data->accel.init0 (face);
 
   const OT::GSUB &gsub = *data->table.GSUB;
   const OT::GPOS &gpos = *data->table.GPOS;
@@ -200,7 +203,6 @@ _hb_ot_face_data_destroy (hb_ot_face_data_t *data)
   free (data->gsub_accels);
   free (data->gpos_accels);
 
-  data->accel.fini ();
   data->table.fini ();
 
   free (data);
diff --git a/src/hb-ot-face.hh b/src/hb-ot-face.hh
index 3bda84d6..bbbc6e2c 100644
--- a/src/hb-ot-face.hh
+++ b/src/hb-ot-face.hh
@@ -85,21 +85,23 @@ struct hb_ot_layout_lookup_accelerator_t
     HB_OT_LAYOUT_TABLE(OT, fvar) \
     HB_OT_LAYOUT_TABLE(OT, avar) \
     HB_OT_LAYOUT_TABLE(OT, MVAR) \
-    /* OpenType color. */ \
-    HB_OT_LAYOUT_TABLE(OT, COLR) \
-    HB_OT_LAYOUT_TABLE(OT, CPAL) \
-    HB_OT_LAYOUT_TABLE(OT, CBDT) \
-    HB_OT_LAYOUT_TABLE(OT, CBLC) \
-    HB_OT_LAYOUT_TABLE(OT, sbix) \
-    HB_OT_LAYOUT_TABLE(OT, svg) \
     /* OpenType math. */ \
     HB_OT_LAYOUT_TABLE(OT, MATH) \
     /* OpenType fundamentals. */ \
+    HB_OT_LAYOUT_ACCELERATOR(OT, cmap) \
+    HB_OT_LAYOUT_ACCELERATOR(OT, hmtx) \
+    HB_OT_LAYOUT_ACCELERATOR(OT, vmtx) \
+    HB_OT_LAYOUT_ACCELERATOR(OT, post) \
+    HB_OT_LAYOUT_ACCELERATOR(OT, kern) \
+    HB_OT_LAYOUT_ACCELERATOR(OT, glyf) \
+    HB_OT_LAYOUT_ACCELERATOR(OT, CBDT) \
     /* */
 
 /* Declare tables. */
 #define HB_OT_LAYOUT_TABLE(Namespace, Type) namespace Namespace { struct Type; }
+#define HB_OT_LAYOUT_ACCELERATOR(Namespace, Type) HB_OT_LAYOUT_TABLE (Namespace, Type)
 HB_OT_LAYOUT_TABLES
+#undef HB_OT_LAYOUT_ACCELERATOR
 #undef HB_OT_LAYOUT_TABLE
 
 struct hb_ot_face_data_t
@@ -115,53 +117,23 @@ struct hb_ot_face_data_t
     enum order_t
     {
       ORDER_ZERO,
-#define HB_OT_LAYOUT_TABLE(Namespace, Type) \
-	HB_OT_LAYOUT_TABLE_ORDER (Namespace, Type),
+#define HB_OT_LAYOUT_TABLE(Namespace, Type) HB_OT_LAYOUT_TABLE_ORDER (Namespace, Type),
+#define HB_OT_LAYOUT_ACCELERATOR(Namespace, Type) HB_OT_LAYOUT_TABLE (Namespace, Type)
       HB_OT_LAYOUT_TABLES
+#undef HB_OT_LAYOUT_ACCELERATOR
 #undef HB_OT_LAYOUT_TABLE
     };
 
     hb_face_t *face; /* MUST be JUST before the lazy loaders. */
 #define HB_OT_LAYOUT_TABLE(Namespace, Type) \
     hb_table_lazy_loader_t<struct Namespace::Type, HB_OT_LAYOUT_TABLE_ORDER (Namespace, Type)> Type;
+#define HB_OT_LAYOUT_ACCELERATOR(Namespace, Type) \
+    hb_face_lazy_loader_t<struct Namespace::Type::accelerator_t, HB_OT_LAYOUT_TABLE_ORDER (Namespace, Type)> Type;
     HB_OT_LAYOUT_TABLES
+#undef HB_OT_LAYOUT_ACCELERATOR
 #undef HB_OT_LAYOUT_TABLE
   } table;
 
-  struct accelerator_t
-  {
-    inline void init0 (hb_face_t *face)
-    {
-      this->face = face;
-      cmap.init0 ();
-      hmtx.init0 ();
-      vmtx.init0 ();
-      glyf.init0 ();
-      cbdt.init0 ();
-      post.init0 ();
-      kern.init0 ();
-    }
-    inline void fini (void)
-    {
-      cmap.fini ();
-      hmtx.fini ();
-      vmtx.fini ();
-      glyf.fini ();
-      cbdt.fini ();
-      post.fini ();
-      kern.fini ();
-    }
-
-    hb_face_t *face; /* MUST be JUST before the lazy loaders. */
-    hb_face_lazy_loader_t<1, OT::cmap::accelerator_t> cmap;
-    hb_face_lazy_loader_t<2, OT::hmtx::accelerator_t> hmtx;
-    hb_face_lazy_loader_t<3, OT::vmtx::accelerator_t> vmtx;
-    hb_face_lazy_loader_t<4, OT::glyf::accelerator_t> glyf;
-    hb_face_lazy_loader_t<5, OT::CBDT::accelerator_t> cbdt;
-    hb_face_lazy_loader_t<6, OT::post::accelerator_t> post;
-    hb_face_lazy_loader_t<7, OT::kern::accelerator_t> kern;
-  } accel;
-
   /* More accelerators.  Merge into previous. */
   unsigned int gsub_lookup_count;
   unsigned int gpos_lookup_count;
diff --git a/src/hb-ot-font.cc b/src/hb-ot-font.cc
index 61831153..c96cba41 100644
--- a/src/hb-ot-font.cc
+++ b/src/hb-ot-font.cc
@@ -33,7 +33,7 @@
 #include "hb-ot-face.hh"
 
 
-typedef hb_ot_face_data_t::accelerator_t hb_ot_font_t;
+typedef hb_ot_face_data_t::tables_t hb_ot_font_t;
 
 
 static hb_bool_t
@@ -101,7 +101,7 @@ hb_ot_get_glyph_extents (hb_font_t *font,
   const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
   bool ret = ot_font->glyf->get_extents (glyph, extents);
   if (!ret)
-    ret = ot_font->cbdt->get_extents (glyph, extents);
+    ret = ot_font->CBDT->get_extents (glyph, extents);
   // TODO Hook up side-bearings variations.
   extents->x_bearing = font->em_scale_x (extents->x_bearing);
   extents->y_bearing = font->em_scale_y (extents->y_bearing);
@@ -219,7 +219,7 @@ void
 hb_ot_font_set_funcs (hb_font_t *font)
 {
   if (unlikely (!hb_ot_shaper_face_data_ensure (font->face))) return;
-  hb_ot_font_t *ot_font =  &hb_ot_face_data (font->face)->accel;
+  hb_ot_font_t *ot_font =  &hb_ot_face_data (font->face)->table;
 
   /* Load them lazies.  We access them with get_relaxed() for performance. */
   ot_font->cmap.get ();
commit 7f8b6fe67d64b41786edbf8650efb1c0deba573f
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sun Aug 26 00:07:12 2018 -0700

    Minor

diff --git a/src/hb-ot-face.hh b/src/hb-ot-face.hh
index 29ec6a73..3bda84d6 100644
--- a/src/hb-ot-face.hh
+++ b/src/hb-ot-face.hh
@@ -95,7 +95,6 @@ struct hb_ot_layout_lookup_accelerator_t
     /* OpenType math. */ \
     HB_OT_LAYOUT_TABLE(OT, MATH) \
     /* OpenType fundamentals. */ \
-    HB_OT_LAYOUT_TABLE(OT, post) \
     /* */
 
 /* Declare tables. */
commit 59bca0d2cb6010bc237afb2255ccda3b8dd0585d
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sun Aug 26 00:06:12 2018 -0700

    [ot-font] Rename

diff --git a/src/hb-ot-face.hh b/src/hb-ot-face.hh
index 25d830d1..29ec6a73 100644
--- a/src/hb-ot-face.hh
+++ b/src/hb-ot-face.hh
@@ -135,8 +135,8 @@ struct hb_ot_face_data_t
     {
       this->face = face;
       cmap.init0 ();
-      h_metrics.init0 ();
-      v_metrics.init0 ();
+      hmtx.init0 ();
+      vmtx.init0 ();
       glyf.init0 ();
       cbdt.init0 ();
       post.init0 ();
@@ -145,8 +145,8 @@ struct hb_ot_face_data_t
     inline void fini (void)
     {
       cmap.fini ();
-      h_metrics.fini ();
-      v_metrics.fini ();
+      hmtx.fini ();
+      vmtx.fini ();
       glyf.fini ();
       cbdt.fini ();
       post.fini ();
@@ -155,8 +155,8 @@ struct hb_ot_face_data_t
 
     hb_face_t *face; /* MUST be JUST before the lazy loaders. */
     hb_face_lazy_loader_t<1, OT::cmap::accelerator_t> cmap;
-    hb_face_lazy_loader_t<2, OT::hmtx::accelerator_t> h_metrics;
-    hb_face_lazy_loader_t<3, OT::vmtx::accelerator_t> v_metrics;
+    hb_face_lazy_loader_t<2, OT::hmtx::accelerator_t> hmtx;
+    hb_face_lazy_loader_t<3, OT::vmtx::accelerator_t> vmtx;
     hb_face_lazy_loader_t<4, OT::glyf::accelerator_t> glyf;
     hb_face_lazy_loader_t<5, OT::CBDT::accelerator_t> cbdt;
     hb_face_lazy_loader_t<6, OT::post::accelerator_t> post;
diff --git a/src/hb-ot-font.cc b/src/hb-ot-font.cc
index 60af5fb1..61831153 100644
--- a/src/hb-ot-font.cc
+++ b/src/hb-ot-font.cc
@@ -67,7 +67,7 @@ hb_ot_get_glyph_h_advance (hb_font_t *font,
 			   void *user_data HB_UNUSED)
 {
   const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
-  return font->em_scale_x (ot_font->h_metrics.get_relaxed ()->get_advance (glyph, font));
+  return font->em_scale_x (ot_font->hmtx.get_relaxed ()->get_advance (glyph, font));
 }
 
 static hb_position_t
@@ -77,7 +77,7 @@ hb_ot_get_glyph_v_advance (hb_font_t *font,
 			   void *user_data HB_UNUSED)
 {
   const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
-  return font->em_scale_y (-(int) ot_font->v_metrics.get_relaxed ()->get_advance (glyph, font));
+  return font->em_scale_y (-(int) ot_font->vmtx.get_relaxed ()->get_advance (glyph, font));
 }
 
 static hb_position_t
@@ -139,11 +139,11 @@ hb_ot_get_font_h_extents (hb_font_t *font,
 			  void *user_data HB_UNUSED)
 {
   const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
-  metrics->ascender = font->em_scale_y (ot_font->h_metrics.get_relaxed ()->ascender);
-  metrics->descender = font->em_scale_y (ot_font->h_metrics.get_relaxed ()->descender);
-  metrics->line_gap = font->em_scale_y (ot_font->h_metrics.get_relaxed ()->line_gap);
+  metrics->ascender = font->em_scale_y (ot_font->hmtx.get_relaxed ()->ascender);
+  metrics->descender = font->em_scale_y (ot_font->hmtx.get_relaxed ()->descender);
+  metrics->line_gap = font->em_scale_y (ot_font->hmtx.get_relaxed ()->line_gap);
   // TODO Hook up variations.
-  return ot_font->h_metrics.get_relaxed ()->has_font_extents;
+  return ot_font->hmtx.get_relaxed ()->has_font_extents;
 }
 
 static hb_bool_t
@@ -153,11 +153,11 @@ hb_ot_get_font_v_extents (hb_font_t *font,
 			  void *user_data HB_UNUSED)
 {
   const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
-  metrics->ascender = font->em_scale_x (ot_font->v_metrics.get_relaxed ()->ascender);
-  metrics->descender = font->em_scale_x (ot_font->v_metrics.get_relaxed ()->descender);
-  metrics->line_gap = font->em_scale_x (ot_font->v_metrics.get_relaxed ()->line_gap);
+  metrics->ascender = font->em_scale_x (ot_font->vmtx.get_relaxed ()->ascender);
+  metrics->descender = font->em_scale_x (ot_font->vmtx.get_relaxed ()->descender);
+  metrics->line_gap = font->em_scale_x (ot_font->vmtx.get_relaxed ()->line_gap);
   // TODO Hook up variations.
-  return ot_font->v_metrics.get_relaxed ()->has_font_extents;
+  return ot_font->vmtx.get_relaxed ()->has_font_extents;
 }
 
 #ifdef HB_USE_ATEXIT
@@ -223,8 +223,8 @@ hb_ot_font_set_funcs (hb_font_t *font)
 
   /* Load them lazies.  We access them with get_relaxed() for performance. */
   ot_font->cmap.get ();
-  ot_font->h_metrics.get ();
-  ot_font->v_metrics.get ();
+  ot_font->hmtx.get ();
+  ot_font->vmtx.get ();
 
   hb_font_set_funcs (font,
 		     _hb_ot_get_font_funcs (),
commit 1c48a7ef06b82ef9ca013066d1fb3c6fda82aa0c
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sat Aug 25 23:54:06 2018 -0700

    [ot-font] Cache tables on face, not font

diff --git a/src/hb-ot-cmap-table.hh b/src/hb-ot-cmap-table.hh
index dce29813..6ff23e3d 100644
--- a/src/hb-ot-cmap-table.hh
+++ b/src/hb-ot-cmap-table.hh
@@ -1017,6 +1017,7 @@ struct cmap
   {
     inline void init (hb_face_t *face)
     {
+      /* TODO Switch to using table from face->ot.table. */
       this->blob = hb_sanitize_context_t().reference_table<cmap> (face);
       const cmap *table = this->blob->as<cmap> ();
       const CmapSubtableFormat14 *subtable_uvs = nullptr;
diff --git a/src/hb-ot-face.cc b/src/hb-ot-face.cc
index 819a9000..121037f8 100644
--- a/src/hb-ot-face.cc
+++ b/src/hb-ot-face.cc
@@ -156,6 +156,7 @@ _hb_ot_face_data_create (hb_face_t *face)
     return nullptr;
 
   data->table.init0 (face);
+  data->accel.init0 (face);
 
   const OT::GSUB &gsub = *data->table.GSUB;
   const OT::GPOS &gpos = *data->table.GPOS;
@@ -199,6 +200,7 @@ _hb_ot_face_data_destroy (hb_ot_face_data_t *data)
   free (data->gsub_accels);
   free (data->gpos_accels);
 
+  data->accel.fini ();
   data->table.fini ();
 
   free (data);
diff --git a/src/hb-ot-face.hh b/src/hb-ot-face.hh
index ade14f4a..25d830d1 100644
--- a/src/hb-ot-face.hh
+++ b/src/hb-ot-face.hh
@@ -34,6 +34,13 @@
 #include "hb-machinery.hh"
 #include "hb-set-digest.hh"
 
+#include "hb-ot-cmap-table.hh"
+#include "hb-ot-glyf-table.hh"
+#include "hb-ot-hmtx-table.hh"
+#include "hb-ot-kern-table.hh"
+#include "hb-ot-post-table.hh"
+#include "hb-ot-color-cbdt-table.hh"
+
 
 /*
  * hb_ot_face_data_t
@@ -98,13 +105,7 @@ HB_OT_LAYOUT_TABLES
 
 struct hb_ot_face_data_t
 {
-  unsigned int gsub_lookup_count;
-  unsigned int gpos_lookup_count;
-
-  hb_ot_layout_lookup_accelerator_t *gsub_accels;
-  hb_ot_layout_lookup_accelerator_t *gpos_accels;
-
-  /* Various non-shaping tables. */
+  /* All the president's tables. */
   struct tables_t
   {
     HB_INTERNAL void init0 (hb_face_t *face);
@@ -127,6 +128,46 @@ struct hb_ot_face_data_t
     HB_OT_LAYOUT_TABLES
 #undef HB_OT_LAYOUT_TABLE
   } table;
+
+  struct accelerator_t
+  {
+    inline void init0 (hb_face_t *face)
+    {
+      this->face = face;
+      cmap.init0 ();
+      h_metrics.init0 ();
+      v_metrics.init0 ();
+      glyf.init0 ();
+      cbdt.init0 ();
+      post.init0 ();
+      kern.init0 ();
+    }
+    inline void fini (void)
+    {
+      cmap.fini ();
+      h_metrics.fini ();
+      v_metrics.fini ();
+      glyf.fini ();
+      cbdt.fini ();
+      post.fini ();
+      kern.fini ();
+    }
+
+    hb_face_t *face; /* MUST be JUST before the lazy loaders. */
+    hb_face_lazy_loader_t<1, OT::cmap::accelerator_t> cmap;
+    hb_face_lazy_loader_t<2, OT::hmtx::accelerator_t> h_metrics;
+    hb_face_lazy_loader_t<3, OT::vmtx::accelerator_t> v_metrics;
+    hb_face_lazy_loader_t<4, OT::glyf::accelerator_t> glyf;
+    hb_face_lazy_loader_t<5, OT::CBDT::accelerator_t> cbdt;
+    hb_face_lazy_loader_t<6, OT::post::accelerator_t> post;
+    hb_face_lazy_loader_t<7, OT::kern::accelerator_t> kern;
+  } accel;
+
+  /* More accelerators.  Merge into previous. */
+  unsigned int gsub_lookup_count;
+  unsigned int gpos_lookup_count;
+  hb_ot_layout_lookup_accelerator_t *gsub_accels;
+  hb_ot_layout_lookup_accelerator_t *gpos_accels;
 };
 
 
diff --git a/src/hb-ot-font.cc b/src/hb-ot-font.cc
index 1ec6423e..60af5fb1 100644
--- a/src/hb-ot-font.cc
+++ b/src/hb-ot-font.cc
@@ -30,73 +30,10 @@
 
 #include "hb-font.hh"
 #include "hb-machinery.hh"
+#include "hb-ot-face.hh"
 
-#include "hb-ot-cmap-table.hh"
-#include "hb-ot-glyf-table.hh"
-#include "hb-ot-hmtx-table.hh"
-#include "hb-ot-kern-table.hh"
-#include "hb-ot-post-table.hh"
 
-#include "hb-ot-color-cbdt-table.hh"
-
-
-struct hb_ot_font_t
-{
-  inline void init0 (hb_face_t *face)
-  {
-    this->face = face;
-    cmap.init0 ();
-    h_metrics.init0 ();
-    v_metrics.init0 ();
-    glyf.init0 ();
-    cbdt.init0 ();
-    post.init0 ();
-    kern.init0 ();
-  }
-  inline void fini (void)
-  {
-    cmap.fini ();
-    h_metrics.fini ();
-    v_metrics.fini ();
-    glyf.fini ();
-    cbdt.fini ();
-    post.fini ();
-    kern.fini ();
-  }
-
-  hb_face_t *face; /* MUST be JUST before the lazy loaders. */
-  hb_face_lazy_loader_t<1, OT::cmap::accelerator_t> cmap;
-  hb_face_lazy_loader_t<2, OT::hmtx::accelerator_t> h_metrics;
-  hb_face_lazy_loader_t<3, OT::vmtx::accelerator_t> v_metrics;
-  hb_face_lazy_loader_t<4, OT::glyf::accelerator_t> glyf;
-  hb_face_lazy_loader_t<5, OT::CBDT::accelerator_t> cbdt;
-  hb_face_lazy_loader_t<6, OT::post::accelerator_t> post;
-  hb_face_lazy_loader_t<7, OT::kern::accelerator_t> kern;
-};
-
-
-static hb_ot_font_t *
-_hb_ot_font_create (hb_face_t *face)
-{
-  hb_ot_font_t *ot_font = (hb_ot_font_t *) calloc (1, sizeof (hb_ot_font_t));
-
-  if (unlikely (!ot_font))
-    return nullptr;
-
-  ot_font->init0 (face);
-
-  return ot_font;
-}
-
-static void
-_hb_ot_font_destroy (void *data)
-{
-  hb_ot_font_t *ot_font = (hb_ot_font_t *) data;
-
-  ot_font->fini ();
-
-  free (ot_font);
-}
+typedef hb_ot_face_data_t::accelerator_t hb_ot_font_t;
 
 
 static hb_bool_t
@@ -281,10 +218,10 @@ _hb_ot_get_font_funcs (void)
 void
 hb_ot_font_set_funcs (hb_font_t *font)
 {
-  hb_ot_font_t *ot_font = _hb_ot_font_create (font->face);
-  if (unlikely (!ot_font))
-    return;
+  if (unlikely (!hb_ot_shaper_face_data_ensure (font->face))) return;
+  hb_ot_font_t *ot_font =  &hb_ot_face_data (font->face)->accel;
 
+  /* Load them lazies.  We access them with get_relaxed() for performance. */
   ot_font->cmap.get ();
   ot_font->h_metrics.get ();
   ot_font->v_metrics.get ();
@@ -292,5 +229,5 @@ hb_ot_font_set_funcs (hb_font_t *font)
   hb_font_set_funcs (font,
 		     _hb_ot_get_font_funcs (),
 		     ot_font,
-		     _hb_ot_font_destroy);
+		     nullptr);
 }
diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh
index 76a7e253..d21c3dea 100644
--- a/src/hb-ot-layout-gsubgpos.hh
+++ b/src/hb-ot-layout-gsubgpos.hh
@@ -32,6 +32,7 @@
 #include "hb.hh"
 #include "hb-buffer.hh"
 #include "hb-map.hh"
+#include "hb-ot-face.hh"
 #include "hb-ot-layout-gdef-table.hh"
 #include "hb-set.hh"
 
diff --git a/src/hb-ot-layout.hh b/src/hb-ot-layout.hh
index 2790aecb..fcc0998f 100644
--- a/src/hb-ot-layout.hh
+++ b/src/hb-ot-layout.hh
@@ -34,7 +34,6 @@
 #include "hb-font.hh"
 #include "hb-buffer.hh"
 #include "hb-open-type.hh"
-#include "hb-ot-face.hh"
 
 
 /* Private API corresponding to hb-ot-layout.h: */
commit 71f8893eff56bff651e3df6288becc68ecea6cd1
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sat Aug 25 23:27:45 2018 -0700

    [ot-font] Use init0

diff --git a/src/hb-ot-font.cc b/src/hb-ot-font.cc
index 19149ca5..1ec6423e 100644
--- a/src/hb-ot-font.cc
+++ b/src/hb-ot-font.cc
@@ -42,16 +42,16 @@
 
 struct hb_ot_font_t
 {
-  inline void init (hb_face_t *face)
+  inline void init0 (hb_face_t *face)
   {
     this->face = face;
-    cmap.init ();
-    h_metrics.init ();
-    v_metrics.init ();
-    glyf.init ();
-    cbdt.init ();
-    post.init ();
-    kern.init ();
+    cmap.init0 ();
+    h_metrics.init0 ();
+    v_metrics.init0 ();
+    glyf.init0 ();
+    cbdt.init0 ();
+    post.init0 ();
+    kern.init0 ();
   }
   inline void fini (void)
   {
@@ -83,7 +83,7 @@ _hb_ot_font_create (hb_face_t *face)
   if (unlikely (!ot_font))
     return nullptr;
 
-  ot_font->init (face);
+  ot_font->init0 (face);
 
   return ot_font;
 }
commit f36ae6f8a82485bbf727f24dfd7da8f32002cad6
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sat Aug 25 23:19:34 2018 -0700

    [ot-font] Make everything (cmap/metrics) lazy

diff --git a/src/hb-machinery.hh b/src/hb-machinery.hh
index 56ecff85..293b64a3 100644
--- a/src/hb-machinery.hh
+++ b/src/hb-machinery.hh
@@ -763,6 +763,10 @@ struct hb_lazy_loader_t : hb_data_wrapper_t<Data, WheresData>
     }
     return p;
   }
+  inline Stored * get_stored_relaxed (void) const
+  {
+    return this->instance.get_relaxed ();
+  }
 
   inline void set_stored (Stored *instance_)
   {
@@ -776,6 +780,7 @@ struct hb_lazy_loader_t : hb_data_wrapper_t<Data, WheresData>
   }
 
   inline const Returned * get (void) const { return Funcs::convert (get_stored ()); }
+  inline const Returned * get_relaxed (void) const { return Funcs::convert (get_stored_relaxed ()); }
   inline Returned * get_unconst (void) const { return const_cast<Returned *> (Funcs::convert (get_stored ())); }
 
   /* To be possibly overloaded by subclasses. */
diff --git a/src/hb-ot-font.cc b/src/hb-ot-font.cc
index 6e6415a7..19149ca5 100644
--- a/src/hb-ot-font.cc
+++ b/src/hb-ot-font.cc
@@ -44,11 +44,10 @@ struct hb_ot_font_t
 {
   inline void init (hb_face_t *face)
   {
-    cmap.init (face);
-    h_metrics.init (face);
-    v_metrics.init (face);
-
     this->face = face;
+    cmap.init ();
+    h_metrics.init ();
+    v_metrics.init ();
     glyf.init ();
     cbdt.init ();
     post.init ();
@@ -59,22 +58,20 @@ struct hb_ot_font_t
     cmap.fini ();
     h_metrics.fini ();
     v_metrics.fini ();
-
     glyf.fini ();
     cbdt.fini ();
     post.fini ();
     kern.fini ();
   }
 
-  OT::cmap::accelerator_t cmap;
-  OT::hmtx::accelerator_t h_metrics;
-  OT::vmtx::accelerator_t v_metrics;
-
   hb_face_t *face; /* MUST be JUST before the lazy loaders. */
-  hb_face_lazy_loader_t<1, OT::glyf::accelerator_t> glyf;
-  hb_face_lazy_loader_t<2, OT::CBDT::accelerator_t> cbdt;
-  hb_face_lazy_loader_t<3, OT::post::accelerator_t> post;
-  hb_face_lazy_loader_t<4, OT::kern::accelerator_t> kern;
+  hb_face_lazy_loader_t<1, OT::cmap::accelerator_t> cmap;
+  hb_face_lazy_loader_t<2, OT::hmtx::accelerator_t> h_metrics;
+  hb_face_lazy_loader_t<3, OT::vmtx::accelerator_t> v_metrics;
+  hb_face_lazy_loader_t<4, OT::glyf::accelerator_t> glyf;
+  hb_face_lazy_loader_t<5, OT::CBDT::accelerator_t> cbdt;
+  hb_face_lazy_loader_t<6, OT::post::accelerator_t> post;
+  hb_face_lazy_loader_t<7, OT::kern::accelerator_t> kern;
 };
 
 
@@ -111,7 +108,7 @@ hb_ot_get_nominal_glyph (hb_font_t *font HB_UNUSED,
 
 {
   const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
-  return ot_font->cmap.get_nominal_glyph (unicode, glyph);
+  return ot_font->cmap.get_relaxed()->get_nominal_glyph (unicode, glyph);
 }
 
 static hb_bool_t
@@ -123,7 +120,7 @@ hb_ot_get_variation_glyph (hb_font_t *font HB_UNUSED,
 			   void *user_data HB_UNUSED)
 {
   const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
-  return ot_font->cmap.get_variation_glyph (unicode, variation_selector, glyph);
+  return ot_font->cmap.get_relaxed ()->get_variation_glyph (unicode, variation_selector, glyph);
 }
 
 static hb_position_t
@@ -133,7 +130,7 @@ hb_ot_get_glyph_h_advance (hb_font_t *font,
 			   void *user_data HB_UNUSED)
 {
   const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
-  return font->em_scale_x (ot_font->h_metrics.get_advance (glyph, font));
+  return font->em_scale_x (ot_font->h_metrics.get_relaxed ()->get_advance (glyph, font));
 }
 
 static hb_position_t
@@ -143,7 +140,7 @@ hb_ot_get_glyph_v_advance (hb_font_t *font,
 			   void *user_data HB_UNUSED)
 {
   const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
-  return font->em_scale_y (-(int) ot_font->v_metrics.get_advance (glyph, font));
+  return font->em_scale_y (-(int) ot_font->v_metrics.get_relaxed ()->get_advance (glyph, font));
 }
 
 static hb_position_t
@@ -205,11 +202,11 @@ hb_ot_get_font_h_extents (hb_font_t *font,
 			  void *user_data HB_UNUSED)
 {
   const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
-  metrics->ascender = font->em_scale_y (ot_font->h_metrics.ascender);
-  metrics->descender = font->em_scale_y (ot_font->h_metrics.descender);
-  metrics->line_gap = font->em_scale_y (ot_font->h_metrics.line_gap);
+  metrics->ascender = font->em_scale_y (ot_font->h_metrics.get_relaxed ()->ascender);
+  metrics->descender = font->em_scale_y (ot_font->h_metrics.get_relaxed ()->descender);
+  metrics->line_gap = font->em_scale_y (ot_font->h_metrics.get_relaxed ()->line_gap);
   // TODO Hook up variations.
-  return ot_font->h_metrics.has_font_extents;
+  return ot_font->h_metrics.get_relaxed ()->has_font_extents;
 }
 
 static hb_bool_t
@@ -219,11 +216,11 @@ hb_ot_get_font_v_extents (hb_font_t *font,
 			  void *user_data HB_UNUSED)
 {
   const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
-  metrics->ascender = font->em_scale_x (ot_font->v_metrics.ascender);
-  metrics->descender = font->em_scale_x (ot_font->v_metrics.descender);
-  metrics->line_gap = font->em_scale_x (ot_font->v_metrics.line_gap);
+  metrics->ascender = font->em_scale_x (ot_font->v_metrics.get_relaxed ()->ascender);
+  metrics->descender = font->em_scale_x (ot_font->v_metrics.get_relaxed ()->descender);
+  metrics->line_gap = font->em_scale_x (ot_font->v_metrics.get_relaxed ()->line_gap);
   // TODO Hook up variations.
-  return ot_font->v_metrics.has_font_extents;
+  return ot_font->v_metrics.get_relaxed ()->has_font_extents;
 }
 
 #ifdef HB_USE_ATEXIT
@@ -288,6 +285,10 @@ hb_ot_font_set_funcs (hb_font_t *font)
   if (unlikely (!ot_font))
     return;
 
+  ot_font->cmap.get ();
+  ot_font->h_metrics.get ();
+  ot_font->v_metrics.get ();
+
   hb_font_set_funcs (font,
 		     _hb_ot_get_font_funcs (),
 		     ot_font,
commit 62fc54725a3863473829f3a3748c9336e4dc0787
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sat Aug 25 23:15:52 2018 -0700

    [ot-font] Fallback vertical advance to UPEM
    
    Used to be ascent+descent.  Whatever. This is more convenient for
    upcoming changes.

diff --git a/src/hb-ot-font.cc b/src/hb-ot-font.cc
index f6e69d9e..6e6415a7 100644
--- a/src/hb-ot-font.cc
+++ b/src/hb-ot-font.cc
@@ -46,7 +46,7 @@ struct hb_ot_font_t
   {
     cmap.init (face);
     h_metrics.init (face);
-    v_metrics.init (face, h_metrics.ascender - h_metrics.descender); /* TODO Can we do this lazily? */
+    v_metrics.init (face);
 
     this->face = face;
     glyf.init ();
diff --git a/test/shaping/data/in-house/tests/vertical.tests b/test/shaping/data/in-house/tests/vertical.tests
index 17df28e6..a16a7a00 100644
--- a/test/shaping/data/in-house/tests/vertical.tests
+++ b/test/shaping/data/in-house/tests/vertical.tests
@@ -1,3 +1,3 @@
 ../fonts/191826b9643e3f124d865d617ae609db6a2ce203.ttf:--direction=t --font-funcs=ft:U+300C:[uni300C.vert=0 at -512,-578+0,-1024]
 ../fonts/f9b1dd4dcb515e757789a22cb4241107746fd3d0.ttf:--direction=t --font-funcs=ft:U+0041,U+0042:[gid1=0 at -654,-2128+0,-2789|gid2=1 at -665,-2125+0,-2789]
-../fonts/f9b1dd4dcb515e757789a22cb4241107746fd3d0.ttf:--direction=t --font-funcs=ot:U+0041,U+0042:[gid1=0 at -654,-2189+0,-2789|gid2=1 at -665,-2189+0,-2789]
+../fonts/f9b1dd4dcb515e757789a22cb4241107746fd3d0.ttf:--direction=t --font-funcs=ot:U+0041,U+0042:[gid1=0 at -654,-2189+0,-2048|gid2=1 at -665,-2189+0,-2048]
commit d950022c8ae3f85546272b38b187d6ed9f5ff16f
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sat Aug 25 23:06:37 2018 -0700

    Add hb-ot-face.cc/hh

diff --git a/src/Makefile.sources b/src/Makefile.sources
index 32b49c95..0d975383 100644
--- a/src/Makefile.sources
+++ b/src/Makefile.sources
@@ -98,6 +98,8 @@ HB_OT_sources = \
 	hb-aat-layout-trak-table.hh \
 	hb-aat-layout.hh \
 	hb-aat-ltag-table.hh \
+	hb-ot-face.hh \
+	hb-ot-face.cc \
 	hb-ot-font.cc \
 	hb-ot-layout.cc \
 	hb-ot-layout-base-table.hh \
diff --git a/src/hb-ot-face.cc b/src/hb-ot-face.cc
new file mode 100644
index 00000000..819a9000
--- /dev/null
+++ b/src/hb-ot-face.cc
@@ -0,0 +1,206 @@
+/*
+ * Copyright © 2018  Google, Inc.
+ *
+ *  This is part of HarfBuzz, a text shaping library.
+ *
+ * Permission is hereby granted, without written agreement and without
+ * license or royalty fees, to use, copy, modify, and distribute this
+ * software and its documentation for any purpose, provided that the
+ * above copyright notice and the following two paragraphs appear in
+ * all copies of this software.
+ *
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
+ * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
+ * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
+ * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
+ * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
+ * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ *
+ * Google Author(s): Behdad Esfahbod
+ */
+
+#include "hb-ot-face.hh"
+
+#include "hb-ot-layout-gdef-table.hh"
+#include "hb-ot-layout-gsub-table.hh"
+#include "hb-ot-layout-gpos-table.hh"
+
+
+static bool
+_hb_ot_blacklist_gdef (unsigned int gdef_len,
+		       unsigned int gsub_len,
+		       unsigned int gpos_len)
+{
+  /* The ugly business of blacklisting individual fonts' tables happen here!
+   * See this thread for why we finally had to bend in and do this:
+   * https://lists.freedesktop.org/archives/harfbuzz/2016-February/005489.html
+   *
+   * In certain versions of Times New Roman Italic and Bold Italic,
+   * ASCII double quotation mark U+0022 has wrong glyph class 3 (mark)
+   * in GDEF.  Many versions of Tahoma have bad GDEF tables that
+   * incorrectly classify some spacing marks such as certain IPA
+   * symbols as glyph class 3. So do older versions of Microsoft
+   * Himalaya, and the version of Cantarell shipped by Ubuntu 16.04.
+   *
+   * Nuke the GDEF tables of to avoid unwanted width-zeroing.
+   *
+   * See https://bugzilla.mozilla.org/show_bug.cgi?id=1279925
+   *     https://bugzilla.mozilla.org/show_bug.cgi?id=1279693
+   *     https://bugzilla.mozilla.org/show_bug.cgi?id=1279875
+   */
+#define ENCODE(x,y,z) ((int64_t) (x) << 32 | (int64_t) (y) << 16 | (z))
+  switch ENCODE(gdef_len, gsub_len, gpos_len)
+  {
+    /* sha1sum:c5ee92f0bca4bfb7d06c4d03e8cf9f9cf75d2e8a Windows 7? timesi.ttf */
+    case ENCODE (442, 2874, 42038):
+    /* sha1sum:37fc8c16a0894ab7b749e35579856c73c840867b Windows 7? timesbi.ttf */
+    case ENCODE (430, 2874, 40662):
+    /* sha1sum:19fc45110ea6cd3cdd0a5faca256a3797a069a80 Windows 7 timesi.ttf */
+    case ENCODE (442, 2874, 39116):
+    /* sha1sum:6d2d3c9ed5b7de87bc84eae0df95ee5232ecde26 Windows 7 timesbi.ttf */
+    case ENCODE (430, 2874, 39374):
+    /* sha1sum:8583225a8b49667c077b3525333f84af08c6bcd8 OS X 10.11.3 Times New Roman Italic.ttf */
+    case ENCODE (490, 3046, 41638):
+    /* sha1sum:ec0f5a8751845355b7c3271d11f9918a966cb8c9 OS X 10.11.3 Times New Roman Bold Italic.ttf */
+    case ENCODE (478, 3046, 41902):
+    /* sha1sum:96eda93f7d33e79962451c6c39a6b51ee893ce8c  tahoma.ttf from Windows 8 */
+    case ENCODE (898, 12554, 46470):
+    /* sha1sum:20928dc06014e0cd120b6fc942d0c3b1a46ac2bc  tahomabd.ttf from Windows 8 */
+    case ENCODE (910, 12566, 47732):
+    /* sha1sum:4f95b7e4878f60fa3a39ca269618dfde9721a79e  tahoma.ttf from Windows 8.1 */
+    case ENCODE (928, 23298, 59332):
+    /* sha1sum:6d400781948517c3c0441ba42acb309584b73033  tahomabd.ttf from Windows 8.1 */
+    case ENCODE (940, 23310, 60732):
+    /* tahoma.ttf v6.04 from Windows 8.1 x64, see https://bugzilla.mozilla.org/show_bug.cgi?id=1279925 */
+    case ENCODE (964, 23836, 60072):
+    /* tahomabd.ttf v6.04 from Windows 8.1 x64, see https://bugzilla.mozilla.org/show_bug.cgi?id=1279925 */
+    case ENCODE (976, 23832, 61456):
+    /* sha1sum:e55fa2dfe957a9f7ec26be516a0e30b0c925f846  tahoma.ttf from Windows 10 */
+    case ENCODE (994, 24474, 60336):
+    /* sha1sum:7199385abb4c2cc81c83a151a7599b6368e92343  tahomabd.ttf from Windows 10 */
+    case ENCODE (1006, 24470, 61740):
+    /* tahoma.ttf v6.91 from Windows 10 x64, see https://bugzilla.mozilla.org/show_bug.cgi?id=1279925 */
+    case ENCODE (1006, 24576, 61346):
+    /* tahomabd.ttf v6.91 from Windows 10 x64, see https://bugzilla.mozilla.org/show_bug.cgi?id=1279925 */
+    case ENCODE (1018, 24572, 62828):
+    /* sha1sum:b9c84d820c49850d3d27ec498be93955b82772b5  tahoma.ttf from Windows 10 AU */
+    case ENCODE (1006, 24576, 61352):
+    /* sha1sum:2bdfaab28174bdadd2f3d4200a30a7ae31db79d2  tahomabd.ttf from Windows 10 AU */
+    case ENCODE (1018, 24572, 62834):
+    /* sha1sum:b0d36cf5a2fbe746a3dd277bffc6756a820807a7  Tahoma.ttf from Mac OS X 10.9 */
+    case ENCODE (832, 7324, 47162):
+    /* sha1sum:12fc4538e84d461771b30c18b5eb6bd434e30fba  Tahoma Bold.ttf from Mac OS X 10.9 */
+    case ENCODE (844, 7302, 45474):
+    /* sha1sum:eb8afadd28e9cf963e886b23a30b44ab4fd83acc  himalaya.ttf from Windows 7 */
+    case ENCODE (180, 13054, 7254):
+    /* sha1sum:73da7f025b238a3f737aa1fde22577a6370f77b0  himalaya.ttf from Windows 8 */
+    case ENCODE (192, 12638, 7254):
+    /* sha1sum:6e80fd1c0b059bbee49272401583160dc1e6a427  himalaya.ttf from Windows 8.1 */
+    case ENCODE (192, 12690, 7254):
+    /* 8d9267aea9cd2c852ecfb9f12a6e834bfaeafe44  cantarell-fonts-0.0.21/otf/Cantarell-Regular.otf */
+    /* 983988ff7b47439ab79aeaf9a45bd4a2c5b9d371  cantarell-fonts-0.0.21/otf/Cantarell-Oblique.otf */
+    case ENCODE (188, 248, 3852):
+    /* 2c0c90c6f6087ffbfea76589c93113a9cbb0e75f  cantarell-fonts-0.0.21/otf/Cantarell-Bold.otf */
+    /* 55461f5b853c6da88069ffcdf7f4dd3f8d7e3e6b  cantarell-fonts-0.0.21/otf/Cantarell-Bold-Oblique.otf */
+    case ENCODE (188, 264, 3426):
+    /* d125afa82a77a6475ac0e74e7c207914af84b37a padauk-2.80/Padauk.ttf RHEL 7.2 */
+    case ENCODE (1058, 47032, 11818):
+    /* 0f7b80437227b90a577cc078c0216160ae61b031 padauk-2.80/Padauk-Bold.ttf RHEL 7.2*/
+    case ENCODE (1046, 47030, 12600):
+    /* d3dde9aa0a6b7f8f6a89ef1002e9aaa11b882290 padauk-2.80/Padauk.ttf Ubuntu 16.04 */
+    case ENCODE (1058, 71796, 16770):
+    /* 5f3c98ccccae8a953be2d122c1b3a77fd805093f padauk-2.80/Padauk-Bold.ttf Ubuntu 16.04 */
+    case ENCODE (1046, 71790, 17862):
+    /* 6c93b63b64e8b2c93f5e824e78caca555dc887c7 padauk-2.80/Padauk-book.ttf */
+    case ENCODE (1046, 71788, 17112):
+    /* d89b1664058359b8ec82e35d3531931125991fb9 padauk-2.80/Padauk-bookbold.ttf */
+    case ENCODE (1058, 71794, 17514):
+    /* 824cfd193aaf6234b2b4dc0cf3c6ef576c0d00ef padauk-3.0/Padauk-book.ttf */
+    case ENCODE (1330, 109904, 57938):
+    /* 91fcc10cf15e012d27571e075b3b4dfe31754a8a padauk-3.0/Padauk-bookbold.ttf */
+    case ENCODE (1330, 109904, 58972):
+    /* sha1sum: c26e41d567ed821bed997e937bc0c41435689e85  Padauk.ttf
+     *  "Padauk Regular" "Version 2.5", see https://crbug.com/681813 */
+    case ENCODE (1004, 59092, 14836):
+      return true;
+#undef ENCODE
+  }
+  return false;
+}
+
+
+void hb_ot_face_data_t::tables_t::init0 (hb_face_t *face)
+{
+  this->face = face;
+#define HB_OT_LAYOUT_TABLE(Namespace, Type) Type.init0 ();
+  HB_OT_LAYOUT_TABLES
+#undef HB_OT_LAYOUT_TABLE
+}
+void hb_ot_face_data_t::tables_t::fini (void)
+{
+#define HB_OT_LAYOUT_TABLE(Namespace, Type) Type.fini ();
+  HB_OT_LAYOUT_TABLES
+#undef HB_OT_LAYOUT_TABLE
+}
+
+hb_ot_face_data_t *
+_hb_ot_face_data_create (hb_face_t *face)
+{
+  hb_ot_face_data_t *data = (hb_ot_face_data_t *) calloc (1, sizeof (hb_ot_face_data_t));
+  if (unlikely (!data))
+    return nullptr;
+
+  data->table.init0 (face);
+
+  const OT::GSUB &gsub = *data->table.GSUB;
+  const OT::GPOS &gpos = *data->table.GPOS;
+
+  if (unlikely (_hb_ot_blacklist_gdef (data->table.GDEF.get_blob ()->length,
+				       data->table.GSUB.get_blob ()->length,
+				       data->table.GPOS.get_blob ()->length)))
+    data->table.GDEF.set_stored (hb_blob_get_empty ());
+
+  unsigned int gsub_lookup_count = data->gsub_lookup_count = gsub.get_lookup_count ();
+  unsigned int gpos_lookup_count = data->gpos_lookup_count = gpos.get_lookup_count ();
+
+  data->gsub_accels = (hb_ot_layout_lookup_accelerator_t *) calloc (gsub_lookup_count, sizeof (hb_ot_layout_lookup_accelerator_t));
+  data->gpos_accels = (hb_ot_layout_lookup_accelerator_t *) calloc (gpos_lookup_count, sizeof (hb_ot_layout_lookup_accelerator_t));
+
+  if (unlikely ((gsub_lookup_count && !data->gsub_accels) ||
+		(gpos_lookup_count && !data->gpos_accels)))
+  {
+    _hb_ot_face_data_destroy (data);
+    return nullptr;
+  }
+
+  for (unsigned int i = 0; i < gsub_lookup_count; i++)
+    data->gsub_accels[i].init (gsub.get_lookup (i));
+  for (unsigned int i = 0; i < gpos_lookup_count; i++)
+    data->gpos_accels[i].init (gpos.get_lookup (i));
+
+  return data;
+}
+
+void
+_hb_ot_face_data_destroy (hb_ot_face_data_t *data)
+{
+  if (data->gsub_accels)
+    for (unsigned int i = 0; i < data->gsub_lookup_count; i++)
+      data->gsub_accels[i].fini ();
+  if (data->gpos_accels)
+    for (unsigned int i = 0; i < data->gpos_lookup_count; i++)
+      data->gpos_accels[i].fini ();
+
+  free (data->gsub_accels);
+  free (data->gpos_accels);
+
+  data->table.fini ();
+
+  free (data);
+}
+
diff --git a/src/hb-ot-face.hh b/src/hb-ot-face.hh
new file mode 100644
index 00000000..ade14f4a
--- /dev/null
+++ b/src/hb-ot-face.hh
@@ -0,0 +1,144 @@
+/*
+ * Copyright © 2007,2008,2009  Red Hat, Inc.
+ * Copyright © 2012,2013  Google, Inc.
+ *
+ *  This is part of HarfBuzz, a text shaping library.
+ *
+ * Permission is hereby granted, without written agreement and without
+ * license or royalty fees, to use, copy, modify, and distribute this
+ * software and its documentation for any purpose, provided that the
+ * above copyright notice and the following two paragraphs appear in
+ * all copies of this software.
+ *
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
+ * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
+ * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
+ * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
+ * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
+ * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ *
+ * Red Hat Author(s): Behdad Esfahbod
+ * Google Author(s): Behdad Esfahbod
+ */
+
+#ifndef HB_OT_FACE_HH
+#define HB_OT_FACE_HH
+
+#include "hb.hh"
+
+#include "hb-machinery.hh"
+#include "hb-set-digest.hh"
+
+
+/*
+ * hb_ot_face_data_t
+ */
+
+struct hb_ot_layout_lookup_accelerator_t
+{
+  template <typename TLookup>
+  inline void init (const TLookup &lookup)
+  {
+    digest.init ();
+    lookup.add_coverage (&digest);
+  }
+
+  inline void fini (void)
+  {
+  }
+
+  inline bool may_have (hb_codepoint_t g) const {
+    return digest.may_have (g);
+  }
+
+  private:
+  hb_set_digest_t digest;
+};
+
+/* Most of these tables are NOT needed for shaping.  But we need to hook them *somewhere*.
+ * This is as good as any place. */
+#define HB_OT_LAYOUT_TABLES \
+    /* OpenType shaping. */ \
+    HB_OT_LAYOUT_TABLE(OT, GDEF) \
+    HB_OT_LAYOUT_TABLE(OT, GSUB) \
+    HB_OT_LAYOUT_TABLE(OT, GPOS) \
+    HB_OT_LAYOUT_TABLE(OT, JSTF) \
+    HB_OT_LAYOUT_TABLE(OT, BASE) \
+    /* AAT shaping. */ \
+    HB_OT_LAYOUT_TABLE(AAT, morx) \
+    HB_OT_LAYOUT_TABLE(AAT, kerx) \
+    HB_OT_LAYOUT_TABLE(AAT, ankr) \
+    HB_OT_LAYOUT_TABLE(AAT, trak) \
+    /* OpenType variations. */ \
+    HB_OT_LAYOUT_TABLE(OT, fvar) \
+    HB_OT_LAYOUT_TABLE(OT, avar) \
+    HB_OT_LAYOUT_TABLE(OT, MVAR) \
+    /* OpenType color. */ \
+    HB_OT_LAYOUT_TABLE(OT, COLR) \
+    HB_OT_LAYOUT_TABLE(OT, CPAL) \
+    HB_OT_LAYOUT_TABLE(OT, CBDT) \
+    HB_OT_LAYOUT_TABLE(OT, CBLC) \
+    HB_OT_LAYOUT_TABLE(OT, sbix) \
+    HB_OT_LAYOUT_TABLE(OT, svg) \
+    /* OpenType math. */ \
+    HB_OT_LAYOUT_TABLE(OT, MATH) \
+    /* OpenType fundamentals. */ \
+    HB_OT_LAYOUT_TABLE(OT, post) \
+    /* */
+
+/* Declare tables. */
+#define HB_OT_LAYOUT_TABLE(Namespace, Type) namespace Namespace { struct Type; }
+HB_OT_LAYOUT_TABLES
+#undef HB_OT_LAYOUT_TABLE
+
+struct hb_ot_face_data_t
+{
+  unsigned int gsub_lookup_count;
+  unsigned int gpos_lookup_count;
+
+  hb_ot_layout_lookup_accelerator_t *gsub_accels;
+  hb_ot_layout_lookup_accelerator_t *gpos_accels;
+
+  /* Various non-shaping tables. */
+  struct tables_t
+  {
+    HB_INTERNAL void init0 (hb_face_t *face);
+    HB_INTERNAL void fini (void);
+
+#define HB_OT_LAYOUT_TABLE_ORDER(Namespace, Type) \
+      HB_PASTE (ORDER_, HB_PASTE (Namespace, HB_PASTE (_, Type)))
+    enum order_t
+    {
+      ORDER_ZERO,
+#define HB_OT_LAYOUT_TABLE(Namespace, Type) \
+	HB_OT_LAYOUT_TABLE_ORDER (Namespace, Type),
+      HB_OT_LAYOUT_TABLES
+#undef HB_OT_LAYOUT_TABLE
+    };
+
+    hb_face_t *face; /* MUST be JUST before the lazy loaders. */
+#define HB_OT_LAYOUT_TABLE(Namespace, Type) \
+    hb_table_lazy_loader_t<struct Namespace::Type, HB_OT_LAYOUT_TABLE_ORDER (Namespace, Type)> Type;
+    HB_OT_LAYOUT_TABLES
+#undef HB_OT_LAYOUT_TABLE
+  } table;
+};
+
+
+HB_INTERNAL hb_ot_face_data_t *
+_hb_ot_face_data_create (hb_face_t *face);
+
+HB_INTERNAL void
+_hb_ot_face_data_destroy (hb_ot_face_data_t *data);
+
+
+#define hb_ot_face_data(face) ((hb_ot_face_data_t *) face->shaper_data.ot.get_relaxed ())
+
+
+
+#endif /* HB_OT_FACE_HH */
diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc
index 1fe45438..b9bb17fc 100644
--- a/src/hb-ot-layout.cc
+++ b/src/hb-ot-layout.cc
@@ -47,178 +47,6 @@
 #include "hb-ot-name-table.hh"
 
 
-static bool
-_hb_ot_blacklist_gdef (unsigned int gdef_len,
-		       unsigned int gsub_len,
-		       unsigned int gpos_len)
-{
-  /* The ugly business of blacklisting individual fonts' tables happen here!
-   * See this thread for why we finally had to bend in and do this:
-   * https://lists.freedesktop.org/archives/harfbuzz/2016-February/005489.html
-   *
-   * In certain versions of Times New Roman Italic and Bold Italic,
-   * ASCII double quotation mark U+0022 has wrong glyph class 3 (mark)
-   * in GDEF.  Many versions of Tahoma have bad GDEF tables that
-   * incorrectly classify some spacing marks such as certain IPA
-   * symbols as glyph class 3. So do older versions of Microsoft
-   * Himalaya, and the version of Cantarell shipped by Ubuntu 16.04.
-   *
-   * Nuke the GDEF tables of to avoid unwanted width-zeroing.
-   *
-   * See https://bugzilla.mozilla.org/show_bug.cgi?id=1279925
-   *     https://bugzilla.mozilla.org/show_bug.cgi?id=1279693
-   *     https://bugzilla.mozilla.org/show_bug.cgi?id=1279875
-   */
-#define ENCODE(x,y,z) ((int64_t) (x) << 32 | (int64_t) (y) << 16 | (z))
-  switch ENCODE(gdef_len, gsub_len, gpos_len)
-  {
-    /* sha1sum:c5ee92f0bca4bfb7d06c4d03e8cf9f9cf75d2e8a Windows 7? timesi.ttf */
-    case ENCODE (442, 2874, 42038):
-    /* sha1sum:37fc8c16a0894ab7b749e35579856c73c840867b Windows 7? timesbi.ttf */
-    case ENCODE (430, 2874, 40662):
-    /* sha1sum:19fc45110ea6cd3cdd0a5faca256a3797a069a80 Windows 7 timesi.ttf */
-    case ENCODE (442, 2874, 39116):
-    /* sha1sum:6d2d3c9ed5b7de87bc84eae0df95ee5232ecde26 Windows 7 timesbi.ttf */
-    case ENCODE (430, 2874, 39374):
-    /* sha1sum:8583225a8b49667c077b3525333f84af08c6bcd8 OS X 10.11.3 Times New Roman Italic.ttf */
-    case ENCODE (490, 3046, 41638):
-    /* sha1sum:ec0f5a8751845355b7c3271d11f9918a966cb8c9 OS X 10.11.3 Times New Roman Bold Italic.ttf */
-    case ENCODE (478, 3046, 41902):
-    /* sha1sum:96eda93f7d33e79962451c6c39a6b51ee893ce8c  tahoma.ttf from Windows 8 */
-    case ENCODE (898, 12554, 46470):
-    /* sha1sum:20928dc06014e0cd120b6fc942d0c3b1a46ac2bc  tahomabd.ttf from Windows 8 */
-    case ENCODE (910, 12566, 47732):
-    /* sha1sum:4f95b7e4878f60fa3a39ca269618dfde9721a79e  tahoma.ttf from Windows 8.1 */
-    case ENCODE (928, 23298, 59332):
-    /* sha1sum:6d400781948517c3c0441ba42acb309584b73033  tahomabd.ttf from Windows 8.1 */
-    case ENCODE (940, 23310, 60732):
-    /* tahoma.ttf v6.04 from Windows 8.1 x64, see https://bugzilla.mozilla.org/show_bug.cgi?id=1279925 */
-    case ENCODE (964, 23836, 60072):
-    /* tahomabd.ttf v6.04 from Windows 8.1 x64, see https://bugzilla.mozilla.org/show_bug.cgi?id=1279925 */
-    case ENCODE (976, 23832, 61456):
-    /* sha1sum:e55fa2dfe957a9f7ec26be516a0e30b0c925f846  tahoma.ttf from Windows 10 */
-    case ENCODE (994, 24474, 60336):
-    /* sha1sum:7199385abb4c2cc81c83a151a7599b6368e92343  tahomabd.ttf from Windows 10 */
-    case ENCODE (1006, 24470, 61740):
-    /* tahoma.ttf v6.91 from Windows 10 x64, see https://bugzilla.mozilla.org/show_bug.cgi?id=1279925 */
-    case ENCODE (1006, 24576, 61346):
-    /* tahomabd.ttf v6.91 from Windows 10 x64, see https://bugzilla.mozilla.org/show_bug.cgi?id=1279925 */
-    case ENCODE (1018, 24572, 62828):
-    /* sha1sum:b9c84d820c49850d3d27ec498be93955b82772b5  tahoma.ttf from Windows 10 AU */
-    case ENCODE (1006, 24576, 61352):
-    /* sha1sum:2bdfaab28174bdadd2f3d4200a30a7ae31db79d2  tahomabd.ttf from Windows 10 AU */
-    case ENCODE (1018, 24572, 62834):
-    /* sha1sum:b0d36cf5a2fbe746a3dd277bffc6756a820807a7  Tahoma.ttf from Mac OS X 10.9 */
-    case ENCODE (832, 7324, 47162):
-    /* sha1sum:12fc4538e84d461771b30c18b5eb6bd434e30fba  Tahoma Bold.ttf from Mac OS X 10.9 */
-    case ENCODE (844, 7302, 45474):
-    /* sha1sum:eb8afadd28e9cf963e886b23a30b44ab4fd83acc  himalaya.ttf from Windows 7 */
-    case ENCODE (180, 13054, 7254):
-    /* sha1sum:73da7f025b238a3f737aa1fde22577a6370f77b0  himalaya.ttf from Windows 8 */
-    case ENCODE (192, 12638, 7254):
-    /* sha1sum:6e80fd1c0b059bbee49272401583160dc1e6a427  himalaya.ttf from Windows 8.1 */
-    case ENCODE (192, 12690, 7254):
-    /* 8d9267aea9cd2c852ecfb9f12a6e834bfaeafe44  cantarell-fonts-0.0.21/otf/Cantarell-Regular.otf */
-    /* 983988ff7b47439ab79aeaf9a45bd4a2c5b9d371  cantarell-fonts-0.0.21/otf/Cantarell-Oblique.otf */
-    case ENCODE (188, 248, 3852):
-    /* 2c0c90c6f6087ffbfea76589c93113a9cbb0e75f  cantarell-fonts-0.0.21/otf/Cantarell-Bold.otf */
-    /* 55461f5b853c6da88069ffcdf7f4dd3f8d7e3e6b  cantarell-fonts-0.0.21/otf/Cantarell-Bold-Oblique.otf */
-    case ENCODE (188, 264, 3426):
-    /* d125afa82a77a6475ac0e74e7c207914af84b37a padauk-2.80/Padauk.ttf RHEL 7.2 */
-    case ENCODE (1058, 47032, 11818):
-    /* 0f7b80437227b90a577cc078c0216160ae61b031 padauk-2.80/Padauk-Bold.ttf RHEL 7.2*/
-    case ENCODE (1046, 47030, 12600):
-    /* d3dde9aa0a6b7f8f6a89ef1002e9aaa11b882290 padauk-2.80/Padauk.ttf Ubuntu 16.04 */
-    case ENCODE (1058, 71796, 16770):
-    /* 5f3c98ccccae8a953be2d122c1b3a77fd805093f padauk-2.80/Padauk-Bold.ttf Ubuntu 16.04 */
-    case ENCODE (1046, 71790, 17862):
-    /* 6c93b63b64e8b2c93f5e824e78caca555dc887c7 padauk-2.80/Padauk-book.ttf */
-    case ENCODE (1046, 71788, 17112):
-    /* d89b1664058359b8ec82e35d3531931125991fb9 padauk-2.80/Padauk-bookbold.ttf */
-    case ENCODE (1058, 71794, 17514):
-    /* 824cfd193aaf6234b2b4dc0cf3c6ef576c0d00ef padauk-3.0/Padauk-book.ttf */
-    case ENCODE (1330, 109904, 57938):
-    /* 91fcc10cf15e012d27571e075b3b4dfe31754a8a padauk-3.0/Padauk-bookbold.ttf */
-    case ENCODE (1330, 109904, 58972):
-    /* sha1sum: c26e41d567ed821bed997e937bc0c41435689e85  Padauk.ttf
-     *  "Padauk Regular" "Version 2.5", see https://crbug.com/681813 */
-    case ENCODE (1004, 59092, 14836):
-      return true;
-#undef ENCODE
-  }
-  return false;
-}
-
-void hb_ot_face_data_t::tables_t::init0 (hb_face_t *face)
-{
-  this->face = face;
-#define HB_OT_LAYOUT_TABLE(Namespace, Type) Type.init0 ();
-  HB_OT_LAYOUT_TABLES
-#undef HB_OT_LAYOUT_TABLE
-}
-void hb_ot_face_data_t::tables_t::fini (void)
-{
-#define HB_OT_LAYOUT_TABLE(Namespace, Type) Type.fini ();
-  HB_OT_LAYOUT_TABLES
-#undef HB_OT_LAYOUT_TABLE
-}
-
-hb_ot_face_data_t *
-_hb_ot_face_data_create (hb_face_t *face)
-{
-  hb_ot_face_data_t *data = (hb_ot_face_data_t *) calloc (1, sizeof (hb_ot_face_data_t));
-  if (unlikely (!data))
-    return nullptr;
-
-  data->table.init0 (face);
-
-  const OT::GSUB &gsub = *data->table.GSUB;
-  const OT::GPOS &gpos = *data->table.GPOS;
-
-  if (unlikely (_hb_ot_blacklist_gdef (data->table.GDEF.get_blob ()->length,
-				       data->table.GSUB.get_blob ()->length,
-				       data->table.GPOS.get_blob ()->length)))
-    data->table.GDEF.set_stored (hb_blob_get_empty ());
-
-  unsigned int gsub_lookup_count = data->gsub_lookup_count = gsub.get_lookup_count ();
-  unsigned int gpos_lookup_count = data->gpos_lookup_count = gpos.get_lookup_count ();
-
-  data->gsub_accels = (hb_ot_layout_lookup_accelerator_t *) calloc (gsub_lookup_count, sizeof (hb_ot_layout_lookup_accelerator_t));
-  data->gpos_accels = (hb_ot_layout_lookup_accelerator_t *) calloc (gpos_lookup_count, sizeof (hb_ot_layout_lookup_accelerator_t));
-
-  if (unlikely ((gsub_lookup_count && !data->gsub_accels) ||
-		(gpos_lookup_count && !data->gpos_accels)))
-  {
-    _hb_ot_face_data_destroy (data);
-    return nullptr;
-  }
-
-  for (unsigned int i = 0; i < gsub_lookup_count; i++)
-    data->gsub_accels[i].init (gsub.get_lookup (i));
-  for (unsigned int i = 0; i < gpos_lookup_count; i++)
-    data->gpos_accels[i].init (gpos.get_lookup (i));
-
-  return data;
-}
-
-void
-_hb_ot_face_data_destroy (hb_ot_face_data_t *data)
-{
-  if (data->gsub_accels)
-    for (unsigned int i = 0; i < data->gsub_lookup_count; i++)
-      data->gsub_accels[i].fini ();
-  if (data->gpos_accels)
-    for (unsigned int i = 0; i < data->gpos_lookup_count; i++)
-      data->gpos_accels[i].fini ();
-
-  free (data->gsub_accels);
-  free (data->gpos_accels);
-
-  data->table.fini ();
-
-  free (data);
-}
-
 // static inline const OT::BASE&
 // _get_base (hb_face_t *face)
 // {
diff --git a/src/hb-ot-layout.hh b/src/hb-ot-layout.hh
index 9c705b7d..2790aecb 100644
--- a/src/hb-ot-layout.hh
+++ b/src/hb-ot-layout.hh
@@ -33,8 +33,8 @@
 
 #include "hb-font.hh"
 #include "hb-buffer.hh"
-#include "hb-set-digest.hh"
 #include "hb-open-type.hh"
+#include "hb-ot-face.hh"
 
 
 /* Private API corresponding to hb-ot-layout.h: */
@@ -116,112 +116,6 @@ hb_ot_layout_position_finish_offsets (hb_font_t    *font,
 				      hb_buffer_t  *buffer);
 
 
-
-/*
- * hb_ot_face_data_t
- */
-
-struct hb_ot_layout_lookup_accelerator_t
-{
-  template <typename TLookup>
-  inline void init (const TLookup &lookup)
-  {
-    digest.init ();
-    lookup.add_coverage (&digest);
-  }
-
-  inline void fini (void)
-  {
-  }
-
-  inline bool may_have (hb_codepoint_t g) const {
-    return digest.may_have (g);
-  }
-
-  private:
-  hb_set_digest_t digest;
-};
-
-/* Most of these tables are NOT needed for shaping.  But we need to hook them *somewhere*.
- * This is as good as any place. */
-#define HB_OT_LAYOUT_TABLES \
-    /* OpenType shaping. */ \
-    HB_OT_LAYOUT_TABLE(OT, GDEF) \
-    HB_OT_LAYOUT_TABLE(OT, GSUB) \
-    HB_OT_LAYOUT_TABLE(OT, GPOS) \
-    HB_OT_LAYOUT_TABLE(OT, JSTF) \
-    HB_OT_LAYOUT_TABLE(OT, BASE) \
-    /* AAT shaping. */ \
-    HB_OT_LAYOUT_TABLE(AAT, morx) \
-    HB_OT_LAYOUT_TABLE(AAT, kerx) \
-    HB_OT_LAYOUT_TABLE(AAT, ankr) \
-    HB_OT_LAYOUT_TABLE(AAT, trak) \
-    /* OpenType variations. */ \
-    HB_OT_LAYOUT_TABLE(OT, fvar) \
-    HB_OT_LAYOUT_TABLE(OT, avar) \
-    HB_OT_LAYOUT_TABLE(OT, MVAR) \
-    /* OpenType color. */ \
-    HB_OT_LAYOUT_TABLE(OT, COLR) \
-    HB_OT_LAYOUT_TABLE(OT, CPAL) \
-    HB_OT_LAYOUT_TABLE(OT, CBDT) \
-    HB_OT_LAYOUT_TABLE(OT, CBLC) \
-    HB_OT_LAYOUT_TABLE(OT, sbix) \
-    HB_OT_LAYOUT_TABLE(OT, svg) \
-    /* OpenType math. */ \
-    HB_OT_LAYOUT_TABLE(OT, MATH) \
-    /* OpenType fundamentals. */ \
-    HB_OT_LAYOUT_TABLE(OT, post) \
-    /* */
-
-/* Declare tables. */
-#define HB_OT_LAYOUT_TABLE(Namespace, Type) namespace Namespace { struct Type; }
-HB_OT_LAYOUT_TABLES
-#undef HB_OT_LAYOUT_TABLE
-
-struct hb_ot_face_data_t
-{
-  unsigned int gsub_lookup_count;
-  unsigned int gpos_lookup_count;
-
-  hb_ot_layout_lookup_accelerator_t *gsub_accels;
-  hb_ot_layout_lookup_accelerator_t *gpos_accels;
-
-  /* Various non-shaping tables. */
-  struct tables_t
-  {
-    HB_INTERNAL void init0 (hb_face_t *face);
-    HB_INTERNAL void fini (void);
-
-#define HB_OT_LAYOUT_TABLE_ORDER(Namespace, Type) \
-      HB_PASTE (ORDER_, HB_PASTE (Namespace, HB_PASTE (_, Type)))
-    enum order_t
-    {
-      ORDER_ZERO,
-#define HB_OT_LAYOUT_TABLE(Namespace, Type) \
-	HB_OT_LAYOUT_TABLE_ORDER (Namespace, Type),
-      HB_OT_LAYOUT_TABLES
-#undef HB_OT_LAYOUT_TABLE
-    };
-
-    hb_face_t *face; /* MUST be JUST before the lazy loaders. */
-#define HB_OT_LAYOUT_TABLE(Namespace, Type) \
-    hb_table_lazy_loader_t<struct Namespace::Type, HB_OT_LAYOUT_TABLE_ORDER (Namespace, Type)> Type;
-    HB_OT_LAYOUT_TABLES
-#undef HB_OT_LAYOUT_TABLE
-  } table;
-};
-
-
-HB_INTERNAL hb_ot_face_data_t *
-_hb_ot_face_data_create (hb_face_t *face);
-
-HB_INTERNAL void
-_hb_ot_face_data_destroy (hb_ot_face_data_t *data);
-
-
-#define hb_ot_face_data(face) ((hb_ot_face_data_t *) face->shaper_data.ot.get_relaxed ())
-
-
 /*
  * Buffer var routines.
  */
diff --git a/src/hb-ot-math.cc b/src/hb-ot-math.cc
index 48adf8ac..645c3d62 100644
--- a/src/hb-ot-math.cc
+++ b/src/hb-ot-math.cc
@@ -26,7 +26,7 @@
 
 #include "hb-open-type.hh"
 
-#include "hb-ot-layout.hh"
+#include "hb-ot-face.hh"
 #include "hb-ot-math-table.hh"
 
 static inline const OT::MATH&
diff --git a/src/hb-ot-var.cc b/src/hb-ot-var.cc
index 5d49ac14..a2f2d3e5 100644
--- a/src/hb-ot-var.cc
+++ b/src/hb-ot-var.cc
@@ -26,7 +26,7 @@
 
 #include "hb-open-type.hh"
 
-#include "hb-ot-layout.hh"
+#include "hb-ot-face.hh"
 #include "hb-ot-var-avar-table.hh"
 #include "hb-ot-var-fvar-table.hh"
 #include "hb-ot-var-mvar-table.hh"
commit dae39c58fb63c2211e2842121bbe6d5b8b18651b
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sat Aug 25 22:44:39 2018 -0700

    [face] Introduce character-map API
    
    New API:
    +hb_face_collect_unicodes
    +hb_face_collect_variation_selectors
    +hb_face_collect_variation_unicodes

diff --git a/docs/harfbuzz-sections.txt b/docs/harfbuzz-sections.txt
index 043611e9..ca0e908f 100644
--- a/docs/harfbuzz-sections.txt
+++ b/docs/harfbuzz-sections.txt
@@ -189,6 +189,9 @@ hb_face_set_glyph_count
 hb_face_set_index
 hb_face_set_upem
 hb_face_set_user_data
+hb_face_collect_unicodes
+hb_face_collect_variation_selectors
+hb_face_collect_variation_unicodes
 hb_face_builder_create
 hb_face_builder_add_table
 </SECTION>
diff --git a/src/hb-face.cc b/src/hb-face.cc
index b3956c45..286b1f2c 100644
--- a/src/hb-face.cc
+++ b/src/hb-face.cc
@@ -31,6 +31,7 @@
 #include "hb-face.hh"
 #include "hb-blob.hh"
 #include "hb-open-file.hh"
+#include "hb-ot-cmap-table.hh"
 
 
 /**
@@ -515,6 +516,65 @@ hb_face_get_table_tags (const hb_face_t *face,
 
 
 /*
+ * Character set.
+ */
+
+/**
+ * hb_face_collect_unicodes:
+ * @face: font face.
+ * @out: set to add Unicode characters covered by @face to.
+ *
+ * Since: REPLACEME
+ */
+void
+hb_face_collect_unicodes (hb_face_t *face,
+			  hb_set_t  *out)
+{
+  /* XXX Use saved accel. */
+  hb_auto_t<OT::cmap::accelerator_t> cmap (face);
+  cmap.collect_unicodes (out);
+}
+
+/**
+ * hb_face_collect_variation_selectors:
+ * @face: font face.
+ * @out: set to add Variation Selector characters covered by @face to.
+ *
+ *
+ *
+ * Since: REPLACEME
+ */
+void
+hb_face_collect_variation_selectors (hb_face_t *face,
+				     hb_set_t  *out)
+{
+  /* XXX Use saved accel. */
+  hb_auto_t<OT::cmap::accelerator_t> cmap (face);
+  cmap.collect_variation_selectors (out);
+}
+
+/**
+ * hb_face_collect_variation_unicodes:
+ * @face: font face.
+ * @out: set to add Unicode characters for @variation_selector covered by @face to.
+ *
+ *
+ *
+ * Since: REPLACEME
+ */
+void
+hb_face_collect_variation_unicodes (hb_face_t *face,
+				    hb_codepoint_t variation_selector,
+				    hb_set_t  *out)
+{
+  /* XXX Use saved accel. */
+  hb_auto_t<OT::cmap::accelerator_t> cmap (face);
+  cmap.collect_variation_unicodes (variation_selector, out);
+}
+
+
+
+/*
  * face-builder: A face that has add_table().
  */
 
@@ -660,4 +720,3 @@ hb_face_builder_add_table (hb_face_t *face, hb_tag_t tag, hb_blob_t *blob)
 
   return true;
 }
-
diff --git a/src/hb-face.h b/src/hb-face.h
index 2bc3e895..e8ff090d 100644
--- a/src/hb-face.h
+++ b/src/hb-face.h
@@ -33,6 +33,7 @@
 
 #include "hb-common.h"
 #include "hb-blob.h"
+#include "hb-set.h"
 
 HB_BEGIN_DECLS
 
@@ -122,6 +123,24 @@ hb_face_get_table_tags (const hb_face_t *face,
 
 
 /*
+ * Character set.
+ */
+
+HB_EXTERN void
+hb_face_collect_unicodes (hb_face_t *face,
+			  hb_set_t  *out);
+
+HB_EXTERN void
+hb_face_collect_variation_selectors (hb_face_t *face,
+				     hb_set_t  *out);
+
+HB_EXTERN void
+hb_face_collect_variation_unicodes (hb_face_t *face,
+				    hb_codepoint_t variation_selector,
+				    hb_set_t  *out);
+
+
+/*
  * Builder face.
  */
 
diff --git a/src/hb-subset.cc b/src/hb-subset.cc
index ad8a1106..1ba16059 100644
--- a/src/hb-subset.cc
+++ b/src/hb-subset.cc
@@ -235,56 +235,3 @@ hb_subset (hb_face_t *source,
   hb_subset_plan_destroy (plan);
   return result;
 }
-
-/**
- * hb_subset_collect_unicodes:
- * @face: font face.
- * @out: set to add Unicode characters covered by @face to.
- *
- * Since: REPLACEME
- */
-void
-hb_subset_collect_unicodes (hb_face_t *face, hb_set_t *out)
-{
-  /* XXX Use saved accel. */
-  hb_auto_t<OT::cmap::accelerator_t> cmap (face);
-  cmap.collect_unicodes (out);
-}
-
-/**
- * hb_subset_collect_variation_selectors:
- * @face: font face.
- * @out: set to add Variation Selector characters covered by @face to.
- *
- *
- *
- * Since: REPLACEME
- */
-void
-hb_subset_collect_variation_selectors (hb_face_t *face,
-				       hb_set_t *out)
-{
-  /* XXX Use saved accel. */
-  hb_auto_t<OT::cmap::accelerator_t> cmap (face);
-  cmap.collect_variation_selectors (out);
-}
-
-/**
- * hb_subset_collect_variation_unicodes:
- * @face: font face.
- * @out: set to add Unicode characters for @variation_selector covered by @face to.
- *
- *
- *
- * Since: REPLACEME
- */
-void
-hb_subset_collect_variation_unicodes (hb_face_t *face,
-				      hb_codepoint_t variation_selector,
-				      hb_set_t *out)
-{
-  /* XXX Use saved accel. */
-  hb_auto_t<OT::cmap::accelerator_t> cmap (face);
-  cmap.collect_variation_unicodes (variation_selector, out);
-}
-
diff --git a/src/hb-subset.h b/src/hb-subset.h
index 1e7d8f52..8b7fcc6c 100644
--- a/src/hb-subset.h
+++ b/src/hb-subset.h
@@ -81,21 +81,6 @@ hb_subset (hb_face_t *source,
            hb_subset_input_t *input);
 
 
-/* TODO Move to hb-face.h. */
-
-HB_EXTERN void
-hb_subset_collect_unicodes (hb_face_t *face, hb_set_t *out);
-
-HB_EXTERN void
-hb_subset_collect_variation_selectors (hb_face_t *face,
-				       hb_set_t *out);
-
-HB_EXTERN void
-hb_subset_collect_variation_unicodes (hb_face_t *face,
-				      hb_codepoint_t variation_selector,
-				      hb_set_t *out);
-
-
 HB_END_DECLS
 
 #endif /* HB_SUBSET_H */
diff --git a/test/api/test-subset-codepoints.c b/test/api/test-subset-codepoints.c
index a2c40cd6..affe9314 100644
--- a/test/api/test-subset-codepoints.c
+++ b/test/api/test-subset-codepoints.c
@@ -33,7 +33,7 @@ test_collect_unicodes_format4 (void)
   hb_face_t *face = hb_subset_test_open_font("fonts/Roboto-Regular.abc.format4.ttf");
   hb_set_t *codepoints = hb_set_create();
 
-  hb_subset_collect_unicodes (face, codepoints);
+  hb_face_collect_unicodes (face, codepoints);
 
   hb_codepoint_t cp = HB_SET_VALUE_INVALID;
   g_assert (hb_set_next (codepoints, &cp));
@@ -54,7 +54,7 @@ test_collect_unicodes_format12 (void)
   hb_face_t *face = hb_subset_test_open_font("fonts/Roboto-Regular.abc.format12.ttf");
   hb_set_t *codepoints = hb_set_create();
 
-  hb_subset_collect_unicodes (face, codepoints);
+  hb_face_collect_unicodes (face, codepoints);
 
   hb_codepoint_t cp = HB_SET_VALUE_INVALID;
   g_assert (hb_set_next (codepoints, &cp));
@@ -75,7 +75,7 @@ test_collect_unicodes (void)
   hb_face_t *face = hb_subset_test_open_font("fonts/Roboto-Regular.abc.ttf");
   hb_set_t *codepoints = hb_set_create();
 
-  hb_subset_collect_unicodes (face, codepoints);
+  hb_face_collect_unicodes (face, codepoints);
 
   hb_codepoint_t cp = HB_SET_VALUE_INVALID;
   g_assert (hb_set_next (codepoints, &cp));
diff --git a/test/fuzzing/hb-subset-get-codepoints-fuzzer.cc b/test/fuzzing/hb-subset-get-codepoints-fuzzer.cc
index bcdafebd..3d43627b 100644
--- a/test/fuzzing/hb-subset-get-codepoints-fuzzer.cc
+++ b/test/fuzzing/hb-subset-get-codepoints-fuzzer.cc
@@ -13,7 +13,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
   hb_face_t *face = hb_face_create (blob, 0);
 
   hb_set_t *output = hb_set_create();
-  hb_subset_collect_unicodes (face, output);
+  hb_face_collect_unicodes (face, output);
 
   hb_set_destroy (output);
   hb_face_destroy (face);
commit 66384db97c439a64d729f9206657d0b37ec0cb32
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sat Aug 25 22:39:17 2018 -0700

    Minor

diff --git a/src/hb-subset.hh b/src/hb-subset.hh
index e2993cda..e3023d65 100644
--- a/src/hb-subset.hh
+++ b/src/hb-subset.hh
@@ -34,7 +34,8 @@
 
 #include "hb-font.hh"
 
-struct hb_subset_input_t {
+struct hb_subset_input_t
+{
   hb_object_header_t header;
   ASSERT_POD ();
 
commit c77ae40852aabb1698da9e8d488f75bae2f4e734
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sat Aug 25 22:36:36 2018 -0700

    Rename hb-*private.hh to hb-*.hh
    
    Sorry for the noise, downstream custom builders.  Please adjust.

diff --git a/src/Makefile.sources b/src/Makefile.sources
index b981b0e2..32b49c95 100644
--- a/src/Makefile.sources
+++ b/src/Makefile.sources
@@ -1,28 +1,28 @@
 # Base and default-included sources and headers
 
 HB_BASE_sources = \
-	hb-atomic-private.hh \
-	hb-blob-private.hh \
+	hb-atomic.hh \
+	hb-blob.hh \
 	hb-blob.cc \
-	hb-buffer-private.hh \
+	hb-buffer.hh \
 	hb-buffer-serialize.cc \
 	hb-buffer.cc \
 	hb-common.cc \
 	hb-debug.hh \
 	hb-dsalgs.hh \
-	hb-face-private.hh \
+	hb-face.hh \
 	hb-face.cc \
-	hb-font-private.hh \
+	hb-font.hh \
 	hb-font.cc \
-	hb-iter-private.hh \
-	hb-map-private.hh \
+	hb-iter.hh \
+	hb-map.hh \
 	hb-map.cc \
-	hb-machinery-private.hh \
-	hb-mutex-private.hh \
+	hb-machinery.hh \
+	hb-mutex.hh \
 	hb-null.hh \
-	hb-object-private.hh \
-	hb-open-file-private.hh \
-	hb-open-type-private.hh \
+	hb-object.hh \
+	hb-open-file.hh \
+	hb-open-type.hh \
 	hb-ot-color-cbdt-table.hh \
 	hb-ot-cmap-table.hh \
 	hb-ot-glyf-table.hh \
@@ -38,23 +38,23 @@ HB_BASE_sources = \
 	hb-ot-post-macroman.hh \
 	hb-ot-post-table.hh \
 	hb-ot-tag.cc \
-	hb-private.hh \
-	hb-set-digest-private.hh \
-	hb-set-private.hh \
+	hb.hh \
+	hb-set-digest.hh \
+	hb-set.hh \
 	hb-set.cc \
 	hb-shape.cc \
-	hb-shape-plan-private.hh \
+	hb-shape-plan.hh \
 	hb-shape-plan.cc \
 	hb-shaper-list.hh \
-	hb-shaper-impl-private.hh \
-	hb-shaper-private.hh \
+	hb-shaper-impl.hh \
+	hb-shaper.hh \
 	hb-shaper.cc \
 	hb-static.cc \
 	hb-string-array.hh \
-	hb-unicode-private.hh \
+	hb-unicode.hh \
 	hb-unicode.cc \
-	hb-vector-private.hh \
-	hb-utf-private.hh \
+	hb-vector.hh \
+	hb-utf.hh \
 	hb-warning.cc \
 	$(NULL)
 
@@ -89,61 +89,61 @@ HB_FALLBACK_sources = \
 
 HB_OT_sources = \
 	hb-aat-layout.cc \
-	hb-aat-layout-common-private.hh \
+	hb-aat-layout-common.hh \
 	hb-aat-layout-ankr-table.hh \
 	hb-aat-layout-bsln-table.hh \
 	hb-aat-layout-feat-table.hh \
 	hb-aat-layout-kerx-table.hh \
 	hb-aat-layout-morx-table.hh \
 	hb-aat-layout-trak-table.hh \
-	hb-aat-layout-private.hh \
+	hb-aat-layout.hh \
 	hb-aat-ltag-table.hh \
 	hb-ot-font.cc \
 	hb-ot-layout.cc \
 	hb-ot-layout-base-table.hh \
-	hb-ot-layout-common-private.hh \
+	hb-ot-layout-common.hh \
 	hb-ot-layout-gdef-table.hh \
 	hb-ot-layout-gpos-table.hh \
-	hb-ot-layout-gsubgpos-private.hh \
+	hb-ot-layout-gsubgpos.hh \
 	hb-ot-layout-gsub-table.hh \
 	hb-ot-layout-jstf-table.hh \
-	hb-ot-layout-private.hh \
+	hb-ot-layout.hh \
 	hb-ot-color.cc \
 	hb-ot-color-colr-table.hh \
 	hb-ot-color-cpal-table.hh \
 	hb-ot-color-sbix-table.hh \
 	hb-ot-color-svg-table.hh \
 	hb-ot-map.cc \
-	hb-ot-map-private.hh \
+	hb-ot-map.hh \
 	hb-ot-math.cc \
 	hb-ot-math-table.hh \
 	hb-ot-shape.cc \
 	hb-ot-shape-complex-arabic.cc \
 	hb-ot-shape-complex-arabic-fallback.hh \
-	hb-ot-shape-complex-arabic-private.hh \
+	hb-ot-shape-complex-arabic.hh \
 	hb-ot-shape-complex-arabic-table.hh \
 	hb-ot-shape-complex-arabic-win1256.hh \
 	hb-ot-shape-complex-default.cc \
 	hb-ot-shape-complex-hangul.cc \
 	hb-ot-shape-complex-hebrew.cc \
 	hb-ot-shape-complex-indic.cc \
-	hb-ot-shape-complex-indic-private.hh \
+	hb-ot-shape-complex-indic.hh \
 	hb-ot-shape-complex-indic-table.cc \
-	hb-ot-shape-complex-khmer-private.hh \
+	hb-ot-shape-complex-khmer.hh \
 	hb-ot-shape-complex-khmer.cc \
-	hb-ot-shape-complex-myanmar-private.hh \
+	hb-ot-shape-complex-myanmar.hh \
 	hb-ot-shape-complex-myanmar.cc \
 	hb-ot-shape-complex-thai.cc \
 	hb-ot-shape-complex-tibetan.cc \
 	hb-ot-shape-complex-use.cc \
-	hb-ot-shape-complex-use-private.hh \
+	hb-ot-shape-complex-use.hh \
 	hb-ot-shape-complex-use-table.cc \
-	hb-ot-shape-complex-private.hh \
-	hb-ot-shape-normalize-private.hh \
+	hb-ot-shape-complex.hh \
+	hb-ot-shape-normalize.hh \
 	hb-ot-shape-normalize.cc \
-	hb-ot-shape-fallback-private.hh \
+	hb-ot-shape-fallback.hh \
 	hb-ot-shape-fallback.cc \
-	hb-ot-shape-private.hh \
+	hb-ot-shape.hh \
 	hb-ot-var.cc \
 	hb-ot-var-avar-table.hh \
 	hb-ot-var-fvar-table.hh \
@@ -214,9 +214,6 @@ HB_SUBSET_sources = \
 
 HB_SUBSET_headers = \
 	hb-subset.h \
-	hb-subset-glyf.hh \
-	hb-subset-plan.hh \
-	hb-subset-private.hh \
 	$(NULL)
 
 HB_GOBJECT_DIST_sources = hb-gobject-structs.cc
diff --git a/src/check-includes.sh b/src/check-includes.sh
index fd565da5..f938f706 100755
--- a/src/check-includes.sh
+++ b/src/check-includes.sh
@@ -23,14 +23,14 @@ grep -v 'hb[.]h:' |
 grep . >&2 && stat=1
 
 
-echo 'Checking that source files #include "hb-*private.hh" first (or none)'
+echo 'Checking that source files #include a private header first (or none)'
 
 for x in $HBSOURCES; do
 	test -f "$srcdir/$x" -a ! -f "$x" && x="$srcdir/$x"
-	grep '#.*\<include\>' "$x" /dev/null | grep -v 'include _' | head -n 1
+	grep '#.*\<include\>' "$x" /dev/null | head -n 1
 done |
-grep -v '"hb-.*private[.]hh"' |
-grep -v 'hb-private[.]hh:' |
+grep -v '"hb-.*[.]hh"' |
+grep -v 'hb[.]hh' |
 grep . >&2 && stat=1
 
 
diff --git a/src/dump-indic-data.cc b/src/dump-indic-data.cc
index d5741388..a5068898 100644
--- a/src/dump-indic-data.cc
+++ b/src/dump-indic-data.cc
@@ -24,7 +24,7 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-ot-shape-complex-indic-private.hh"
+#include "hb-ot-shape-complex-indic.hh"
 
 int
 main (void)
diff --git a/src/dump-khmer-data.cc b/src/dump-khmer-data.cc
index 7dd09b2b..12871fa8 100644
--- a/src/dump-khmer-data.cc
+++ b/src/dump-khmer-data.cc
@@ -24,7 +24,7 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-ot-shape-complex-khmer-private.hh"
+#include "hb-ot-shape-complex-khmer.hh"
 
 int
 main (void)
diff --git a/src/dump-myanmar-data.cc b/src/dump-myanmar-data.cc
index 2df9cd98..9f8b12ed 100644
--- a/src/dump-myanmar-data.cc
+++ b/src/dump-myanmar-data.cc
@@ -24,7 +24,7 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-ot-shape-complex-myanmar-private.hh"
+#include "hb-ot-shape-complex-myanmar.hh"
 
 int
 main (void)
diff --git a/src/dump-use-data.cc b/src/dump-use-data.cc
index 0e64688f..4a8b2584 100644
--- a/src/dump-use-data.cc
+++ b/src/dump-use-data.cc
@@ -24,7 +24,7 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-ot-shape-complex-use-private.hh"
+#include "hb-ot-shape-complex-use.hh"
 
 int
 main (void)
diff --git a/src/gen-indic-table.py b/src/gen-indic-table.py
index 6252664c..e65b9814 100755
--- a/src/gen-indic-table.py
+++ b/src/gen-indic-table.py
@@ -102,7 +102,7 @@ for h in headers:
 		print (" * %s" % (l.strip()))
 print (" */")
 print ()
-print ('#include "hb-ot-shape-complex-indic-private.hh"')
+print ('#include "hb-ot-shape-complex-indic.hh"')
 print ()
 
 # Shorten values
diff --git a/src/gen-use-table.py b/src/gen-use-table.py
index c742ebac..a8724619 100755
--- a/src/gen-use-table.py
+++ b/src/gen-use-table.py
@@ -394,7 +394,7 @@ for h in headers:
 		print (" * %s" % (l.strip()))
 print (" */")
 print ()
-print ('#include "hb-ot-shape-complex-use-private.hh"')
+print ('#include "hb-ot-shape-complex-use.hh"')
 print ()
 
 total = 0
diff --git a/src/hb-aat-layout-ankr-table.hh b/src/hb-aat-layout-ankr-table.hh
index 3b7912b9..a197cec8 100644
--- a/src/hb-aat-layout-ankr-table.hh
+++ b/src/hb-aat-layout-ankr-table.hh
@@ -25,7 +25,7 @@
 #ifndef HB_AAT_LAYOUT_ANKR_TABLE_HH
 #define HB_AAT_LAYOUT_ANKR_TABLE_HH
 
-#include "hb-aat-layout-common-private.hh"
+#include "hb-aat-layout-common.hh"
 
 /*
  * ankr -- Anchor Point
diff --git a/src/hb-aat-layout-bsln-table.hh b/src/hb-aat-layout-bsln-table.hh
index df2bf5b4..b8640862 100644
--- a/src/hb-aat-layout-bsln-table.hh
+++ b/src/hb-aat-layout-bsln-table.hh
@@ -25,7 +25,7 @@
 #ifndef HB_AAT_LAYOUT_BSLN_TABLE_HH
 #define HB_AAT_LAYOUT_BSLN_TABLE_HH
 
-#include "hb-aat-layout-common-private.hh"
+#include "hb-aat-layout-common.hh"
 
 /*
  * bsln -- Baseline
diff --git a/src/hb-aat-layout-common-private.hh b/src/hb-aat-layout-common.hh
similarity index 99%
rename from src/hb-aat-layout-common-private.hh
rename to src/hb-aat-layout-common.hh
index d7f35052..25f4fe14 100644
--- a/src/hb-aat-layout-common-private.hh
+++ b/src/hb-aat-layout-common.hh
@@ -24,10 +24,10 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_AAT_LAYOUT_COMMON_PRIVATE_HH
-#define HB_AAT_LAYOUT_COMMON_PRIVATE_HH
+#ifndef HB_AAT_LAYOUT_COMMON_HH
+#define HB_AAT_LAYOUT_COMMON_HH
 
-#include "hb-aat-layout-private.hh"
+#include "hb-aat-layout.hh"
 
 
 namespace AAT {
@@ -641,4 +641,4 @@ struct hb_aat_apply_context_t :
 } /* namespace AAT */
 
 
-#endif /* HB_AAT_LAYOUT_COMMON_PRIVATE_HH */
+#endif /* HB_AAT_LAYOUT_COMMON_HH */
diff --git a/src/hb-aat-layout-feat-table.hh b/src/hb-aat-layout-feat-table.hh
index 3e070d79..b7007631 100644
--- a/src/hb-aat-layout-feat-table.hh
+++ b/src/hb-aat-layout-feat-table.hh
@@ -25,7 +25,7 @@
 #ifndef HB_AAT_LAYOUT_FEAT_TABLE_HH
 #define HB_AAT_LAYOUT_FEAT_TABLE_HH
 
-#include "hb-aat-layout-common-private.hh"
+#include "hb-aat-layout-common.hh"
 
 /*
  * feat -- Feature Name
diff --git a/src/hb-aat-layout-kerx-table.hh b/src/hb-aat-layout-kerx-table.hh
index cc03d627..615a8f8d 100644
--- a/src/hb-aat-layout-kerx-table.hh
+++ b/src/hb-aat-layout-kerx-table.hh
@@ -28,8 +28,8 @@
 #ifndef HB_AAT_LAYOUT_KERX_TABLE_HH
 #define HB_AAT_LAYOUT_KERX_TABLE_HH
 
-#include "hb-open-type-private.hh"
-#include "hb-aat-layout-common-private.hh"
+#include "hb-open-type.hh"
+#include "hb-aat-layout-common.hh"
 #include "hb-aat-layout-ankr-table.hh"
 
 /*
diff --git a/src/hb-aat-layout-morx-table.hh b/src/hb-aat-layout-morx-table.hh
index f2584245..ef452e22 100644
--- a/src/hb-aat-layout-morx-table.hh
+++ b/src/hb-aat-layout-morx-table.hh
@@ -27,9 +27,9 @@
 #ifndef HB_AAT_LAYOUT_MORX_TABLE_HH
 #define HB_AAT_LAYOUT_MORX_TABLE_HH
 
-#include "hb-open-type-private.hh"
-#include "hb-aat-layout-common-private.hh"
-#include "hb-ot-layout-common-private.hh"
+#include "hb-open-type.hh"
+#include "hb-aat-layout-common.hh"
+#include "hb-ot-layout-common.hh"
 
 /*
  * morx -- Extended Glyph Metamorphosis
diff --git a/src/hb-aat-layout-trak-table.hh b/src/hb-aat-layout-trak-table.hh
index f5dc558c..c4bec2ca 100644
--- a/src/hb-aat-layout-trak-table.hh
+++ b/src/hb-aat-layout-trak-table.hh
@@ -28,9 +28,9 @@
 #ifndef HB_AAT_LAYOUT_TRAK_TABLE_HH
 #define HB_AAT_LAYOUT_TRAK_TABLE_HH
 
-#include "hb-aat-layout-common-private.hh"
-#include "hb-ot-layout-private.hh"
-#include "hb-open-type-private.hh"
+#include "hb-aat-layout-common.hh"
+#include "hb-ot-layout.hh"
+#include "hb-open-type.hh"
 
 /*
  * trak -- Tracking
diff --git a/src/hb-aat-layout.cc b/src/hb-aat-layout.cc
index fc706d6b..24ec53bc 100644
--- a/src/hb-aat-layout.cc
+++ b/src/hb-aat-layout.cc
@@ -24,12 +24,12 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-open-type-private.hh"
+#include "hb-open-type.hh"
 
-#include "hb-ot-layout-private.hh"
-#include "hb-ot-layout-gsubgpos-private.hh"
+#include "hb-ot-layout.hh"
+#include "hb-ot-layout-gsubgpos.hh"
 
-#include "hb-aat-layout-private.hh"
+#include "hb-aat-layout.hh"
 #include "hb-aat-layout-ankr-table.hh"
 #include "hb-aat-layout-bsln-table.hh" // Just so we compile it; unused otherwise.
 #include "hb-aat-layout-feat-table.hh" // Just so we compile it; unused otherwise.
diff --git a/src/hb-aat-layout-private.hh b/src/hb-aat-layout.hh
similarity index 84%
rename from src/hb-aat-layout-private.hh
rename to src/hb-aat-layout.hh
index ce75c8e7..ac9c5353 100644
--- a/src/hb-aat-layout-private.hh
+++ b/src/hb-aat-layout.hh
@@ -24,14 +24,14 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_AAT_LAYOUT_PRIVATE_HH
-#define HB_AAT_LAYOUT_PRIVATE_HH
+#ifndef HB_AAT_LAYOUT_HH
+#define HB_AAT_LAYOUT_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
-#include "hb-font-private.hh"
-#include "hb-buffer-private.hh"
-#include "hb-open-type-private.hh"
+#include "hb-font.hh"
+#include "hb-buffer.hh"
+#include "hb-open-type.hh"
 
 
 HB_INTERNAL void
@@ -40,4 +40,4 @@ hb_aat_layout_substitute (hb_font_t *font, hb_buffer_t *buffer);
 HB_INTERNAL void
 hb_aat_layout_position (hb_font_t *font, hb_buffer_t *buffer);
 
-#endif /* HB_AAT_LAYOUT_PRIVATE_HH */
+#endif /* HB_AAT_LAYOUT_HH */
diff --git a/src/hb-aat-ltag-table.hh b/src/hb-aat-ltag-table.hh
index 15c4e89c..e308ab28 100644
--- a/src/hb-aat-ltag-table.hh
+++ b/src/hb-aat-ltag-table.hh
@@ -25,7 +25,7 @@
 #ifndef HB_AAT_LTAG_TABLE_HH
 #define HB_AAT_LTAG_TABLE_HH
 
-#include "hb-aat-layout-common-private.hh"
+#include "hb-aat-layout-common.hh"
 
 /*
  * ltag -- Language Tag
diff --git a/src/hb-atomic-private.hh b/src/hb-atomic.hh
similarity index 98%
rename from src/hb-atomic-private.hh
rename to src/hb-atomic.hh
index 297c6469..d494c895 100644
--- a/src/hb-atomic-private.hh
+++ b/src/hb-atomic.hh
@@ -29,10 +29,10 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_ATOMIC_PRIVATE_HH
-#define HB_ATOMIC_PRIVATE_HH
+#ifndef HB_ATOMIC_HH
+#define HB_ATOMIC_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 
 /*
@@ -278,4 +278,4 @@ struct hb_atomic_ptr_t
 };
 
 
-#endif /* HB_ATOMIC_PRIVATE_HH */
+#endif /* HB_ATOMIC_HH */
diff --git a/src/hb-blob.cc b/src/hb-blob.cc
index 25c3e05a..a335df30 100644
--- a/src/hb-blob.cc
+++ b/src/hb-blob.cc
@@ -30,8 +30,8 @@
 #define _POSIX_C_SOURCE 200809L
 #endif
 
-#include "hb-private.hh"
-#include "hb-blob-private.hh"
+#include "hb.hh"
+#include "hb-blob.hh"
 
 #ifdef HAVE_SYS_MMAN_H
 #ifdef HAVE_UNISTD_H
diff --git a/src/hb-blob-private.hh b/src/hb-blob.hh
similarity index 94%
rename from src/hb-blob-private.hh
rename to src/hb-blob.hh
index 0d3fad57..bee8c979 100644
--- a/src/hb-blob-private.hh
+++ b/src/hb-blob.hh
@@ -26,10 +26,10 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_BLOB_PRIVATE_HH
-#define HB_BLOB_PRIVATE_HH
+#ifndef HB_BLOB_HH
+#define HB_BLOB_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 
 /*
@@ -83,4 +83,4 @@ struct hb_blob_t
 DECLARE_NULL_INSTANCE (hb_blob_t);
 
 
-#endif /* HB_BLOB_PRIVATE_HH */
+#endif /* HB_BLOB_HH */
diff --git a/src/hb-buffer-deserialize-json.hh b/src/hb-buffer-deserialize-json.hh
index 380f3c5f..1f9e2e91 100644
--- a/src/hb-buffer-deserialize-json.hh
+++ b/src/hb-buffer-deserialize-json.hh
@@ -29,7 +29,7 @@
 #ifndef HB_BUFFER_DESERIALIZE_JSON_HH
 #define HB_BUFFER_DESERIALIZE_JSON_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 
 #line 36 "hb-buffer-deserialize-json.hh"
diff --git a/src/hb-buffer-deserialize-json.rl b/src/hb-buffer-deserialize-json.rl
index ec9bc7c9..f3abb027 100644
--- a/src/hb-buffer-deserialize-json.rl
+++ b/src/hb-buffer-deserialize-json.rl
@@ -27,7 +27,7 @@
 #ifndef HB_BUFFER_DESERIALIZE_JSON_HH
 #define HB_BUFFER_DESERIALIZE_JSON_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 %%{
 
diff --git a/src/hb-buffer-deserialize-text.hh b/src/hb-buffer-deserialize-text.hh
index 5bca369f..67f0a125 100644
--- a/src/hb-buffer-deserialize-text.hh
+++ b/src/hb-buffer-deserialize-text.hh
@@ -29,7 +29,7 @@
 #ifndef HB_BUFFER_DESERIALIZE_TEXT_HH
 #define HB_BUFFER_DESERIALIZE_TEXT_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 
 #line 36 "hb-buffer-deserialize-text.hh"
diff --git a/src/hb-buffer-deserialize-text.rl b/src/hb-buffer-deserialize-text.rl
index 1d90979a..6268a6c5 100644
--- a/src/hb-buffer-deserialize-text.rl
+++ b/src/hb-buffer-deserialize-text.rl
@@ -27,7 +27,7 @@
 #ifndef HB_BUFFER_DESERIALIZE_TEXT_HH
 #define HB_BUFFER_DESERIALIZE_TEXT_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 %%{
 
diff --git a/src/hb-buffer-serialize.cc b/src/hb-buffer-serialize.cc
index 11471941..1b6d1473 100644
--- a/src/hb-buffer-serialize.cc
+++ b/src/hb-buffer-serialize.cc
@@ -24,7 +24,7 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-buffer-private.hh"
+#include "hb-buffer.hh"
 
 
 static const char *serialize_formats[] = {
diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc
index eb7b01ca..536ab5d5 100644
--- a/src/hb-buffer.cc
+++ b/src/hb-buffer.cc
@@ -27,8 +27,8 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-buffer-private.hh"
-#include "hb-utf-private.hh"
+#include "hb-buffer.hh"
+#include "hb-utf.hh"
 
 
 /**
diff --git a/src/hb-buffer-private.hh b/src/hb-buffer.hh
similarity index 98%
rename from src/hb-buffer-private.hh
rename to src/hb-buffer.hh
index a6c4b696..3e38fe1d 100644
--- a/src/hb-buffer-private.hh
+++ b/src/hb-buffer.hh
@@ -27,11 +27,11 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_BUFFER_PRIVATE_HH
-#define HB_BUFFER_PRIVATE_HH
+#ifndef HB_BUFFER_HH
+#define HB_BUFFER_HH
 
-#include "hb-private.hh"
-#include "hb-unicode-private.hh"
+#include "hb.hh"
+#include "hb-unicode.hh"
 
 
 #ifndef HB_BUFFER_MAX_LEN_FACTOR
@@ -386,4 +386,4 @@ _next_cluster (hb_buffer_t *buffer, unsigned int start)
 #define HB_BUFFER_ASSERT_VAR(b, var)		HB_BUFFER_XALLOCATE_VAR (b, assert_var,     var ())
 
 
-#endif /* HB_BUFFER_PRIVATE_HH */
+#endif /* HB_BUFFER_HH */
diff --git a/src/hb-common.cc b/src/hb-common.cc
index 614b71b7..ed3fed2a 100644
--- a/src/hb-common.cc
+++ b/src/hb-common.cc
@@ -26,9 +26,9 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-private.hh"
+#include "hb.hh"
 
-#include "hb-machinery-private.hh"
+#include "hb-machinery.hh"
 
 #include <locale.h>
 #ifdef HAVE_XLOCALE_H
diff --git a/src/hb-coretext.cc b/src/hb-coretext.cc
index 1b916a53..a7ba85f8 100644
--- a/src/hb-coretext.cc
+++ b/src/hb-coretext.cc
@@ -28,8 +28,8 @@
 
 #define HB_SHAPER coretext
 
-#include "hb-private.hh"
-#include "hb-shaper-impl-private.hh"
+#include "hb.hh"
+#include "hb-shaper-impl.hh"
 
 #include "hb-coretext.h"
 #include <math.h>
diff --git a/src/hb-debug.hh b/src/hb-debug.hh
index 9056ffca..49663d21 100644
--- a/src/hb-debug.hh
+++ b/src/hb-debug.hh
@@ -27,8 +27,8 @@
 #ifndef HB_DEBUG_HH
 #define HB_DEBUG_HH
 
-#include "hb-private.hh"
-#include "hb-atomic-private.hh"
+#include "hb.hh"
+#include "hb-atomic.hh"
 #include "hb-dsalgs.hh"
 
 
diff --git a/src/hb-directwrite.cc b/src/hb-directwrite.cc
index baad8188..35197c23 100644
--- a/src/hb-directwrite.cc
+++ b/src/hb-directwrite.cc
@@ -22,9 +22,9 @@
  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  */
 
-#include "hb-private.hh"
+#include "hb.hh"
 #define HB_SHAPER directwrite
-#include "hb-shaper-impl-private.hh"
+#include "hb-shaper-impl.hh"
 
 #include <DWrite_1.h>
 
diff --git a/src/hb-dsalgs.hh b/src/hb-dsalgs.hh
index c7aa611e..ec5708eb 100644
--- a/src/hb-dsalgs.hh
+++ b/src/hb-dsalgs.hh
@@ -27,7 +27,7 @@
 #ifndef HB_DSALGS_HH
 #define HB_DSALGS_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 
 /* Void! For when we need a expression-type of void. */
diff --git a/src/hb-face.cc b/src/hb-face.cc
index 9cb0f265..b3956c45 100644
--- a/src/hb-face.cc
+++ b/src/hb-face.cc
@@ -26,11 +26,11 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-private.hh"
+#include "hb.hh"
 
-#include "hb-face-private.hh"
-#include "hb-blob-private.hh"
-#include "hb-open-file-private.hh"
+#include "hb-face.hh"
+#include "hb-blob.hh"
+#include "hb-open-file.hh"
 
 
 /**
diff --git a/src/hb-face-private.hh b/src/hb-face.hh
similarity index 94%
rename from src/hb-face-private.hh
rename to src/hb-face.hh
index 086ce6e9..f90453db 100644
--- a/src/hb-face-private.hh
+++ b/src/hb-face.hh
@@ -26,13 +26,13 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_FACE_PRIVATE_HH
-#define HB_FACE_PRIVATE_HH
+#ifndef HB_FACE_HH
+#define HB_FACE_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
-#include "hb-shaper-private.hh"
-#include "hb-shape-plan-private.hh"
+#include "hb-shaper.hh"
+#include "hb-shape-plan.hh"
 
 
 /*
@@ -105,4 +105,4 @@ DECLARE_NULL_INSTANCE (hb_face_t);
 #undef HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS
 
 
-#endif /* HB_FACE_PRIVATE_HH */
+#endif /* HB_FACE_HH */
diff --git a/src/hb-fallback-shape.cc b/src/hb-fallback-shape.cc
index eff20f70..dc8536c8 100644
--- a/src/hb-fallback-shape.cc
+++ b/src/hb-fallback-shape.cc
@@ -25,7 +25,7 @@
  */
 
 #define HB_SHAPER fallback
-#include "hb-shaper-impl-private.hh"
+#include "hb-shaper-impl.hh"
 
 
 HB_SHAPER_DATA_ENSURE_DEFINE(fallback, face)
diff --git a/src/hb-font.cc b/src/hb-font.cc
index 857b8f57..bc831dd5 100644
--- a/src/hb-font.cc
+++ b/src/hb-font.cc
@@ -26,10 +26,10 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-private.hh"
+#include "hb.hh"
 
-#include "hb-font-private.hh"
-#include "hb-machinery-private.hh"
+#include "hb-font.hh"
+#include "hb-machinery.hh"
 
 
 /*
diff --git a/src/hb-font-private.hh b/src/hb-font.hh
similarity index 99%
rename from src/hb-font-private.hh
rename to src/hb-font.hh
index d3a41380..4c8d0aee 100644
--- a/src/hb-font-private.hh
+++ b/src/hb-font.hh
@@ -26,13 +26,13 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_FONT_PRIVATE_HH
-#define HB_FONT_PRIVATE_HH
+#ifndef HB_FONT_HH
+#define HB_FONT_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
-#include "hb-face-private.hh"
-#include "hb-shaper-private.hh"
+#include "hb-face.hh"
+#include "hb-shaper.hh"
 
 
 /*
@@ -601,4 +601,4 @@ DECLARE_NULL_INSTANCE (hb_font_t);
 #undef HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS
 
 
-#endif /* HB_FONT_PRIVATE_HH */
+#endif /* HB_FONT_HH */
diff --git a/src/hb-ft.cc b/src/hb-ft.cc
index c8740d15..5d6abb29 100644
--- a/src/hb-ft.cc
+++ b/src/hb-ft.cc
@@ -27,12 +27,12 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 #include "hb-ft.h"
 
-#include "hb-font-private.hh"
-#include "hb-machinery-private.hh"
+#include "hb-font.hh"
+#include "hb-machinery.hh"
 
 #include FT_ADVANCES_H
 #include FT_MULTIPLE_MASTERS_H
diff --git a/src/hb-glib.cc b/src/hb-glib.cc
index 81ec612d..18f3a81d 100644
--- a/src/hb-glib.cc
+++ b/src/hb-glib.cc
@@ -26,12 +26,12 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 #include "hb-glib.h"
 
-#include "hb-unicode-private.hh"
-#include "hb-machinery-private.hh"
+#include "hb-unicode.hh"
+#include "hb-machinery.hh"
 
 
 #if !GLIB_CHECK_VERSION(2,29,14)
diff --git a/src/hb-gobject-enums.cc.tmpl b/src/hb-gobject-enums.cc.tmpl
index ca458a38..e056df47 100644
--- a/src/hb-gobject-enums.cc.tmpl
+++ b/src/hb-gobject-enums.cc.tmpl
@@ -25,7 +25,7 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 /* g++ didn't like older gtype.h gcc-only code path. */
 #include <glib.h>
diff --git a/src/hb-gobject-structs.cc b/src/hb-gobject-structs.cc
index 0c8e5573..1b875858 100644
--- a/src/hb-gobject-structs.cc
+++ b/src/hb-gobject-structs.cc
@@ -24,7 +24,7 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 /* g++ didn't like older gtype.h gcc-only code path. */
 #include <glib.h>
diff --git a/src/hb-graphite2.cc b/src/hb-graphite2.cc
index 1f42a36f..817278f3 100644
--- a/src/hb-graphite2.cc
+++ b/src/hb-graphite2.cc
@@ -27,7 +27,7 @@
  */
 
 #define HB_SHAPER graphite2
-#include "hb-shaper-impl-private.hh"
+#include "hb-shaper-impl.hh"
 
 #include "hb-graphite2.h"
 
diff --git a/src/hb-icu.cc b/src/hb-icu.cc
index bffae071..564f71fe 100644
--- a/src/hb-icu.cc
+++ b/src/hb-icu.cc
@@ -27,12 +27,12 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 #include "hb-icu.h"
 
-#include "hb-unicode-private.hh"
-#include "hb-machinery-private.hh"
+#include "hb-unicode.hh"
+#include "hb-machinery.hh"
 
 #include <unicode/uchar.h>
 #include <unicode/unorm2.h>
diff --git a/src/hb-iter-private.hh b/src/hb-iter.hh
similarity index 97%
rename from src/hb-iter-private.hh
rename to src/hb-iter.hh
index 314133ad..6fd6aed7 100644
--- a/src/hb-iter-private.hh
+++ b/src/hb-iter.hh
@@ -24,10 +24,10 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_ITER_PRIVATE_HH
-#define HB_ITER_PRIVATE_HH
+#ifndef HB_ITER_HH
+#define HB_ITER_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 
 /* Unified iterator object.
@@ -146,4 +146,4 @@ m (void)
    }
 }
 
-#endif /* HB_ITER_PRIVATE_HH */
+#endif /* HB_ITER_HH */
diff --git a/src/hb-machinery-private.hh b/src/hb-machinery.hh
similarity index 99%
rename from src/hb-machinery-private.hh
rename to src/hb-machinery.hh
index b33dd996..56ecff85 100644
--- a/src/hb-machinery-private.hh
+++ b/src/hb-machinery.hh
@@ -26,13 +26,13 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_MACHINERY_PRIVATE_HH
-#define HB_MACHINERY_PRIVATE_HH
+#ifndef HB_MACHINERY_HH
+#define HB_MACHINERY_HH
 
-#include "hb-private.hh"
-#include "hb-blob-private.hh"
+#include "hb.hh"
+#include "hb-blob.hh"
 
-#include "hb-iter-private.hh"
+#include "hb-iter.hh"
 
 
 /*
@@ -870,4 +870,4 @@ struct hb_unicode_funcs_lazy_loader_t : hb_lazy_loader_t<hb_unicode_funcs_t, Sub
 };
 
 
-#endif /* HB_MACHINERY_PRIVATE_HH */
+#endif /* HB_MACHINERY_HH */
diff --git a/src/hb-map.cc b/src/hb-map.cc
index 138a8561..225f37bc 100644
--- a/src/hb-map.cc
+++ b/src/hb-map.cc
@@ -24,7 +24,7 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-map-private.hh"
+#include "hb-map.hh"
 
 
 /* Public API */
diff --git a/src/hb-map-private.hh b/src/hb-map.hh
similarity index 98%
rename from src/hb-map-private.hh
rename to src/hb-map.hh
index 00f089e8..21898a7a 100644
--- a/src/hb-map-private.hh
+++ b/src/hb-map.hh
@@ -24,10 +24,10 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_MAP_PRIVATE_HH
-#define HB_MAP_PRIVATE_HH
+#ifndef HB_MAP_HH
+#define HB_MAP_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 
 template <typename T>
@@ -251,4 +251,4 @@ struct hb_map_t
 };
 
 
-#endif /* HB_MAP_PRIVATE_HH */
+#endif /* HB_MAP_HH */
diff --git a/src/hb-mutex-private.hh b/src/hb-mutex.hh
similarity index 97%
rename from src/hb-mutex-private.hh
rename to src/hb-mutex.hh
index 14bde310..d8cdf4b6 100644
--- a/src/hb-mutex-private.hh
+++ b/src/hb-mutex.hh
@@ -29,10 +29,10 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_MUTEX_PRIVATE_HH
-#define HB_MUTEX_PRIVATE_HH
+#ifndef HB_MUTEX_HH
+#define HB_MUTEX_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 
 /* mutex */
@@ -138,4 +138,4 @@ struct hb_mutex_t
 };
 
 
-#endif /* HB_MUTEX_PRIVATE_HH */
+#endif /* HB_MUTEX_HH */
diff --git a/src/hb-null.hh b/src/hb-null.hh
index 91efee64..19886a5c 100644
--- a/src/hb-null.hh
+++ b/src/hb-null.hh
@@ -27,7 +27,7 @@
 #ifndef HB_NULL_HH
 #define HB_NULL_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 
 /*
diff --git a/src/hb-object-private.hh b/src/hb-object.hh
similarity index 97%
rename from src/hb-object-private.hh
rename to src/hb-object.hh
index 4955a68d..ca85af69 100644
--- a/src/hb-object-private.hh
+++ b/src/hb-object.hh
@@ -29,13 +29,13 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_OBJECT_PRIVATE_HH
-#define HB_OBJECT_PRIVATE_HH
+#ifndef HB_OBJECT_HH
+#define HB_OBJECT_HH
 
-#include "hb-private.hh"
-#include "hb-atomic-private.hh"
-#include "hb-mutex-private.hh"
-#include "hb-vector-private.hh"
+#include "hb.hh"
+#include "hb-atomic.hh"
+#include "hb-mutex.hh"
+#include "hb-vector.hh"
 
 
 /*
@@ -322,4 +322,4 @@ static inline void *hb_object_get_user_data (Type               *obj,
 }
 
 
-#endif /* HB_OBJECT_PRIVATE_HH */
+#endif /* HB_OBJECT_HH */
diff --git a/src/hb-open-file-private.hh b/src/hb-open-file.hh
similarity index 99%
rename from src/hb-open-file-private.hh
rename to src/hb-open-file.hh
index d47bff66..97e736ee 100644
--- a/src/hb-open-file-private.hh
+++ b/src/hb-open-file.hh
@@ -26,10 +26,10 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_OPEN_FILE_PRIVATE_HH
-#define HB_OPEN_FILE_PRIVATE_HH
+#ifndef HB_OPEN_FILE_HH
+#define HB_OPEN_FILE_HH
 
-#include "hb-open-type-private.hh"
+#include "hb-open-type.hh"
 #include "hb-ot-head-table.hh"
 
 
@@ -565,4 +565,4 @@ struct OpenTypeFontFile
 } /* namespace OT */
 
 
-#endif /* HB_OPEN_FILE_PRIVATE_HH */
+#endif /* HB_OPEN_FILE_HH */
diff --git a/src/hb-open-type-private.hh b/src/hb-open-type.hh
similarity index 98%
rename from src/hb-open-type-private.hh
rename to src/hb-open-type.hh
index 5580565f..48a8eaa7 100644
--- a/src/hb-open-type-private.hh
+++ b/src/hb-open-type.hh
@@ -26,13 +26,13 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_OPEN_TYPE_PRIVATE_HH
-#define HB_OPEN_TYPE_PRIVATE_HH
+#ifndef HB_OPEN_TYPE_HH
+#define HB_OPEN_TYPE_HH
 
-#include "hb-private.hh"
-#include "hb-blob-private.hh"
-#include "hb-face-private.hh"
-#include "hb-machinery-private.hh"
+#include "hb.hh"
+#include "hb-blob.hh"
+#include "hb-face.hh"
+#include "hb-machinery.hh"
 
 
 namespace OT {
@@ -646,4 +646,4 @@ struct BinSearchArrayOf : SortedArrayOf<Type, BinSearchHeader> {};
 } /* namespace OT */
 
 
-#endif /* HB_OPEN_TYPE_PRIVATE_HH */
+#endif /* HB_OPEN_TYPE_HH */
diff --git a/src/hb-ot-cmap-table.hh b/src/hb-ot-cmap-table.hh
index 6ab578c2..dce29813 100644
--- a/src/hb-ot-cmap-table.hh
+++ b/src/hb-ot-cmap-table.hh
@@ -27,8 +27,8 @@
 #ifndef HB_OT_CMAP_TABLE_HH
 #define HB_OT_CMAP_TABLE_HH
 
-#include "hb-open-type-private.hh"
-#include "hb-set-private.hh"
+#include "hb-open-type.hh"
+#include "hb-set.hh"
 #include "hb-subset-plan.hh"
 
 /*
diff --git a/src/hb-ot-color-cbdt-table.hh b/src/hb-ot-color-cbdt-table.hh
index 21c2f477..8533b036 100644
--- a/src/hb-ot-color-cbdt-table.hh
+++ b/src/hb-ot-color-cbdt-table.hh
@@ -27,7 +27,7 @@
 #ifndef HB_OT_COLOR_CBDT_TABLE_HH
 #define HB_OT_COLOR_CBDT_TABLE_HH
 
-#include "hb-open-type-private.hh"
+#include "hb-open-type.hh"
 
 /*
  * CBLC -- Color Bitmap Location
diff --git a/src/hb-ot-color-colr-table.hh b/src/hb-ot-color-colr-table.hh
index ce6702d2..070226f1 100644
--- a/src/hb-ot-color-colr-table.hh
+++ b/src/hb-ot-color-colr-table.hh
@@ -25,7 +25,7 @@
 #ifndef HB_OT_COLOR_COLR_TABLE_HH
 #define HB_OT_COLOR_COLR_TABLE_HH
 
-#include "hb-open-type-private.hh"
+#include "hb-open-type.hh"
 
 /*
  * COLR -- Color
diff --git a/src/hb-ot-color-cpal-table.hh b/src/hb-ot-color-cpal-table.hh
index 2c312748..2c9fced0 100644
--- a/src/hb-ot-color-cpal-table.hh
+++ b/src/hb-ot-color-cpal-table.hh
@@ -28,7 +28,7 @@
 #ifndef HB_OT_COLOR_CPAL_TABLE_HH
 #define HB_OT_COLOR_CPAL_TABLE_HH
 
-#include "hb-open-type-private.hh"
+#include "hb-open-type.hh"
 
 
 /*
diff --git a/src/hb-ot-color-sbix-table.hh b/src/hb-ot-color-sbix-table.hh
index 0461afa3..1b643c77 100644
--- a/src/hb-ot-color-sbix-table.hh
+++ b/src/hb-ot-color-sbix-table.hh
@@ -25,7 +25,7 @@
 #ifndef HB_OT_COLOR_SBIX_TABLE_HH
 #define HB_OT_COLOR_SBIX_TABLE_HH
 
-#include "hb-open-type-private.hh"
+#include "hb-open-type.hh"
 
 /*
  * sbix -- Standard Bitmap Graphics
diff --git a/src/hb-ot-color-svg-table.hh b/src/hb-ot-color-svg-table.hh
index 3976694f..ad9162f7 100644
--- a/src/hb-ot-color-svg-table.hh
+++ b/src/hb-ot-color-svg-table.hh
@@ -25,7 +25,7 @@
 #ifndef HB_OT_COLOR_SVG_TABLE_HH
 #define HB_OT_COLOR_SVG_TABLE_HH
 
-#include "hb-open-type-private.hh"
+#include "hb-open-type.hh"
 
 /*
  * SVG -- SVG (Scalable Vector Graphics)
diff --git a/src/hb-ot-color.cc b/src/hb-ot-color.cc
index 44550d78..7cdff380 100644
--- a/src/hb-ot-color.cc
+++ b/src/hb-ot-color.cc
@@ -25,7 +25,7 @@
  * Google Author(s): Sascha Brawer
  */
 
-#include "hb-open-type-private.hh"
+#include "hb-open-type.hh"
 #include "hb-ot-color-colr-table.hh"
 #include "hb-ot-color-cpal-table.hh"
 #include "hb-ot.h"
@@ -33,8 +33,8 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "hb-ot-layout-private.hh"
-#include "hb-shaper-private.hh"
+#include "hb-ot-layout.hh"
+#include "hb-shaper.hh"
 
 #if 0
 HB_MARK_AS_FLAG_T (hb_ot_color_palette_flags_t)
diff --git a/src/hb-ot-font.cc b/src/hb-ot-font.cc
index c559d875..f6e69d9e 100644
--- a/src/hb-ot-font.cc
+++ b/src/hb-ot-font.cc
@@ -24,12 +24,12 @@
  * Google Author(s): Behdad Esfahbod, Roozbeh Pournader
  */
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 #include "hb-ot.h"
 
-#include "hb-font-private.hh"
-#include "hb-machinery-private.hh"
+#include "hb-font.hh"
+#include "hb-machinery.hh"
 
 #include "hb-ot-cmap-table.hh"
 #include "hb-ot-glyf-table.hh"
diff --git a/src/hb-ot-glyf-table.hh b/src/hb-ot-glyf-table.hh
index bcf89e46..a23269e5 100644
--- a/src/hb-ot-glyf-table.hh
+++ b/src/hb-ot-glyf-table.hh
@@ -27,11 +27,11 @@
 #ifndef HB_OT_GLYF_TABLE_HH
 #define HB_OT_GLYF_TABLE_HH
 
-#include "hb-open-type-private.hh"
+#include "hb-open-type.hh"
 #include "hb-ot-head-table.hh"
 #include "hb-subset-glyf.hh"
 #include "hb-subset-plan.hh"
-#include "hb-subset-private.hh"
+#include "hb-subset.hh"
 
 namespace OT {
 
diff --git a/src/hb-ot-hdmx-table.hh b/src/hb-ot-hdmx-table.hh
index 0951871c..5ce5fe4a 100644
--- a/src/hb-ot-hdmx-table.hh
+++ b/src/hb-ot-hdmx-table.hh
@@ -27,7 +27,7 @@
 #ifndef HB_OT_HDMX_TABLE_HH
 #define HB_OT_HDMX_TABLE_HH
 
-#include "hb-open-type-private.hh"
+#include "hb-open-type.hh"
 #include "hb-subset-plan.hh"
 
 /*
diff --git a/src/hb-ot-head-table.hh b/src/hb-ot-head-table.hh
index fded120b..602e365c 100644
--- a/src/hb-ot-head-table.hh
+++ b/src/hb-ot-head-table.hh
@@ -29,7 +29,7 @@
 #ifndef HB_OT_HEAD_TABLE_HH
 #define HB_OT_HEAD_TABLE_HH
 
-#include "hb-open-type-private.hh"
+#include "hb-open-type.hh"
 
 /*
  * head -- Font Header
diff --git a/src/hb-ot-hhea-table.hh b/src/hb-ot-hhea-table.hh
index efb42b61..3336cadd 100644
--- a/src/hb-ot-hhea-table.hh
+++ b/src/hb-ot-hhea-table.hh
@@ -27,7 +27,7 @@
 #ifndef HB_OT_HHEA_TABLE_HH
 #define HB_OT_HHEA_TABLE_HH
 
-#include "hb-open-type-private.hh"
+#include "hb-open-type.hh"
 
 /*
  * hhea -- Horizontal Header
diff --git a/src/hb-ot-hmtx-table.hh b/src/hb-ot-hmtx-table.hh
index 13fa9d6e..6849172b 100644
--- a/src/hb-ot-hmtx-table.hh
+++ b/src/hb-ot-hmtx-table.hh
@@ -27,7 +27,7 @@
 #ifndef HB_OT_HMTX_TABLE_HH
 #define HB_OT_HMTX_TABLE_HH
 
-#include "hb-open-type-private.hh"
+#include "hb-open-type.hh"
 #include "hb-ot-hhea-table.hh"
 #include "hb-ot-os2-table.hh"
 #include "hb-ot-var-hvar-table.hh"
diff --git a/src/hb-ot-kern-table.hh b/src/hb-ot-kern-table.hh
index b4d81095..ac6e9e45 100644
--- a/src/hb-ot-kern-table.hh
+++ b/src/hb-ot-kern-table.hh
@@ -27,7 +27,7 @@
 #ifndef HB_OT_KERN_TABLE_HH
 #define HB_OT_KERN_TABLE_HH
 
-#include "hb-open-type-private.hh"
+#include "hb-open-type.hh"
 
 /*
  * kern -- Kerning
diff --git a/src/hb-ot-layout-base-table.hh b/src/hb-ot-layout-base-table.hh
index 96da07fb..449e7455 100644
--- a/src/hb-ot-layout-base-table.hh
+++ b/src/hb-ot-layout-base-table.hh
@@ -28,8 +28,8 @@
 #ifndef HB_OT_LAYOUT_BASE_TABLE_HH
 #define HB_OT_LAYOUT_BASE_TABLE_HH
 
-#include "hb-open-type-private.hh"
-#include "hb-ot-layout-common-private.hh"
+#include "hb-open-type.hh"
+#include "hb-ot-layout-common.hh"
 
 namespace OT {
 
diff --git a/src/hb-ot-layout-common-private.hh b/src/hb-ot-layout-common.hh
similarity index 99%
rename from src/hb-ot-layout-common-private.hh
rename to src/hb-ot-layout-common.hh
index fa41241c..887f27e9 100644
--- a/src/hb-ot-layout-common-private.hh
+++ b/src/hb-ot-layout-common.hh
@@ -26,13 +26,13 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_OT_LAYOUT_COMMON_PRIVATE_HH
-#define HB_OT_LAYOUT_COMMON_PRIVATE_HH
+#ifndef HB_OT_LAYOUT_COMMON_HH
+#define HB_OT_LAYOUT_COMMON_HH
 
-#include "hb-private.hh"
-#include "hb-ot-layout-private.hh"
-#include "hb-open-type-private.hh"
-#include "hb-set-private.hh"
+#include "hb.hh"
+#include "hb-ot-layout.hh"
+#include "hb-open-type.hh"
+#include "hb-set.hh"
 
 
 #ifndef HB_MAX_NESTING_LEVEL
@@ -1822,4 +1822,4 @@ struct Device
 } /* namespace OT */
 
 
-#endif /* HB_OT_LAYOUT_COMMON_PRIVATE_HH */
+#endif /* HB_OT_LAYOUT_COMMON_HH */
diff --git a/src/hb-ot-layout-gdef-table.hh b/src/hb-ot-layout-gdef-table.hh
index d2b41a8e..637f7f5c 100644
--- a/src/hb-ot-layout-gdef-table.hh
+++ b/src/hb-ot-layout-gdef-table.hh
@@ -29,9 +29,9 @@
 #ifndef HB_OT_LAYOUT_GDEF_TABLE_HH
 #define HB_OT_LAYOUT_GDEF_TABLE_HH
 
-#include "hb-ot-layout-common-private.hh"
+#include "hb-ot-layout-common.hh"
 
-#include "hb-font-private.hh"
+#include "hb-font.hh"
 
 
 namespace OT {
diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh
index 95bc588b..66767dfd 100644
--- a/src/hb-ot-layout-gpos-table.hh
+++ b/src/hb-ot-layout-gpos-table.hh
@@ -29,7 +29,7 @@
 #ifndef HB_OT_LAYOUT_GPOS_TABLE_HH
 #define HB_OT_LAYOUT_GPOS_TABLE_HH
 
-#include "hb-ot-layout-gsubgpos-private.hh"
+#include "hb-ot-layout-gsubgpos.hh"
 
 
 namespace OT {
diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh
index eaee7daa..d2c1fb9a 100644
--- a/src/hb-ot-layout-gsub-table.hh
+++ b/src/hb-ot-layout-gsub-table.hh
@@ -29,7 +29,7 @@
 #ifndef HB_OT_LAYOUT_GSUB_TABLE_HH
 #define HB_OT_LAYOUT_GSUB_TABLE_HH
 
-#include "hb-ot-layout-gsubgpos-private.hh"
+#include "hb-ot-layout-gsubgpos.hh"
 
 
 namespace OT {
diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos.hh
similarity index 99%
rename from src/hb-ot-layout-gsubgpos-private.hh
rename to src/hb-ot-layout-gsubgpos.hh
index 9b1a19f0..76a7e253 100644
--- a/src/hb-ot-layout-gsubgpos-private.hh
+++ b/src/hb-ot-layout-gsubgpos.hh
@@ -26,14 +26,14 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_OT_LAYOUT_GSUBGPOS_PRIVATE_HH
-#define HB_OT_LAYOUT_GSUBGPOS_PRIVATE_HH
+#ifndef HB_OT_LAYOUT_GSUBGPOS_HH
+#define HB_OT_LAYOUT_GSUBGPOS_HH
 
-#include "hb-private.hh"
-#include "hb-buffer-private.hh"
-#include "hb-map-private.hh"
+#include "hb.hh"
+#include "hb-buffer.hh"
+#include "hb-map.hh"
 #include "hb-ot-layout-gdef-table.hh"
-#include "hb-set-private.hh"
+#include "hb-set.hh"
 
 
 namespace OT {
@@ -2403,4 +2403,4 @@ struct GSUBGPOS
 } /* namespace OT */
 
 
-#endif /* HB_OT_LAYOUT_GSUBGPOS_PRIVATE_HH */
+#endif /* HB_OT_LAYOUT_GSUBGPOS_HH */
diff --git a/src/hb-ot-layout-jstf-table.hh b/src/hb-ot-layout-jstf-table.hh
index 7fabdebb..e718c319 100644
--- a/src/hb-ot-layout-jstf-table.hh
+++ b/src/hb-ot-layout-jstf-table.hh
@@ -27,7 +27,7 @@
 #ifndef HB_OT_LAYOUT_JSTF_TABLE_HH
 #define HB_OT_LAYOUT_JSTF_TABLE_HH
 
-#include "hb-open-type-private.hh"
+#include "hb-open-type.hh"
 #include "hb-ot-layout-gpos-table.hh"
 
 
diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc
index 09f03433..1fe45438 100644
--- a/src/hb-ot-layout.cc
+++ b/src/hb-ot-layout.cc
@@ -28,10 +28,10 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-open-type-private.hh"
-#include "hb-ot-layout-private.hh"
-#include "hb-ot-map-private.hh"
-#include "hb-map-private.hh"
+#include "hb-open-type.hh"
+#include "hb-ot-layout.hh"
+#include "hb-ot-map.hh"
+#include "hb-map.hh"
 
 #include "hb-ot-layout-gdef-table.hh"
 #include "hb-ot-layout-gsub-table.hh"
diff --git a/src/hb-ot-layout-private.hh b/src/hb-ot-layout.hh
similarity index 98%
rename from src/hb-ot-layout-private.hh
rename to src/hb-ot-layout.hh
index 8f1e2c9c..9c705b7d 100644
--- a/src/hb-ot-layout-private.hh
+++ b/src/hb-ot-layout.hh
@@ -26,15 +26,15 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_OT_LAYOUT_PRIVATE_HH
-#define HB_OT_LAYOUT_PRIVATE_HH
+#ifndef HB_OT_LAYOUT_HH
+#define HB_OT_LAYOUT_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
-#include "hb-font-private.hh"
-#include "hb-buffer-private.hh"
-#include "hb-set-digest-private.hh"
-#include "hb-open-type-private.hh"
+#include "hb-font.hh"
+#include "hb-buffer.hh"
+#include "hb-set-digest.hh"
+#include "hb-open-type.hh"
 
 
 /* Private API corresponding to hb-ot-layout.h: */
@@ -701,4 +701,4 @@ _hb_buffer_assert_gsubgpos_vars (hb_buffer_t *buffer)
 #undef lig_props
 #undef glyph_props
 
-#endif /* HB_OT_LAYOUT_PRIVATE_HH */
+#endif /* HB_OT_LAYOUT_HH */
diff --git a/src/hb-ot-map.cc b/src/hb-ot-map.cc
index f26cac9b..29f52dcc 100644
--- a/src/hb-ot-map.cc
+++ b/src/hb-ot-map.cc
@@ -26,9 +26,9 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-ot-map-private.hh"
+#include "hb-ot-map.hh"
 
-#include "hb-ot-layout-private.hh"
+#include "hb-ot-layout.hh"
 
 
 void hb_ot_map_t::collect_lookups (unsigned int table_index, hb_set_t *lookups_out) const
diff --git a/src/hb-ot-map-private.hh b/src/hb-ot-map.hh
similarity index 98%
rename from src/hb-ot-map-private.hh
rename to src/hb-ot-map.hh
index 4aaf3283..32a9e7e0 100644
--- a/src/hb-ot-map-private.hh
+++ b/src/hb-ot-map.hh
@@ -26,10 +26,10 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_OT_MAP_PRIVATE_HH
-#define HB_OT_MAP_PRIVATE_HH
+#ifndef HB_OT_MAP_HH
+#define HB_OT_MAP_HH
 
-#include "hb-buffer-private.hh"
+#include "hb-buffer.hh"
 
 
 struct hb_ot_shape_plan_t;
@@ -250,4 +250,4 @@ struct hb_ot_map_builder_t
 
 
 
-#endif /* HB_OT_MAP_PRIVATE_HH */
+#endif /* HB_OT_MAP_HH */
diff --git a/src/hb-ot-math-table.hh b/src/hb-ot-math-table.hh
index 2dd71458..b7ca167b 100644
--- a/src/hb-ot-math-table.hh
+++ b/src/hb-ot-math-table.hh
@@ -27,8 +27,8 @@
 #ifndef HB_OT_MATH_TABLE_HH
 #define HB_OT_MATH_TABLE_HH
 
-#include "hb-open-type-private.hh"
-#include "hb-ot-layout-common-private.hh"
+#include "hb-open-type.hh"
+#include "hb-ot-layout-common.hh"
 #include "hb-ot-math.h"
 
 namespace OT {
diff --git a/src/hb-ot-math.cc b/src/hb-ot-math.cc
index ead6259d..48adf8ac 100644
--- a/src/hb-ot-math.cc
+++ b/src/hb-ot-math.cc
@@ -24,9 +24,9 @@
  * Igalia Author(s): Frédéric Wang
  */
 
-#include "hb-open-type-private.hh"
+#include "hb-open-type.hh"
 
-#include "hb-ot-layout-private.hh"
+#include "hb-ot-layout.hh"
 #include "hb-ot-math-table.hh"
 
 static inline const OT::MATH&
diff --git a/src/hb-ot-maxp-table.hh b/src/hb-ot-maxp-table.hh
index 75aac4f4..cd2a85eb 100644
--- a/src/hb-ot-maxp-table.hh
+++ b/src/hb-ot-maxp-table.hh
@@ -27,7 +27,7 @@
 #ifndef HB_OT_MAXP_TABLE_HH
 #define HB_OT_MAXP_TABLE_HH
 
-#include "hb-open-type-private.hh"
+#include "hb-open-type.hh"
 #include "hb-subset-plan.hh"
 
 namespace OT {
diff --git a/src/hb-ot-name-table.hh b/src/hb-ot-name-table.hh
index bff85df2..a1de1193 100644
--- a/src/hb-ot-name-table.hh
+++ b/src/hb-ot-name-table.hh
@@ -27,7 +27,7 @@
 #ifndef HB_OT_NAME_TABLE_HH
 #define HB_OT_NAME_TABLE_HH
 
-#include "hb-open-type-private.hh"
+#include "hb-open-type.hh"
 
 
 namespace OT {
diff --git a/src/hb-ot-os2-table.hh b/src/hb-ot-os2-table.hh
index 56bbab74..c5ad803a 100644
--- a/src/hb-ot-os2-table.hh
+++ b/src/hb-ot-os2-table.hh
@@ -27,7 +27,7 @@
 #ifndef HB_OT_OS2_TABLE_HH
 #define HB_OT_OS2_TABLE_HH
 
-#include "hb-open-type-private.hh"
+#include "hb-open-type.hh"
 #include "hb-ot-os2-unicode-ranges.hh"
 #include "hb-subset-plan.hh"
 
diff --git a/src/hb-ot-os2-unicode-ranges.hh b/src/hb-ot-os2-unicode-ranges.hh
index cb126078..42dfa490 100644
--- a/src/hb-ot-os2-unicode-ranges.hh
+++ b/src/hb-ot-os2-unicode-ranges.hh
@@ -27,7 +27,7 @@
 #ifndef HB_OT_OS2_UNICODE_RANGES_HH
 #define HB_OT_OS2_UNICODE_RANGES_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 namespace OT {
 
diff --git a/src/hb-ot-post-macroman.hh b/src/hb-ot-post-macroman.hh
index dbbb97e5..b4df8aae 100644
--- a/src/hb-ot-post-macroman.hh
+++ b/src/hb-ot-post-macroman.hh
@@ -27,7 +27,7 @@
 #ifndef HB_OT_POST_MACROMAN_HH
 #if 0 /* Make checks happy. */
 #define HB_OT_POST_MACROMAN_HH
-#include "hb-private.hh"
+#include "hb.hh"
 #endif
 
 
diff --git a/src/hb-ot-post-table.hh b/src/hb-ot-post-table.hh
index 4f08a51a..44918b1d 100644
--- a/src/hb-ot-post-table.hh
+++ b/src/hb-ot-post-table.hh
@@ -27,7 +27,7 @@
 #ifndef HB_OT_POST_TABLE_HH
 #define HB_OT_POST_TABLE_HH
 
-#include "hb-open-type-private.hh"
+#include "hb-open-type.hh"
 #include "hb-subset-plan.hh"
 
 #define HB_STRING_ARRAY_NAME format1_names
diff --git a/src/hb-ot-shape-complex-arabic-fallback.hh b/src/hb-ot-shape-complex-arabic-fallback.hh
index a55511aa..03f46d84 100644
--- a/src/hb-ot-shape-complex-arabic-fallback.hh
+++ b/src/hb-ot-shape-complex-arabic-fallback.hh
@@ -27,9 +27,9 @@
 #ifndef HB_OT_SHAPE_COMPLEX_ARABIC_FALLBACK_HH
 #define HB_OT_SHAPE_COMPLEX_ARABIC_FALLBACK_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
-#include "hb-ot-shape-private.hh"
+#include "hb-ot-shape.hh"
 #include "hb-ot-layout-gsub-table.hh"
 
 
diff --git a/src/hb-ot-shape-complex-arabic-win1256.hh b/src/hb-ot-shape-complex-arabic-win1256.hh
index 54c6cdc2..b15e145f 100644
--- a/src/hb-ot-shape-complex-arabic-win1256.hh
+++ b/src/hb-ot-shape-complex-arabic-win1256.hh
@@ -313,7 +313,7 @@ OT_TABLE_END
  * Include a second time to get the table data...
  */
 #if 0
-#include "hb-private.hh" /* Make check-includes.sh happy. */
+#include "hb.hh" /* Make check-includes.sh happy. */
 #endif
 #ifdef OT_MEASURE
 #include "hb-ot-shape-complex-arabic-win1256.hh"
diff --git a/src/hb-ot-shape-complex-arabic.cc b/src/hb-ot-shape-complex-arabic.cc
index f4b397b9..ebc1d3d5 100644
--- a/src/hb-ot-shape-complex-arabic.cc
+++ b/src/hb-ot-shape-complex-arabic.cc
@@ -24,9 +24,9 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-private.hh"
-#include "hb-ot-shape-complex-arabic-private.hh"
-#include "hb-ot-shape-private.hh"
+#include "hb.hh"
+#include "hb-ot-shape-complex-arabic.hh"
+#include "hb-ot-shape.hh"
 
 
 /* buffer var allocations */
diff --git a/src/hb-ot-shape-complex-arabic-private.hh b/src/hb-ot-shape-complex-arabic.hh
similarity index 87%
rename from src/hb-ot-shape-complex-arabic-private.hh
rename to src/hb-ot-shape-complex-arabic.hh
index fcedc7d7..5bf6ff63 100644
--- a/src/hb-ot-shape-complex-arabic-private.hh
+++ b/src/hb-ot-shape-complex-arabic.hh
@@ -26,12 +26,12 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_OT_SHAPE_COMPLEX_ARABIC_PRIVATE_HH
-#define HB_OT_SHAPE_COMPLEX_ARABIC_PRIVATE_HH
+#ifndef HB_OT_SHAPE_COMPLEX_ARABIC_HH
+#define HB_OT_SHAPE_COMPLEX_ARABIC_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
-#include "hb-ot-shape-complex-private.hh"
+#include "hb-ot-shape-complex.hh"
 
 
 struct arabic_shape_plan_t;
@@ -47,4 +47,4 @@ setup_masks_arabic_plan (const arabic_shape_plan_t *arabic_plan,
 			 hb_buffer_t               *buffer,
 			 hb_script_t                script);
 
-#endif /* HB_OT_SHAPE_COMPLEX_ARABIC_PRIVATE_HH */
+#endif /* HB_OT_SHAPE_COMPLEX_ARABIC_HH */
diff --git a/src/hb-ot-shape-complex-default.cc b/src/hb-ot-shape-complex-default.cc
index 68a62a10..45d5f434 100644
--- a/src/hb-ot-shape-complex-default.cc
+++ b/src/hb-ot-shape-complex-default.cc
@@ -24,7 +24,7 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-ot-shape-complex-private.hh"
+#include "hb-ot-shape-complex.hh"
 
 
 const hb_ot_complex_shaper_t _hb_ot_complex_shaper_default =
diff --git a/src/hb-ot-shape-complex-hangul.cc b/src/hb-ot-shape-complex-hangul.cc
index 7420c5d1..ea731114 100644
--- a/src/hb-ot-shape-complex-hangul.cc
+++ b/src/hb-ot-shape-complex-hangul.cc
@@ -24,7 +24,7 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-ot-shape-complex-private.hh"
+#include "hb-ot-shape-complex.hh"
 
 
 /* Hangul shaper */
diff --git a/src/hb-ot-shape-complex-hebrew.cc b/src/hb-ot-shape-complex-hebrew.cc
index 34cf28b8..ba25258a 100644
--- a/src/hb-ot-shape-complex-hebrew.cc
+++ b/src/hb-ot-shape-complex-hebrew.cc
@@ -24,7 +24,7 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-ot-shape-complex-private.hh"
+#include "hb-ot-shape-complex.hh"
 
 
 static bool
diff --git a/src/hb-ot-shape-complex-indic-machine.hh b/src/hb-ot-shape-complex-indic-machine.hh
index 73f9d587..f67a525c 100644
--- a/src/hb-ot-shape-complex-indic-machine.hh
+++ b/src/hb-ot-shape-complex-indic-machine.hh
@@ -29,7 +29,7 @@
 #ifndef HB_OT_SHAPE_COMPLEX_INDIC_MACHINE_HH
 #define HB_OT_SHAPE_COMPLEX_INDIC_MACHINE_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 
 #line 36 "hb-ot-shape-complex-indic-machine.hh"
diff --git a/src/hb-ot-shape-complex-indic-machine.rl b/src/hb-ot-shape-complex-indic-machine.rl
index 35e7ce90..d384a68c 100644
--- a/src/hb-ot-shape-complex-indic-machine.rl
+++ b/src/hb-ot-shape-complex-indic-machine.rl
@@ -27,7 +27,7 @@
 #ifndef HB_OT_SHAPE_COMPLEX_INDIC_MACHINE_HH
 #define HB_OT_SHAPE_COMPLEX_INDIC_MACHINE_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 %%{
   machine indic_syllable_machine;
diff --git a/src/hb-ot-shape-complex-indic-table.cc b/src/hb-ot-shape-complex-indic-table.cc
index 54291bc2..b7e4e7c7 100644
--- a/src/hb-ot-shape-complex-indic-table.cc
+++ b/src/hb-ot-shape-complex-indic-table.cc
@@ -14,7 +14,7 @@
  * # Date: 2017-10-16, 24:39:00 GMT [KW]
  */
 
-#include "hb-ot-shape-complex-indic-private.hh"
+#include "hb-ot-shape-complex-indic.hh"
 
 
 #define ISC_A	INDIC_SYLLABIC_CATEGORY_AVAGRAHA		/*  16 chars; Avagraha */
diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc
index b52656f4..d4541bb1 100644
--- a/src/hb-ot-shape-complex-indic.cc
+++ b/src/hb-ot-shape-complex-indic.cc
@@ -24,8 +24,8 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-ot-shape-complex-indic-private.hh"
-#include "hb-ot-layout-private.hh"
+#include "hb-ot-shape-complex-indic.hh"
+#include "hb-ot-layout.hh"
 
 
 /*
diff --git a/src/hb-ot-shape-complex-indic-private.hh b/src/hb-ot-shape-complex-indic.hh
similarity index 98%
rename from src/hb-ot-shape-complex-indic-private.hh
rename to src/hb-ot-shape-complex-indic.hh
index bb7fff38..9e597797 100644
--- a/src/hb-ot-shape-complex-indic-private.hh
+++ b/src/hb-ot-shape-complex-indic.hh
@@ -24,14 +24,14 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_OT_SHAPE_COMPLEX_INDIC_PRIVATE_HH
-#define HB_OT_SHAPE_COMPLEX_INDIC_PRIVATE_HH
+#ifndef HB_OT_SHAPE_COMPLEX_INDIC_HH
+#define HB_OT_SHAPE_COMPLEX_INDIC_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 
-#include "hb-ot-shape-complex-private.hh"
-#include "hb-ot-shape-private.hh" /* XXX Remove */
+#include "hb-ot-shape-complex.hh"
+#include "hb-ot-shape.hh" /* XXX Remove */
 
 
 /* buffer var allocations */
@@ -400,4 +400,4 @@ set_indic_properties (hb_glyph_info_t &info)
 }
 
 
-#endif /* HB_OT_SHAPE_COMPLEX_INDIC_PRIVATE_HH */
+#endif /* HB_OT_SHAPE_COMPLEX_INDIC_HH */
diff --git a/src/hb-ot-shape-complex-khmer-machine.hh b/src/hb-ot-shape-complex-khmer-machine.hh
index d0010215..a7e1711e 100644
--- a/src/hb-ot-shape-complex-khmer-machine.hh
+++ b/src/hb-ot-shape-complex-khmer-machine.hh
@@ -29,7 +29,7 @@
 #ifndef HB_OT_SHAPE_COMPLEX_KHMER_MACHINE_HH
 #define HB_OT_SHAPE_COMPLEX_KHMER_MACHINE_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 
 #line 36 "hb-ot-shape-complex-khmer-machine.hh"
diff --git a/src/hb-ot-shape-complex-khmer-machine.rl b/src/hb-ot-shape-complex-khmer-machine.rl
index 54644d8a..7c795162 100644
--- a/src/hb-ot-shape-complex-khmer-machine.rl
+++ b/src/hb-ot-shape-complex-khmer-machine.rl
@@ -27,7 +27,7 @@
 #ifndef HB_OT_SHAPE_COMPLEX_KHMER_MACHINE_HH
 #define HB_OT_SHAPE_COMPLEX_KHMER_MACHINE_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 %%{
   machine khmer_syllable_machine;
diff --git a/src/hb-ot-shape-complex-khmer.cc b/src/hb-ot-shape-complex-khmer.cc
index 264515e8..0b5b50a9 100644
--- a/src/hb-ot-shape-complex-khmer.cc
+++ b/src/hb-ot-shape-complex-khmer.cc
@@ -24,8 +24,8 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-ot-shape-complex-khmer-private.hh"
-#include "hb-ot-layout-private.hh"
+#include "hb-ot-shape-complex-khmer.hh"
+#include "hb-ot-layout.hh"
 
 
 /*
diff --git a/src/hb-ot-shape-complex-khmer-private.hh b/src/hb-ot-shape-complex-khmer.hh
similarity index 93%
rename from src/hb-ot-shape-complex-khmer-private.hh
rename to src/hb-ot-shape-complex-khmer.hh
index f90ef967..3371c130 100644
--- a/src/hb-ot-shape-complex-khmer-private.hh
+++ b/src/hb-ot-shape-complex-khmer.hh
@@ -24,12 +24,12 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_OT_SHAPE_COMPLEX_KHMER_PRIVATE_HH
-#define HB_OT_SHAPE_COMPLEX_KHMER_PRIVATE_HH
+#ifndef HB_OT_SHAPE_COMPLEX_KHMER_HH
+#define HB_OT_SHAPE_COMPLEX_KHMER_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
-#include "hb-ot-shape-complex-indic-private.hh"
+#include "hb-ot-shape-complex-indic.hh"
 
 
 /* buffer var allocations */
@@ -121,4 +121,4 @@ set_khmer_properties (hb_glyph_info_t &info)
 }
 
 
-#endif /* HB_OT_SHAPE_COMPLEX_KHMER_PRIVATE_HH */
+#endif /* HB_OT_SHAPE_COMPLEX_KHMER_HH */
diff --git a/src/hb-ot-shape-complex-myanmar-machine.hh b/src/hb-ot-shape-complex-myanmar-machine.hh
index fb67dd42..7fa23517 100644
--- a/src/hb-ot-shape-complex-myanmar-machine.hh
+++ b/src/hb-ot-shape-complex-myanmar-machine.hh
@@ -29,7 +29,7 @@
 #ifndef HB_OT_SHAPE_COMPLEX_MYANMAR_MACHINE_HH
 #define HB_OT_SHAPE_COMPLEX_MYANMAR_MACHINE_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 
 #line 36 "hb-ot-shape-complex-myanmar-machine.hh"
diff --git a/src/hb-ot-shape-complex-myanmar-machine.rl b/src/hb-ot-shape-complex-myanmar-machine.rl
index 0cd84fa1..62f51d1e 100644
--- a/src/hb-ot-shape-complex-myanmar-machine.rl
+++ b/src/hb-ot-shape-complex-myanmar-machine.rl
@@ -27,7 +27,7 @@
 #ifndef HB_OT_SHAPE_COMPLEX_MYANMAR_MACHINE_HH
 #define HB_OT_SHAPE_COMPLEX_MYANMAR_MACHINE_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 %%{
   machine myanmar_syllable_machine;
diff --git a/src/hb-ot-shape-complex-myanmar.cc b/src/hb-ot-shape-complex-myanmar.cc
index e4214b87..8466f812 100644
--- a/src/hb-ot-shape-complex-myanmar.cc
+++ b/src/hb-ot-shape-complex-myanmar.cc
@@ -24,7 +24,7 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-ot-shape-complex-myanmar-private.hh"
+#include "hb-ot-shape-complex-myanmar.hh"
 
 
 /*
diff --git a/src/hb-ot-shape-complex-myanmar-private.hh b/src/hb-ot-shape-complex-myanmar.hh
similarity index 95%
rename from src/hb-ot-shape-complex-myanmar-private.hh
rename to src/hb-ot-shape-complex-myanmar.hh
index 14d011d6..7b6fd483 100644
--- a/src/hb-ot-shape-complex-myanmar-private.hh
+++ b/src/hb-ot-shape-complex-myanmar.hh
@@ -24,12 +24,12 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_OT_SHAPE_COMPLEX_MYANMAR_PRIVATE_HH
-#define HB_OT_SHAPE_COMPLEX_MYANMAR_PRIVATE_HH
+#ifndef HB_OT_SHAPE_COMPLEX_MYANMAR_HH
+#define HB_OT_SHAPE_COMPLEX_MYANMAR_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
-#include "hb-ot-shape-complex-indic-private.hh"
+#include "hb-ot-shape-complex-indic.hh"
 
 
 /* buffer var allocations */
@@ -168,4 +168,4 @@ set_myanmar_properties (hb_glyph_info_t &info)
 }
 
 
-#endif /* HB_OT_SHAPE_COMPLEX_MYANMAR_PRIVATE_HH */
+#endif /* HB_OT_SHAPE_COMPLEX_MYANMAR_HH */
diff --git a/src/hb-ot-shape-complex-thai.cc b/src/hb-ot-shape-complex-thai.cc
index 02d78ac0..1d18760e 100644
--- a/src/hb-ot-shape-complex-thai.cc
+++ b/src/hb-ot-shape-complex-thai.cc
@@ -24,7 +24,7 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-ot-shape-complex-private.hh"
+#include "hb-ot-shape-complex.hh"
 
 
 /* Thai / Lao shaper */
diff --git a/src/hb-ot-shape-complex-tibetan.cc b/src/hb-ot-shape-complex-tibetan.cc
index eaac0bf6..9982ebc2 100644
--- a/src/hb-ot-shape-complex-tibetan.cc
+++ b/src/hb-ot-shape-complex-tibetan.cc
@@ -24,7 +24,7 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-ot-shape-complex-private.hh"
+#include "hb-ot-shape-complex.hh"
 
 
 static const hb_tag_t tibetan_features[] =
diff --git a/src/hb-ot-shape-complex-use-machine.hh b/src/hb-ot-shape-complex-use-machine.hh
index 0ec805af..77ca3aeb 100644
--- a/src/hb-ot-shape-complex-use-machine.hh
+++ b/src/hb-ot-shape-complex-use-machine.hh
@@ -31,7 +31,7 @@
 #ifndef HB_OT_SHAPE_COMPLEX_USE_MACHINE_HH
 #define HB_OT_SHAPE_COMPLEX_USE_MACHINE_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 
 #line 38 "hb-ot-shape-complex-use-machine.hh"
diff --git a/src/hb-ot-shape-complex-use-machine.rl b/src/hb-ot-shape-complex-use-machine.rl
index 7ec8a7fd..a233b120 100644
--- a/src/hb-ot-shape-complex-use-machine.rl
+++ b/src/hb-ot-shape-complex-use-machine.rl
@@ -29,7 +29,7 @@
 #ifndef HB_OT_SHAPE_COMPLEX_USE_MACHINE_HH
 #define HB_OT_SHAPE_COMPLEX_USE_MACHINE_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 %%{
   machine use_syllable_machine;
diff --git a/src/hb-ot-shape-complex-use-table.cc b/src/hb-ot-shape-complex-use-table.cc
index 9c796f05..4862b7fe 100644
--- a/src/hb-ot-shape-complex-use-table.cc
+++ b/src/hb-ot-shape-complex-use-table.cc
@@ -15,7 +15,7 @@
  * UnicodeData.txt does not have a header.
  */
 
-#include "hb-ot-shape-complex-use-private.hh"
+#include "hb-ot-shape-complex-use.hh"
 
 #define B	USE_B	/* BASE */
 #define CGJ	USE_CGJ	/* CGJ */
diff --git a/src/hb-ot-shape-complex-use.cc b/src/hb-ot-shape-complex-use.cc
index f8e86c9d..676b15b6 100644
--- a/src/hb-ot-shape-complex-use.cc
+++ b/src/hb-ot-shape-complex-use.cc
@@ -26,8 +26,8 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-ot-shape-complex-use-private.hh"
-#include "hb-ot-shape-complex-arabic-private.hh"
+#include "hb-ot-shape-complex-use.hh"
+#include "hb-ot-shape-complex-arabic.hh"
 
 /* buffer var allocations */
 #define use_category() complex_var_u8_0()
diff --git a/src/hb-ot-shape-complex-use-private.hh b/src/hb-ot-shape-complex-use.hh
similarity index 94%
rename from src/hb-ot-shape-complex-use-private.hh
rename to src/hb-ot-shape-complex-use.hh
index b4bda8bb..b8123e79 100644
--- a/src/hb-ot-shape-complex-use-private.hh
+++ b/src/hb-ot-shape-complex-use.hh
@@ -26,13 +26,13 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_OT_SHAPE_COMPLEX_USE_PRIVATE_HH
-#define HB_OT_SHAPE_COMPLEX_USE_PRIVATE_HH
+#ifndef HB_OT_SHAPE_COMPLEX_USE_HH
+#define HB_OT_SHAPE_COMPLEX_USE_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 
-#include "hb-ot-shape-complex-private.hh"
+#include "hb-ot-shape-complex.hh"
 
 
 #define USE_TABLE_ELEMENT_TYPE uint8_t
@@ -94,4 +94,4 @@ enum use_category_t {
 HB_INTERNAL USE_TABLE_ELEMENT_TYPE
 hb_use_get_category (hb_codepoint_t u);
 
-#endif /* HB_OT_SHAPE_COMPLEX_USE_PRIVATE_HH */
+#endif /* HB_OT_SHAPE_COMPLEX_USE_HH */
diff --git a/src/hb-ot-shape-complex-private.hh b/src/hb-ot-shape-complex.hh
similarity index 98%
rename from src/hb-ot-shape-complex-private.hh
rename to src/hb-ot-shape-complex.hh
index 37a4d918..a48a38a2 100644
--- a/src/hb-ot-shape-complex-private.hh
+++ b/src/hb-ot-shape-complex.hh
@@ -24,13 +24,13 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_OT_SHAPE_COMPLEX_PRIVATE_HH
-#define HB_OT_SHAPE_COMPLEX_PRIVATE_HH
+#ifndef HB_OT_SHAPE_COMPLEX_HH
+#define HB_OT_SHAPE_COMPLEX_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
-#include "hb-ot-shape-private.hh"
-#include "hb-ot-shape-normalize-private.hh"
+#include "hb-ot-shape.hh"
+#include "hb-ot-shape-normalize.hh"
 
 
 
@@ -390,4 +390,4 @@ hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner)
 }
 
 
-#endif /* HB_OT_SHAPE_COMPLEX_PRIVATE_HH */
+#endif /* HB_OT_SHAPE_COMPLEX_HH */
diff --git a/src/hb-ot-shape-fallback.cc b/src/hb-ot-shape-fallback.cc
index fbf31ab2..5f43023b 100644
--- a/src/hb-ot-shape-fallback.cc
+++ b/src/hb-ot-shape-fallback.cc
@@ -24,8 +24,8 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-ot-shape-fallback-private.hh"
-#include "hb-ot-layout-gsubgpos-private.hh"
+#include "hb-ot-shape-fallback.hh"
+#include "hb-ot-layout-gsubgpos.hh"
 
 static unsigned int
 recategorize_combining_class (hb_codepoint_t u,
diff --git a/src/hb-ot-shape-fallback-private.hh b/src/hb-ot-shape-fallback.hh
similarity index 90%
rename from src/hb-ot-shape-fallback-private.hh
rename to src/hb-ot-shape-fallback.hh
index e134224d..730e7f28 100644
--- a/src/hb-ot-shape-fallback-private.hh
+++ b/src/hb-ot-shape-fallback.hh
@@ -24,12 +24,12 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_OT_SHAPE_FALLBACK_PRIVATE_HH
-#define HB_OT_SHAPE_FALLBACK_PRIVATE_HH
+#ifndef HB_OT_SHAPE_FALLBACK_HH
+#define HB_OT_SHAPE_FALLBACK_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
-#include "hb-ot-shape-private.hh"
+#include "hb-ot-shape.hh"
 
 
 HB_INTERNAL void _hb_ot_shape_fallback_position (const hb_ot_shape_plan_t *plan,
@@ -50,4 +50,4 @@ HB_INTERNAL void _hb_ot_shape_fallback_spaces (const hb_ot_shape_plan_t *plan,
 					       hb_buffer_t  *buffer);
 
 
-#endif /* HB_OT_SHAPE_FALLBACK_PRIVATE_HH */
+#endif /* HB_OT_SHAPE_FALLBACK_HH */
diff --git a/src/hb-ot-shape-normalize.cc b/src/hb-ot-shape-normalize.cc
index 358450ee..fd0b63ae 100644
--- a/src/hb-ot-shape-normalize.cc
+++ b/src/hb-ot-shape-normalize.cc
@@ -24,9 +24,9 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-ot-shape-normalize-private.hh"
-#include "hb-ot-shape-complex-private.hh"
-#include "hb-ot-shape-private.hh"
+#include "hb-ot-shape-normalize.hh"
+#include "hb-ot-shape-complex.hh"
+#include "hb-ot-shape.hh"
 
 
 /*
diff --git a/src/hb-ot-shape-normalize-private.hh b/src/hb-ot-shape-normalize.hh
similarity index 93%
rename from src/hb-ot-shape-normalize-private.hh
rename to src/hb-ot-shape-normalize.hh
index c744e264..4aea640b 100644
--- a/src/hb-ot-shape-normalize-private.hh
+++ b/src/hb-ot-shape-normalize.hh
@@ -24,10 +24,10 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_OT_SHAPE_NORMALIZE_PRIVATE_HH
-#define HB_OT_SHAPE_NORMALIZE_PRIVATE_HH
+#ifndef HB_OT_SHAPE_NORMALIZE_HH
+#define HB_OT_SHAPE_NORMALIZE_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 
 /* buffer var allocations, used during the normalization process */
@@ -66,4 +66,4 @@ struct hb_ot_shape_normalize_context_t
 };
 
 
-#endif /* HB_OT_SHAPE_NORMALIZE_PRIVATE_HH */
+#endif /* HB_OT_SHAPE_NORMALIZE_HH */
diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc
index 91ac28fd..e571bd8a 100644
--- a/src/hb-ot-shape.cc
+++ b/src/hb-ot-shape.cc
@@ -28,19 +28,19 @@
 
 #define HB_SHAPER ot
 #define hb_ot_shape_plan_data_t hb_ot_shape_plan_t
-#include "hb-shaper-impl-private.hh"
+#include "hb-shaper-impl.hh"
 
-#include "hb-ot-shape-private.hh"
-#include "hb-ot-shape-complex-private.hh"
-#include "hb-ot-shape-fallback-private.hh"
-#include "hb-ot-shape-normalize-private.hh"
+#include "hb-ot-shape.hh"
+#include "hb-ot-shape-complex.hh"
+#include "hb-ot-shape-fallback.hh"
+#include "hb-ot-shape-normalize.hh"
 
-#include "hb-ot-layout-private.hh"
-#include "hb-unicode-private.hh"
-#include "hb-set-private.hh"
+#include "hb-ot-layout.hh"
+#include "hb-unicode.hh"
+#include "hb-set.hh"
 
-#include "hb-ot-layout-gsubgpos-private.hh"
-#include "hb-aat-layout-private.hh"
+#include "hb-ot-layout-gsubgpos.hh"
+#include "hb-aat-layout.hh"
 
 static hb_tag_t common_features[] = {
   HB_TAG('c','c','m','p'),
diff --git a/src/hb-ot-shape-private.hh b/src/hb-ot-shape.hh
similarity index 94%
rename from src/hb-ot-shape-private.hh
rename to src/hb-ot-shape.hh
index d6898263..b3a490a3 100644
--- a/src/hb-ot-shape-private.hh
+++ b/src/hb-ot-shape.hh
@@ -24,13 +24,13 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_OT_SHAPE_PRIVATE_HH
-#define HB_OT_SHAPE_PRIVATE_HH
+#ifndef HB_OT_SHAPE_HH
+#define HB_OT_SHAPE_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
-#include "hb-ot-map-private.hh"
-#include "hb-ot-layout-private.hh"
+#include "hb-ot-map.hh"
+#include "hb-ot-layout.hh"
 
 
 
@@ -109,4 +109,4 @@ struct hb_ot_shape_planner_t
 };
 
 
-#endif /* HB_OT_SHAPE_PRIVATE_HH */
+#endif /* HB_OT_SHAPE_HH */
diff --git a/src/hb-ot-tag.cc b/src/hb-ot-tag.cc
index 991d8e77..283723e2 100644
--- a/src/hb-ot-tag.cc
+++ b/src/hb-ot-tag.cc
@@ -26,7 +26,7 @@
  * Google Author(s): Behdad Esfahbod, Roozbeh Pournader
  */
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 
 /* hb_script_t */
diff --git a/src/hb-ot-var-avar-table.hh b/src/hb-ot-var-avar-table.hh
index ad063d32..8343018b 100644
--- a/src/hb-ot-var-avar-table.hh
+++ b/src/hb-ot-var-avar-table.hh
@@ -27,7 +27,7 @@
 #ifndef HB_OT_VAR_AVAR_TABLE_HH
 #define HB_OT_VAR_AVAR_TABLE_HH
 
-#include "hb-open-type-private.hh"
+#include "hb-open-type.hh"
 
 /*
  * avar -- Axis Variations
diff --git a/src/hb-ot-var-fvar-table.hh b/src/hb-ot-var-fvar-table.hh
index 101476ed..afd29046 100644
--- a/src/hb-ot-var-fvar-table.hh
+++ b/src/hb-ot-var-fvar-table.hh
@@ -27,7 +27,7 @@
 #ifndef HB_OT_VAR_FVAR_TABLE_HH
 #define HB_OT_VAR_FVAR_TABLE_HH
 
-#include "hb-open-type-private.hh"
+#include "hb-open-type.hh"
 
 /*
  * fvar -- Font Variations
diff --git a/src/hb-ot-var-hvar-table.hh b/src/hb-ot-var-hvar-table.hh
index 2b384db7..086e922f 100644
--- a/src/hb-ot-var-hvar-table.hh
+++ b/src/hb-ot-var-hvar-table.hh
@@ -27,7 +27,7 @@
 #ifndef HB_OT_VAR_HVAR_TABLE_HH
 #define HB_OT_VAR_HVAR_TABLE_HH
 
-#include "hb-ot-layout-common-private.hh"
+#include "hb-ot-layout-common.hh"
 
 
 namespace OT {
diff --git a/src/hb-ot-var-mvar-table.hh b/src/hb-ot-var-mvar-table.hh
index dfde782f..20dd2200 100644
--- a/src/hb-ot-var-mvar-table.hh
+++ b/src/hb-ot-var-mvar-table.hh
@@ -27,7 +27,7 @@
 #ifndef HB_OT_VAR_MVAR_TABLE_HH
 #define HB_OT_VAR_MVAR_TABLE_HH
 
-#include "hb-ot-layout-common-private.hh"
+#include "hb-ot-layout-common.hh"
 
 
 namespace OT {
diff --git a/src/hb-ot-var.cc b/src/hb-ot-var.cc
index 5b890a3b..5d49ac14 100644
--- a/src/hb-ot-var.cc
+++ b/src/hb-ot-var.cc
@@ -24,9 +24,9 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-open-type-private.hh"
+#include "hb-open-type.hh"
 
-#include "hb-ot-layout-private.hh"
+#include "hb-ot-layout.hh"
 #include "hb-ot-var-avar-table.hh"
 #include "hb-ot-var-fvar-table.hh"
 #include "hb-ot-var-mvar-table.hh"
diff --git a/src/hb-set-digest-private.hh b/src/hb-set-digest.hh
similarity index 97%
rename from src/hb-set-digest-private.hh
rename to src/hb-set-digest.hh
index e099a826..4cd7c3ff 100644
--- a/src/hb-set-digest-private.hh
+++ b/src/hb-set-digest.hh
@@ -24,10 +24,10 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_SET_DIGEST_PRIVATE_HH
-#define HB_SET_DIGEST_PRIVATE_HH
+#ifndef HB_SET_DIGEST_HH
+#define HB_SET_DIGEST_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 /*
  * The set digests here implement various "filters" that support
@@ -176,4 +176,4 @@ typedef hb_set_digest_combiner_t
 > hb_set_digest_t;
 
 
-#endif /* HB_SET_DIGEST_PRIVATE_HH */
+#endif /* HB_SET_DIGEST_HH */
diff --git a/src/hb-set.cc b/src/hb-set.cc
index 25027e6c..09dc4b48 100644
--- a/src/hb-set.cc
+++ b/src/hb-set.cc
@@ -24,7 +24,7 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-set-private.hh"
+#include "hb-set.hh"
 
 
 /* Public API */
diff --git a/src/hb-set-private.hh b/src/hb-set.hh
similarity index 99%
rename from src/hb-set-private.hh
rename to src/hb-set.hh
index 032ddb1e..a179ad13 100644
--- a/src/hb-set-private.hh
+++ b/src/hb-set.hh
@@ -24,10 +24,10 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_SET_PRIVATE_HH
-#define HB_SET_PRIVATE_HH
+#ifndef HB_SET_HH
+#define HB_SET_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 
 /*
@@ -697,4 +697,4 @@ struct hb_set_t
 };
 
 
-#endif /* HB_SET_PRIVATE_HH */
+#endif /* HB_SET_HH */
diff --git a/src/hb-shape-plan.cc b/src/hb-shape-plan.cc
index 0d61d9e1..b0cf1e92 100644
--- a/src/hb-shape-plan.cc
+++ b/src/hb-shape-plan.cc
@@ -24,11 +24,11 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-private.hh"
-#include "hb-shape-plan-private.hh"
-#include "hb-shaper-private.hh"
-#include "hb-font-private.hh"
-#include "hb-buffer-private.hh"
+#include "hb.hh"
+#include "hb-shape-plan.hh"
+#include "hb-shaper.hh"
+#include "hb-font.hh"
+#include "hb-buffer.hh"
 
 
 static void
diff --git a/src/hb-shape-plan-private.hh b/src/hb-shape-plan.hh
similarity index 92%
rename from src/hb-shape-plan-private.hh
rename to src/hb-shape-plan.hh
index 7d020ff1..bf82b912 100644
--- a/src/hb-shape-plan-private.hh
+++ b/src/hb-shape-plan.hh
@@ -24,11 +24,11 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_SHAPE_PLAN_PRIVATE_HH
-#define HB_SHAPE_PLAN_PRIVATE_HH
+#ifndef HB_SHAPE_PLAN_HH
+#define HB_SHAPE_PLAN_HH
 
-#include "hb-private.hh"
-#include "hb-shaper-private.hh"
+#include "hb.hh"
+#include "hb-shaper.hh"
 
 
 struct hb_shape_plan_t
@@ -64,4 +64,4 @@ DECLARE_NULL_INSTANCE (hb_shape_plan_t);
 #undef HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS
 
 
-#endif /* HB_SHAPE_PLAN_PRIVATE_HH */
+#endif /* HB_SHAPE_PLAN_HH */
diff --git a/src/hb-shape.cc b/src/hb-shape.cc
index d3e2692f..e8eeff5b 100644
--- a/src/hb-shape.cc
+++ b/src/hb-shape.cc
@@ -26,13 +26,13 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-private.hh"
+#include "hb.hh"
 
-#include "hb-shaper-private.hh"
-#include "hb-shape-plan-private.hh"
-#include "hb-buffer-private.hh"
-#include "hb-font-private.hh"
-#include "hb-machinery-private.hh"
+#include "hb-shaper.hh"
+#include "hb-shape-plan.hh"
+#include "hb-buffer.hh"
+#include "hb-font.hh"
+#include "hb-machinery.hh"
 
 /**
  * SECTION:hb-shape
diff --git a/src/hb-shaper-impl-private.hh b/src/hb-shaper-impl.hh
similarity index 82%
rename from src/hb-shaper-impl-private.hh
rename to src/hb-shaper-impl.hh
index 4a10279c..d40cb085 100644
--- a/src/hb-shaper-impl-private.hh
+++ b/src/hb-shaper-impl.hh
@@ -24,15 +24,15 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_SHAPER_IMPL_PRIVATE_HH
-#define HB_SHAPER_IMPL_PRIVATE_HH
+#ifndef HB_SHAPER_IMPL_HH
+#define HB_SHAPER_IMPL_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
-#include "hb-shaper-private.hh"
-#include "hb-shape-plan-private.hh"
-#include "hb-font-private.hh"
-#include "hb-buffer-private.hh"
+#include "hb-shaper.hh"
+#include "hb-shape-plan.hh"
+#include "hb-font.hh"
+#include "hb-buffer.hh"
 
 
 #ifdef HB_SHAPER
@@ -40,4 +40,4 @@
 #endif
 
 
-#endif /* HB_SHAPER_IMPL_PRIVATE_HH */
+#endif /* HB_SHAPER_IMPL_HH */
diff --git a/src/hb-shaper.cc b/src/hb-shaper.cc
index 660dfb2b..52418c08 100644
--- a/src/hb-shaper.cc
+++ b/src/hb-shaper.cc
@@ -24,9 +24,9 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-private.hh"
-#include "hb-shaper-private.hh"
-#include "hb-machinery-private.hh"
+#include "hb.hh"
+#include "hb-shaper.hh"
+#include "hb-machinery.hh"
 
 
 static const hb_shaper_pair_t all_shapers[] = {
diff --git a/src/hb-shaper-private.hh b/src/hb-shaper.hh
similarity index 97%
rename from src/hb-shaper-private.hh
rename to src/hb-shaper.hh
index fb04bbc3..361165e4 100644
--- a/src/hb-shaper-private.hh
+++ b/src/hb-shaper.hh
@@ -24,10 +24,10 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_SHAPER_PRIVATE_HH
-#define HB_SHAPER_PRIVATE_HH
+#ifndef HB_SHAPER_HH
+#define HB_SHAPER_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 typedef hb_bool_t hb_shape_func_t (hb_shape_plan_t    *shape_plan,
 				   hb_font_t          *font,
@@ -131,4 +131,4 @@ struct hb_shaper_data_t {
 #define HB_SHAPERS_COUNT (sizeof (hb_shaper_data_t) / sizeof (void *))
 
 
-#endif /* HB_SHAPER_PRIVATE_HH */
+#endif /* HB_SHAPER_HH */
diff --git a/src/hb-static.cc b/src/hb-static.cc
index ddecbba1..5112d77b 100644
--- a/src/hb-static.cc
+++ b/src/hb-static.cc
@@ -24,12 +24,12 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-private.hh"
+#include "hb.hh"
 
-#include "hb-open-type-private.hh"
-#include "hb-ot-layout-common-private.hh"
+#include "hb-open-type.hh"
+#include "hb-ot-layout-common.hh"
 
-#include "hb-face-private.hh"
+#include "hb-face.hh"
 #include "hb-ot-head-table.hh"
 #include "hb-ot-maxp-table.hh"
 
diff --git a/src/hb-string-array.hh b/src/hb-string-array.hh
index 679841c8..c4cf666d 100644
--- a/src/hb-string-array.hh
+++ b/src/hb-string-array.hh
@@ -29,7 +29,7 @@
 #define HB_STRING_ARRAY_HH
 #endif
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 /* Based on Bruno Haible's code in Appendix B of Ulrich Drepper's dsohowto.pdf:
  * https://software.intel.com/sites/default/files/m/a/1/e/dsohowto.pdf */
diff --git a/src/hb-subset-glyf.cc b/src/hb-subset-glyf.cc
index 36af3bea..e335912f 100644
--- a/src/hb-subset-glyf.cc
+++ b/src/hb-subset-glyf.cc
@@ -24,7 +24,7 @@
  * Google Author(s): Garret Rieger, Roderick Sheeter
  */
 
-#include "hb-open-type-private.hh"
+#include "hb-open-type.hh"
 #include "hb-ot-glyf-table.hh"
 #include "hb-set.h"
 #include "hb-subset-glyf.hh"
diff --git a/src/hb-subset-glyf.hh b/src/hb-subset-glyf.hh
index 99b76db9..c564206b 100644
--- a/src/hb-subset-glyf.hh
+++ b/src/hb-subset-glyf.hh
@@ -27,7 +27,7 @@
 #ifndef HB_SUBSET_GLYF_HH
 #define HB_SUBSET_GLYF_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 #include "hb-subset-plan.hh"
 
diff --git a/src/hb-subset-input.cc b/src/hb-subset-input.cc
index 74470fd1..d68550d7 100644
--- a/src/hb-subset-input.cc
+++ b/src/hb-subset-input.cc
@@ -24,8 +24,8 @@
  * Google Author(s): Garret Rieger, Rod Sheeter, Behdad Esfahbod
  */
 
-#include "hb-subset-private.hh"
-#include "hb-set-private.hh"
+#include "hb-subset.hh"
+#include "hb-set.hh"
 
 /**
  * hb_subset_input_create_or_fail:
diff --git a/src/hb-subset-plan.cc b/src/hb-subset-plan.cc
index 6e556c20..1f643dc0 100644
--- a/src/hb-subset-plan.cc
+++ b/src/hb-subset-plan.cc
@@ -24,9 +24,9 @@
  * Google Author(s): Garret Rieger, Roderick Sheeter
  */
 
-#include "hb-map-private.hh"
-#include "hb-subset-private.hh"
-#include "hb-set-private.hh"
+#include "hb-map.hh"
+#include "hb-subset.hh"
+#include "hb-set.hh"
 
 #include "hb-subset-plan.hh"
 #include "hb-ot-cmap-table.hh"
diff --git a/src/hb-subset-plan.hh b/src/hb-subset-plan.hh
index b7f14d2e..0f44f4b2 100644
--- a/src/hb-subset-plan.hh
+++ b/src/hb-subset-plan.hh
@@ -27,12 +27,12 @@
 #ifndef HB_SUBSET_PLAN_HH
 #define HB_SUBSET_PLAN_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 #include "hb-subset.h"
-#include "hb-subset-private.hh"
+#include "hb-subset.hh"
 
-#include "hb-map-private.hh"
+#include "hb-map.hh"
 
 struct hb_subset_plan_t
 {
diff --git a/src/hb-subset.cc b/src/hb-subset.cc
index 319987ce..ad8a1106 100644
--- a/src/hb-subset.cc
+++ b/src/hb-subset.cc
@@ -24,14 +24,14 @@
  * Google Author(s): Garret Rieger, Rod Sheeter, Behdad Esfahbod
  */
 
-#include "hb-private.hh"
-#include "hb-open-type-private.hh"
+#include "hb.hh"
+#include "hb-open-type.hh"
 
 #include "hb-subset-glyf.hh"
-#include "hb-subset-private.hh"
+#include "hb-subset.hh"
 #include "hb-subset-plan.hh"
 
-#include "hb-open-file-private.hh"
+#include "hb-open-file.hh"
 #include "hb-ot-cmap-table.hh"
 #include "hb-ot-glyf-table.hh"
 #include "hb-ot-hdmx-table.hh"
diff --git a/src/hb-subset-private.hh b/src/hb-subset.hh
similarity index 90%
rename from src/hb-subset-private.hh
rename to src/hb-subset.hh
index 42c93d7d..e2993cda 100644
--- a/src/hb-subset-private.hh
+++ b/src/hb-subset.hh
@@ -24,15 +24,15 @@
  * Google Author(s): Garret Rieger, Roderick Sheeter
  */
 
-#ifndef HB_SUBSET_PRIVATE_HH
-#define HB_SUBSET_PRIVATE_HH
+#ifndef HB_SUBSET_HH
+#define HB_SUBSET_HH
 
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 #include "hb-subset.h"
 
-#include "hb-font-private.hh"
+#include "hb-font.hh"
 
 struct hb_subset_input_t {
   hb_object_header_t header;
@@ -53,4 +53,4 @@ struct hb_subset_input_t {
 };
 
 
-#endif /* HB_SUBSET_PRIVATE_HH */
+#endif /* HB_SUBSET_HH */
diff --git a/src/hb-ucdn.cc b/src/hb-ucdn.cc
index 56d13e7c..624c1eb4 100644
--- a/src/hb-ucdn.cc
+++ b/src/hb-ucdn.cc
@@ -14,10 +14,10 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-#include "hb-private.hh"
+#include "hb.hh"
 
-#include "hb-unicode-private.hh"
-#include "hb-machinery-private.hh"
+#include "hb-unicode.hh"
+#include "hb-machinery.hh"
 
 #include "ucdn.h"
 
diff --git a/src/hb-unicode.cc b/src/hb-unicode.cc
index 8cb41723..bb1cd682 100644
--- a/src/hb-unicode.cc
+++ b/src/hb-unicode.cc
@@ -28,9 +28,9 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-private.hh"
+#include "hb.hh"
 
-#include "hb-unicode-private.hh"
+#include "hb-unicode.hh"
 
 
 
@@ -450,7 +450,7 @@ hb_unicode_decompose_compatibility (hb_unicode_funcs_t *ufuncs,
 }
 
 
-/* See hb-unicode-private.hh for details. */
+/* See hb-unicode.hh for details. */
 const uint8_t
 _hb_modified_combining_class[256] =
 {
diff --git a/src/hb-unicode-private.hh b/src/hb-unicode.hh
similarity index 99%
rename from src/hb-unicode-private.hh
rename to src/hb-unicode.hh
index fb16ba43..e6bca5f0 100644
--- a/src/hb-unicode-private.hh
+++ b/src/hb-unicode.hh
@@ -28,10 +28,10 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_UNICODE_PRIVATE_HH
-#define HB_UNICODE_PRIVATE_HH
+#ifndef HB_UNICODE_HH
+#define HB_UNICODE_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 
 extern HB_INTERNAL const uint8_t _hb_modified_combining_class[256];
@@ -366,4 +366,4 @@ DECLARE_NULL_INSTANCE (hb_unicode_funcs_t);
 	  FLAG (HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK) | \
 	  FLAG (HB_UNICODE_GENERAL_CATEGORY_MODIFIER_SYMBOL)))
 
-#endif /* HB_UNICODE_PRIVATE_HH */
+#endif /* HB_UNICODE_HH */
diff --git a/src/hb-uniscribe.cc b/src/hb-uniscribe.cc
index 11b7384f..4a77c8c1 100644
--- a/src/hb-uniscribe.cc
+++ b/src/hb-uniscribe.cc
@@ -24,9 +24,9 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-private.hh"
+#include "hb.hh"
 #define HB_SHAPER uniscribe
-#include "hb-shaper-impl-private.hh"
+#include "hb-shaper-impl.hh"
 
 #include <windows.h>
 #include <usp10.h>
@@ -34,7 +34,7 @@
 
 #include "hb-uniscribe.h"
 
-#include "hb-open-file-private.hh"
+#include "hb-open-file.hh"
 #include "hb-ot-name-table.hh"
 #include "hb-ot-tag.h"
 
diff --git a/src/hb-utf-private.hh b/src/hb-utf.hh
similarity index 98%
rename from src/hb-utf-private.hh
rename to src/hb-utf.hh
index 211eb4dc..eccb632e 100644
--- a/src/hb-utf-private.hh
+++ b/src/hb-utf.hh
@@ -24,10 +24,10 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_UTF_PRIVATE_HH
-#define HB_UTF_PRIVATE_HH
+#ifndef HB_UTF_HH
+#define HB_UTF_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 
 struct hb_utf8_t
@@ -279,4 +279,4 @@ struct hb_latin1_t
   }
 };
 
-#endif /* HB_UTF_PRIVATE_HH */
+#endif /* HB_UTF_HH */
diff --git a/src/hb-vector-private.hh b/src/hb-vector.hh
similarity index 97%
rename from src/hb-vector-private.hh
rename to src/hb-vector.hh
index 1ef20d43..31341747 100644
--- a/src/hb-vector-private.hh
+++ b/src/hb-vector.hh
@@ -25,10 +25,10 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_VECTOR_PRIVATE_HH
-#define HB_VECTOR_PRIVATE_HH
+#ifndef HB_VECTOR_HH
+#define HB_VECTOR_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 
 template <typename Type, unsigned int StaticSize=8>
@@ -235,4 +235,4 @@ struct hb_vector_t
 };
 
 
-#endif /* HB_VECTOR_PRIVATE_HH */
+#endif /* HB_VECTOR_HH */
diff --git a/src/hb-warning.cc b/src/hb-warning.cc
index f7a87b5a..9fb41003 100644
--- a/src/hb-warning.cc
+++ b/src/hb-warning.cc
@@ -24,14 +24,14 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 #if defined(HB_ATOMIC_INT_NIL)
 #error "Could not find any system to define atomic_int macros, library WILL NOT be thread-safe"
-#error "Check hb-atomic-private.hh for possible resolutions."
+#error "Check hb-atomic.hh for possible resolutions."
 #endif
 
 #if defined(HB_MUTEX_IMPL_NIL)
 #error "Could not find any system to define mutex macros, library WILL NOT be thread-safe"
-#error "Check hb-mutex-private.hh for possible resolutions."
+#error "Check hb-mutex.hh for possible resolutions."
 #endif
diff --git a/src/hb-private.hh b/src/hb.hh
similarity index 98%
rename from src/hb-private.hh
rename to src/hb.hh
index efe7bda9..557ae6b3 100644
--- a/src/hb-private.hh
+++ b/src/hb.hh
@@ -26,8 +26,8 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_PRIVATE_HH
-#define HB_PRIVATE_HH
+#ifndef HB_HH
+#define HB_HH
 
 #define _GNU_SOURCE 1
 
@@ -470,11 +470,11 @@ _hb_memalign(void **memptr, size_t alignment, size_t size)
 
 /* Headers we include for everyone.  Keep sorted.  They express dependency amongst
  * themselves, but no other file should include them.*/
-#include "hb-atomic-private.hh"
+#include "hb-atomic.hh"
 #include "hb-debug.hh"
 #include "hb-dsalgs.hh"
-#include "hb-mutex-private.hh"
+#include "hb-mutex.hh"
 #include "hb-null.hh"
-#include "hb-object-private.hh"
+#include "hb-object.hh"
 
-#endif /* HB_PRIVATE_HH */
+#endif /* HB_HH */
diff --git a/src/main.cc b/src/main.cc
index 98a1320b..490b76e5 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -25,9 +25,9 @@
  */
 
 #include "hb-static.cc"
-#include "hb-open-file-private.hh"
+#include "hb-open-file.hh"
 #include "hb-ot-layout-gdef-table.hh"
-#include "hb-ot-layout-gsubgpos-private.hh"
+#include "hb-ot-layout-gsubgpos.hh"
 
 #ifdef HAVE_GLIB
 #include <glib.h>
diff --git a/src/test-buffer-serialize.cc b/src/test-buffer-serialize.cc
index 39eb13da..a91f4f7e 100644
--- a/src/test-buffer-serialize.cc
+++ b/src/test-buffer-serialize.cc
@@ -24,7 +24,7 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 #include "hb.h"
 #include "hb-ot.h"
diff --git a/src/test-size-params.cc b/src/test-size-params.cc
index 3c43852b..e53a47d8 100644
--- a/src/test-size-params.cc
+++ b/src/test-size-params.cc
@@ -24,7 +24,7 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 #include "hb.h"
 #include "hb-ot.h"
diff --git a/src/test-unicode-ranges.cc b/src/test-unicode-ranges.cc
index dbc5fa42..1334ea03 100644
--- a/src/test-unicode-ranges.cc
+++ b/src/test-unicode-ranges.cc
@@ -24,7 +24,7 @@
  * Google Author(s): Garret Rieger
  */
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 #include "hb-ot-os2-unicode-ranges.hh"
 
diff --git a/src/test-would-substitute.cc b/src/test-would-substitute.cc
index 1836d720..268f7db9 100644
--- a/src/test-would-substitute.cc
+++ b/src/test-would-substitute.cc
@@ -24,7 +24,7 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 #include "hb.h"
 #include "hb-ot.h"
diff --git a/src/test.cc b/src/test.cc
index cf59e00a..f0eace8c 100644
--- a/src/test.cc
+++ b/src/test.cc
@@ -24,7 +24,7 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 #include "hb.h"
 
diff --git a/test/api/test-common.c b/test/api/test-common.c
index f6f0d485..e9fae135 100644
--- a/test/api/test-common.c
+++ b/test/api/test-common.c
@@ -32,7 +32,6 @@
 static void
 test_types_int (void)
 {
-  /* We already ASSERT_STATIC these in hb-private.h, but anyway */
   g_assert_cmpint (sizeof (int8_t), ==, 1);
   g_assert_cmpint (sizeof (uint8_t), ==, 1);
   g_assert_cmpint (sizeof (int16_t), ==, 2);
diff --git a/util/Makefile.am b/util/Makefile.am
index d4ab9cdc..b8bf8841 100644
--- a/util/Makefile.am
+++ b/util/Makefile.am
@@ -47,7 +47,9 @@ hb_shape_SOURCES = $(HB_SHAPE_sources)
 bin_PROGRAMS += hb-shape
 
 hb_subset_SOURCES = $(HB_SUBSET_CLI_sources)
-hb_subset_LDADD = $(LDADD) $(top_builddir)/src/libharfbuzz-subset.la
+hb_subset_LDADD = \
+	$(LDADD) \
+	$(top_builddir)/src/libharfbuzz-subset.la
 bin_PROGRAMS += hb-subset
 
 if HAVE_OT
diff --git a/util/ansi-print.hh b/util/ansi-print.hh
index 1ea5b374..9640d892 100644
--- a/util/ansi-print.hh
+++ b/util/ansi-print.hh
@@ -27,8 +27,7 @@
 #ifndef ANSI_PRINT_HH
 #define ANSI_PRINT_HH
 
-#include "hb-private.hh"
-#include <hb.h> /* for int types */
+#include "hb.hh"
 
 void
 ansi_print_image_rgb24 (const uint32_t *data,
diff --git a/util/hb-subset.cc b/util/hb-subset.cc
index 20617554..a15495fa 100644
--- a/util/hb-subset.cc
+++ b/util/hb-subset.cc
@@ -29,7 +29,7 @@
 
 #include "main-font-text.hh"
 #include "hb-subset.h"
-#include "hb-subset-private.hh"
+#include "hb-subset.hh" /* XXX */
 
 /*
  * Command line interface to the harfbuzz font subsetter.
diff --git a/util/helper-cairo-ansi.hh b/util/helper-cairo-ansi.hh
index cf18ea49..bc231321 100644
--- a/util/helper-cairo-ansi.hh
+++ b/util/helper-cairo-ansi.hh
@@ -27,7 +27,7 @@
 #ifndef HELPER_CAIRO_ANSI_HH
 #define HELPER_CAIRO_ANSI_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 #include <cairo.h>
 
diff --git a/util/helper-cairo.hh b/util/helper-cairo.hh
index 50bc0af0..1613ce42 100644
--- a/util/helper-cairo.hh
+++ b/util/helper-cairo.hh
@@ -27,7 +27,7 @@
 #ifndef HELPER_CAIRO_HH
 #define HELPER_CAIRO_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 #include "options.hh"
 
 #include <cairo.h>
diff --git a/util/main-font-text.hh b/util/main-font-text.hh
index 3390371c..01bd2d4d 100644
--- a/util/main-font-text.hh
+++ b/util/main-font-text.hh
@@ -27,7 +27,7 @@
 #ifndef HB_MAIN_FONT_TEXT_HH
 #define HB_MAIN_FONT_TEXT_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 #include "options.hh"
 
 /* main() body for utilities taking font and processing text.*/
diff --git a/util/options.hh b/util/options.hh
index 2160d5ec..34579094 100644
--- a/util/options.hh
+++ b/util/options.hh
@@ -27,7 +27,7 @@
 #ifndef OPTIONS_HH
 #define OPTIONS_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 
 #include <stdlib.h>
 #include <stddef.h>
diff --git a/util/shape-consumer.hh b/util/shape-consumer.hh
index fa419f18..da0d8803 100644
--- a/util/shape-consumer.hh
+++ b/util/shape-consumer.hh
@@ -27,7 +27,7 @@
 #ifndef HB_SHAPE_CONSUMER_HH
 #define HB_SHAPE_CONSUMER_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 #include "options.hh"
 
 
diff --git a/util/view-cairo.hh b/util/view-cairo.hh
index 00df68c2..677f74b3 100644
--- a/util/view-cairo.hh
+++ b/util/view-cairo.hh
@@ -27,7 +27,7 @@
 #ifndef VIEW_CAIRO_HH
 #define VIEW_CAIRO_HH
 
-#include "hb-private.hh"
+#include "hb.hh"
 #include "options.hh"
 #include "helper-cairo.hh"
 
commit 82b12bcadd50c9e86bbe82623a1cbc0b4afdd237
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sat Aug 25 22:07:17 2018 -0700

    [unicode] Add HB_UNICODE_MAX
    
    New API:
    HB_UNICODE_MAX

diff --git a/docs/harfbuzz-sections.txt b/docs/harfbuzz-sections.txt
index f98e8cc1..043611e9 100644
--- a/docs/harfbuzz-sections.txt
+++ b/docs/harfbuzz-sections.txt
@@ -605,6 +605,7 @@ hb_shape_plan_t
 
 <SECTION>
 <FILE>hb-unicode</FILE>
+HB_UNICODE_MAX
 HB_UNICODE_MAX_DECOMPOSITION_LEN
 hb_unicode_combining_class
 hb_unicode_combining_class_func_t
diff --git a/src/hb-ot-cmap-table.hh b/src/hb-ot-cmap-table.hh
index 756b22d4..6ab578c2 100644
--- a/src/hb-ot-cmap-table.hh
+++ b/src/hb-ot-cmap-table.hh
@@ -37,10 +37,6 @@
  */
 #define HB_OT_TAG_cmap HB_TAG('c','m','a','p')
 
-#ifndef HB_MAX_UNICODE_CODEPOINT_VALUE
-#define HB_MAX_UNICODE_CODEPOINT_VALUE 0x10FFFF
-#endif
-
 namespace OT {
 
 
@@ -478,7 +474,7 @@ struct CmapSubtableLongSegmented
     for (unsigned int i = 0; i < this->groups.len; i++) {
       out->add_range (this->groups[i].startCharCode,
 		      MIN ((hb_codepoint_t) this->groups[i].endCharCode,
-			   (hb_codepoint_t) HB_MAX_UNICODE_CODEPOINT_VALUE));
+			   (hb_codepoint_t) HB_UNICODE_MAX));
     }
   }
 
@@ -624,7 +620,7 @@ struct DefaultUVS : SortedArrayOf<UnicodeValueRange, HBUINT32>
     {
       hb_codepoint_t first = arrayZ[i].startUnicodeValue;
       hb_codepoint_t last = MIN ((hb_codepoint_t) (first + arrayZ[i].additionalCount),
-				 (hb_codepoint_t) HB_MAX_UNICODE_CODEPOINT_VALUE);
+				 (hb_codepoint_t) HB_UNICODE_MAX);
       out->add_range (first, last);
     }
   }
diff --git a/src/hb-unicode.h b/src/hb-unicode.h
index 2657f481..226c5d5c 100644
--- a/src/hb-unicode.h
+++ b/src/hb-unicode.h
@@ -40,6 +40,9 @@
 HB_BEGIN_DECLS
 
 
+#define HB_UNICODE_MAX 0x10FFFFu
+
+
 /* hb_unicode_general_category_t */
 
 /* Unicode Character Database property: General_Category (gc) */
commit b09a0336ca856a2b1040e7fabd5819b64749e308
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sat Aug 25 22:04:39 2018 -0700

    [cmap] More hb_auto_t<>(...)

diff --git a/src/hb-subset.cc b/src/hb-subset.cc
index 77d9e81c..319987ce 100644
--- a/src/hb-subset.cc
+++ b/src/hb-subset.cc
@@ -247,10 +247,8 @@ void
 hb_subset_collect_unicodes (hb_face_t *face, hb_set_t *out)
 {
   /* XXX Use saved accel. */
-  OT::cmap::accelerator_t cmap;
-  cmap.init (face);
+  hb_auto_t<OT::cmap::accelerator_t> cmap (face);
   cmap.collect_unicodes (out);
-  cmap.fini();
 }
 
 /**
@@ -267,10 +265,8 @@ hb_subset_collect_variation_selectors (hb_face_t *face,
 				       hb_set_t *out)
 {
   /* XXX Use saved accel. */
-  OT::cmap::accelerator_t cmap;
-  cmap.init (face);
+  hb_auto_t<OT::cmap::accelerator_t> cmap (face);
   cmap.collect_variation_selectors (out);
-  cmap.fini();
 }
 
 /**
@@ -288,9 +284,7 @@ hb_subset_collect_variation_unicodes (hb_face_t *face,
 				      hb_set_t *out)
 {
   /* XXX Use saved accel. */
-  OT::cmap::accelerator_t cmap;
-  cmap.init (face);
+  hb_auto_t<OT::cmap::accelerator_t> cmap (face);
   cmap.collect_variation_unicodes (variation_selector, out);
-  cmap.fini();
 }
 
commit 28634db07e6ecbdb7e59ed8f989212272a97de86
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sat Aug 25 21:23:43 2018 -0700

    [cmap] Fix skipping gid0 in Format4 collect_unicodes()

diff --git a/src/hb-ot-cmap-table.hh b/src/hb-ot-cmap-table.hh
index af814bfb..756b22d4 100644
--- a/src/hb-ot-cmap-table.hh
+++ b/src/hb-ot-cmap-table.hh
@@ -298,8 +298,24 @@ struct CmapSubtableFormat4
         count--; /* Skip sentinel segment. */
       for (unsigned int i = 0; i < count; i++)
       {
-	/* XXX This does NOT skip over chars mapping to gid0... */
-	out->add_range (this->startCount[i], this->endCount[i]);
+	unsigned int rangeOffset = this->idRangeOffset[i];
+	if (rangeOffset == 0)
+	  out->add_range (this->startCount[i], this->endCount[i]);
+	else
+	{
+	  for (hb_codepoint_t codepoint = this->startCount[i];
+	       codepoint <= this->endCount[i];
+	       codepoint++)
+	  {
+	    unsigned int index = rangeOffset / 2 + (codepoint - this->startCount[i]) + i - this->segCount;
+	    if (unlikely (index >= this->glyphIdArrayLength))
+	      break;
+	    hb_codepoint_t gid = this->glyphIdArray[index];
+	    if (unlikely (!gid))
+	      continue;
+	    out->add (codepoint);
+	  }
+	}
       }
     }
 
commit acce1fa3ea9707d0883cd66397fd187d3268905c
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sat Aug 25 21:15:39 2018 -0700

    Use new hb_auto_t<> constructor with Coverage::Iter

diff --git a/src/hb-ot-layout-common-private.hh b/src/hb-ot-layout-common-private.hh
index 89d5eae4..fa41241c 100644
--- a/src/hb-ot-layout-common-private.hh
+++ b/src/hb-ot-layout-common-private.hh
@@ -743,6 +743,7 @@ struct CoverageFormat1
   /* Older compilers need this to be public. */
   struct Iter {
     inline void init (const struct CoverageFormat1 &c_) { c = &c_; i = 0; };
+    inline void fini (void) {};
     inline bool more (void) { return i < c->glyphArray.len; }
     inline void next (void) { i++; }
     inline hb_codepoint_t get_glyph (void) { return c->glyphArray[i]; }
@@ -859,6 +860,7 @@ struct CoverageFormat2
         i = c->rangeRecord.len;
       }
     }
+    inline void fini (void) {};
     inline bool more (void) { return i < c->rangeRecord.len; }
     inline void next (void)
     {
@@ -924,7 +926,8 @@ struct Coverage
       if (glyphs[i - 1] + 1 != glyphs[i])
         num_ranges++;
     u.format.set (num_glyphs * 2 < num_ranges * 3 ? 1 : 2);
-    switch (u.format) {
+    switch (u.format)
+    {
     case 1: return_trace (u.format1.serialize (c, glyphs, num_glyphs));
     case 2: return_trace (u.format2.serialize (c, glyphs, num_glyphs));
     default:return_trace (false);
@@ -935,25 +938,27 @@ struct Coverage
   {
     TRACE_SANITIZE (this);
     if (!u.format.sanitize (c)) return_trace (false);
-    switch (u.format) {
+    switch (u.format)
+    {
     case 1: return_trace (u.format1.sanitize (c));
     case 2: return_trace (u.format2.sanitize (c));
     default:return_trace (true);
     }
   }
 
-  inline bool intersects (const hb_set_t *glyphs) const {
+  inline bool intersects (const hb_set_t *glyphs) const
+  {
     /* TODO speed this up */
-    Coverage::Iter iter;
-    for (iter.init (*this); iter.more (); iter.next ()) {
+    for (hb_auto_t<Coverage::Iter> iter (*this); iter.more (); iter.next ())
       if (glyphs->has (iter.get_glyph ()))
         return true;
-    }
     return false;
   }
 
-  inline bool intersects_coverage (const hb_set_t *glyphs, unsigned int index) const {
-    switch (u.format) {
+  inline bool intersects_coverage (const hb_set_t *glyphs, unsigned int index) const
+  {
+    switch (u.format)
+    {
     case 1: return u.format1.intersects_coverage (glyphs, index);
     case 2: return u.format2.intersects_coverage (glyphs, index);
     default:return false;
@@ -963,47 +968,61 @@ struct Coverage
   /* Might return false if array looks unsorted.
    * Used for faster rejection of corrupt data. */
   template <typename set_t>
-  inline bool add_coverage (set_t *glyphs) const {
-    switch (u.format) {
+  inline bool add_coverage (set_t *glyphs) const
+  {
+    switch (u.format)
+    {
     case 1: return u.format1.add_coverage (glyphs);
     case 2: return u.format2.add_coverage (glyphs);
     default:return false;
     }
   }
 
-  struct Iter {
+  struct Iter
+  {
     Iter (void) : format (0), u () {};
-    inline void init (const Coverage &c_) {
+    inline void init (const Coverage &c_)
+    {
       format = c_.u.format;
-      switch (format) {
+      switch (format)
+      {
       case 1: u.format1.init (c_.u.format1); return;
       case 2: u.format2.init (c_.u.format2); return;
-      default:                               return;
+      default:				     return;
       }
     }
-    inline bool more (void) {
-      switch (format) {
+    inline void fini (void) {}
+    inline bool more (void)
+    {
+      switch (format)
+      {
       case 1: return u.format1.more ();
       case 2: return u.format2.more ();
       default:return false;
       }
     }
-    inline void next (void) {
-      switch (format) {
+    inline void next (void)
+    {
+      switch (format)
+      {
       case 1: u.format1.next (); break;
       case 2: u.format2.next (); break;
-      default:                   break;
+      default:			 break;
       }
     }
-    inline hb_codepoint_t get_glyph (void) {
-      switch (format) {
+    inline hb_codepoint_t get_glyph (void)
+    {
+      switch (format)
+      {
       case 1: return u.format1.get_glyph ();
       case 2: return u.format2.get_glyph ();
       default:return 0;
       }
     }
-    inline unsigned int get_coverage (void) {
-      switch (format) {
+    inline unsigned int get_coverage (void)
+    {
+      switch (format)
+      {
       case 1: return u.format1.get_coverage ();
       case 2: return u.format2.get_coverage ();
       default:return -1;
diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh
index a2f78b8f..eaee7daa 100644
--- a/src/hb-ot-layout-gsub-table.hh
+++ b/src/hb-ot-layout-gsub-table.hh
@@ -40,8 +40,7 @@ struct SingleSubstFormat1
   inline void closure (hb_closure_context_t *c) const
   {
     TRACE_CLOSURE (this);
-    Coverage::Iter iter;
-    for (iter.init (this+coverage); iter.more (); iter.next ())
+    for (hb_auto_t<Coverage::Iter> iter (this+coverage); iter.more (); iter.next ())
     {
       /* TODO Switch to range-based API to work around malicious fonts.
        * https://github.com/harfbuzz/harfbuzz/issues/363 */
@@ -55,8 +54,7 @@ struct SingleSubstFormat1
   {
     TRACE_COLLECT_GLYPHS (this);
     if (unlikely (!(this+coverage).add_coverage (c->input))) return;
-    Coverage::Iter iter;
-    for (iter.init (this+coverage); iter.more (); iter.next ())
+    for (hb_auto_t<Coverage::Iter> iter (this+coverage); iter.more (); iter.next ())
     {
       /* TODO Switch to range-based API to work around malicious fonts.
        * https://github.com/harfbuzz/harfbuzz/issues/363 */
@@ -125,9 +123,8 @@ struct SingleSubstFormat2
   inline void closure (hb_closure_context_t *c) const
   {
     TRACE_CLOSURE (this);
-    Coverage::Iter iter;
     unsigned int count = substitute.len;
-    for (iter.init (this+coverage); iter.more (); iter.next ())
+    for (hb_auto_t<Coverage::Iter> iter (this+coverage); iter.more (); iter.next ())
     {
       if (unlikely (iter.get_coverage () >= count))
         break; /* Work around malicious fonts. https://github.com/harfbuzz/harfbuzz/issues/363 */
@@ -140,9 +137,8 @@ struct SingleSubstFormat2
   {
     TRACE_COLLECT_GLYPHS (this);
     if (unlikely (!(this+coverage).add_coverage (c->input))) return;
-    Coverage::Iter iter;
     unsigned int count = substitute.len;
-    for (iter.init (this+coverage); iter.more (); iter.next ())
+    for (hb_auto_t<Coverage::Iter> iter (this+coverage); iter.more (); iter.next ())
     {
       if (unlikely (iter.get_coverage () >= count))
         break; /* Work around malicious fonts. https://github.com/harfbuzz/harfbuzz/issues/363 */
@@ -332,9 +328,8 @@ struct MultipleSubstFormat1
   inline void closure (hb_closure_context_t *c) const
   {
     TRACE_CLOSURE (this);
-    Coverage::Iter iter;
     unsigned int count = sequence.len;
-    for (iter.init (this+coverage); iter.more (); iter.next ())
+    for (hb_auto_t<Coverage::Iter> iter (this+coverage); iter.more (); iter.next ())
     {
       if (unlikely (iter.get_coverage () >= count))
         break; /* Work around malicious fonts. https://github.com/harfbuzz/harfbuzz/issues/363 */
@@ -454,9 +449,8 @@ struct AlternateSubstFormat1
   inline void closure (hb_closure_context_t *c) const
   {
     TRACE_CLOSURE (this);
-    Coverage::Iter iter;
     unsigned int count = alternateSet.len;
-    for (iter.init (this+coverage); iter.more (); iter.next ())
+    for (hb_auto_t<Coverage::Iter> iter (this+coverage); iter.more (); iter.next ())
     {
       if (unlikely (iter.get_coverage () >= count))
         break; /* Work around malicious fonts. https://github.com/harfbuzz/harfbuzz/issues/363 */
@@ -473,9 +467,8 @@ struct AlternateSubstFormat1
   {
     TRACE_COLLECT_GLYPHS (this);
     if (unlikely (!(this+coverage).add_coverage (c->input))) return;
-    Coverage::Iter iter;
     unsigned int count = alternateSet.len;
-    for (iter.init (this+coverage); iter.more (); iter.next ())
+    for (hb_auto_t<Coverage::Iter> iter (this+coverage); iter.more (); iter.next ())
     {
       if (unlikely (iter.get_coverage () >= count))
         break; /* Work around malicious fonts. https://github.com/harfbuzz/harfbuzz/issues/363 */
@@ -781,9 +774,8 @@ struct LigatureSubstFormat1
   inline void closure (hb_closure_context_t *c) const
   {
     TRACE_CLOSURE (this);
-    Coverage::Iter iter;
     unsigned int count = ligatureSet.len;
-    for (iter.init (this+coverage); iter.more (); iter.next ())
+    for (hb_auto_t<Coverage::Iter> iter (this+coverage); iter.more (); iter.next ())
     {
       if (unlikely (iter.get_coverage () >= count))
         break; /* Work around malicious fonts. https://github.com/harfbuzz/harfbuzz/issues/363 */
@@ -796,9 +788,8 @@ struct LigatureSubstFormat1
   {
     TRACE_COLLECT_GLYPHS (this);
     if (unlikely (!(this+coverage).add_coverage (c->input))) return;
-    Coverage::Iter iter;
     unsigned int count = ligatureSet.len;
-    for (iter.init (this+coverage); iter.more (); iter.next ())
+    for (hb_auto_t<Coverage::Iter> iter (this+coverage); iter.more (); iter.next ())
     {
       if (unlikely (iter.get_coverage () >= count))
         break; /* Work around malicious fonts. https://github.com/harfbuzz/harfbuzz/issues/363 */
@@ -950,9 +941,8 @@ struct ReverseChainSingleSubstFormat1
         return;
 
     const ArrayOf<GlyphID> &substitute = StructAfter<ArrayOf<GlyphID> > (lookahead);
-    Coverage::Iter iter;
     count = substitute.len;
-    for (iter.init (this+coverage); iter.more (); iter.next ())
+    for (hb_auto_t<Coverage::Iter> iter (this+coverage); iter.more (); iter.next ())
     {
       if (unlikely (iter.get_coverage () >= count))
         break; /* Work around malicious fonts. https://github.com/harfbuzz/harfbuzz/issues/363 */
commit ddea4d19cf6d64270e14418f02e7ff1f1b9458db
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sat Aug 25 21:08:15 2018 -0700

    Add 1-param passthrough constructor to hb_auto_t<>
    
    And use.

diff --git a/src/hb-dsalgs.hh b/src/hb-dsalgs.hh
index 8d59c6cf..c7aa611e 100644
--- a/src/hb-dsalgs.hh
+++ b/src/hb-dsalgs.hh
@@ -492,6 +492,7 @@ template <typename Type>
 struct hb_auto_t : Type
 {
   hb_auto_t (void) { Type::init (); }
+  template <typename T1> hb_auto_t (T1 t1) { Type::init (t1); }
   ~hb_auto_t (void) { Type::fini (); }
   private: /* Hide */
   void init (void) {}
diff --git a/src/hb-ot-cmap-table.hh b/src/hb-ot-cmap-table.hh
index dcdff008..af814bfb 100644
--- a/src/hb-ot-cmap-table.hh
+++ b/src/hb-ot-cmap-table.hh
@@ -243,6 +243,7 @@ struct CmapSubtableFormat4
       glyphIdArray = idRangeOffset + segCount;
       glyphIdArrayLength = (subtable->length - 16 - 8 * segCount) / 2;
     }
+    inline void fini (void) {}
 
     inline bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const
     {
@@ -313,14 +314,12 @@ struct CmapSubtableFormat4
 
   inline bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const
   {
-    accelerator_t accel;
-    accel.init (this);
+    hb_auto_t<accelerator_t> accel (this);
     return accel.get_glyph_func (&accel, codepoint, glyph);
   }
   inline void collect_unicodes (hb_set_t *out) const
   {
-    accelerator_t accel;
-    accel.init (this);
+    hb_auto_t<accelerator_t> accel (this);
     accel.collect_unicodes (out);
   }
 


More information about the HarfBuzz mailing list