[HarfBuzz] harfbuzz: Branch 'master'
Behdad Esfahbod
behdad at kemper.freedesktop.org
Sun Nov 4 19:36:07 UTC 2018
src/hb-aat-layout-ankr-table.hh | 2 +
src/hb-aat-layout-common.hh | 31 ++++++++---------------------
src/hb-aat-layout-kerx-table.hh | 16 +++++++--------
src/hb-aat-layout.cc | 42 ++++++++++++++++++++++++++++++++++++++--
src/hb-ot-kern-table.hh | 1
src/hb-static.cc | 1
6 files changed, 59 insertions(+), 34 deletions(-)
New commits:
commit b605db2f65e62ad6727a61481f78015933dbf207
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Sun Nov 4 12:58:02 2018 -0500
[aat] Clean up ankr table include mess
diff --git a/src/hb-aat-layout-ankr-table.hh b/src/hb-aat-layout-ankr-table.hh
index 5f7656d2..b793245a 100644
--- a/src/hb-aat-layout-ankr-table.hh
+++ b/src/hb-aat-layout-ankr-table.hh
@@ -36,6 +36,8 @@
namespace AAT {
+using namespace OT;
+
struct Anchor
{
diff --git a/src/hb-aat-layout-common.hh b/src/hb-aat-layout-common.hh
index 11c6c5a8..ee2136ed 100644
--- a/src/hb-aat-layout-common.hh
+++ b/src/hb-aat-layout-common.hh
@@ -698,36 +698,23 @@ struct hb_aat_apply_context_t :
hb_face_t *face;
hb_buffer_t *buffer;
hb_sanitize_context_t sanitizer;
- const ankr &ankr_table;
+ const ankr *ankr_table;
const char *ankr_end;
/* Unused. For debug tracing only. */
unsigned int lookup_index;
unsigned int debug_depth;
- inline hb_aat_apply_context_t (hb_ot_shape_plan_t *plan_,
- hb_font_t *font_,
- hb_buffer_t *buffer_,
- hb_blob_t *blob = const_cast<hb_blob_t *> (&Null(hb_blob_t)),
- const ankr &ankr_table_ = Null(ankr),
- const char *ankr_end_ = nullptr) :
- plan (plan_), font (font_), face (font->face), buffer (buffer_),
- sanitizer (),
- ankr_table (ankr_table_), ankr_end (ankr_end_),
- lookup_index (0), debug_depth (0)
- {
- sanitizer.init (blob);
- sanitizer.set_num_glyphs (face->get_num_glyphs ());
- sanitizer.start_processing ();
- sanitizer.set_max_ops (HB_SANITIZE_MAX_OPS_MAX);
- }
+ HB_INTERNAL hb_aat_apply_context_t (hb_ot_shape_plan_t *plan_,
+ hb_font_t *font_,
+ hb_buffer_t *buffer_,
+ hb_blob_t *blob = const_cast<hb_blob_t *> (&Null(hb_blob_t)));
- inline void set_lookup_index (unsigned int i) { lookup_index = i; }
+ HB_INTERNAL ~hb_aat_apply_context_t (void);
- inline ~hb_aat_apply_context_t (void)
- {
- sanitizer.end_processing ();
- }
+ HB_INTERNAL void set_ankr_table (const AAT::ankr *ankr_table_, const char *ankr_end_);
+
+ inline void set_lookup_index (unsigned int i) { lookup_index = i; }
};
diff --git a/src/hb-aat-layout-kerx-table.hh b/src/hb-aat-layout-kerx-table.hh
index b227af10..d2242c54 100644
--- a/src/hb-aat-layout-kerx-table.hh
+++ b/src/hb-aat-layout-kerx-table.hh
@@ -423,14 +423,14 @@ struct KerxSubTableFormat4
return false;
unsigned int markAnchorPoint = *data++;
unsigned int currAnchorPoint = *data++;
- const Anchor markAnchor = c->ankr_table.get_anchor (c->buffer->info[mark].codepoint,
- markAnchorPoint,
- c->sanitizer.get_num_glyphs (),
- c->ankr_end);
- const Anchor currAnchor = c->ankr_table.get_anchor (c->buffer->cur ().codepoint,
- currAnchorPoint,
- c->sanitizer.get_num_glyphs (),
- c->ankr_end);
+ const Anchor markAnchor = c->ankr_table->get_anchor (c->buffer->info[mark].codepoint,
+ markAnchorPoint,
+ c->sanitizer.get_num_glyphs (),
+ c->ankr_end);
+ const Anchor currAnchor = c->ankr_table->get_anchor (c->buffer->cur ().codepoint,
+ currAnchorPoint,
+ c->sanitizer.get_num_glyphs (),
+ c->ankr_end);
o.x_offset = c->font->em_scale_x (markAnchor.xCoordinate) - c->font->em_scale_x (currAnchor.xCoordinate);
o.y_offset = c->font->em_scale_y (markAnchor.yCoordinate) - c->font->em_scale_y (currAnchor.yCoordinate);
diff --git a/src/hb-aat-layout.cc b/src/hb-aat-layout.cc
index d917c29c..80bf2d76 100644
--- a/src/hb-aat-layout.cc
+++ b/src/hb-aat-layout.cc
@@ -131,6 +131,44 @@ hb_aat_layout_find_feature_mapping (hb_tag_t tag)
/*
+ * hb_aat_apply_context_t
+ */
+
+AAT::hb_aat_apply_context_t::hb_aat_apply_context_t (hb_ot_shape_plan_t *plan_,
+ hb_font_t *font_,
+ hb_buffer_t *buffer_,
+ hb_blob_t *blob) :
+ plan (plan_),
+ font (font_),
+ face (font->face),
+ buffer (buffer_),
+ sanitizer (),
+ ankr_table (&Null(AAT::ankr)),
+ ankr_end (nullptr),
+ lookup_index (0),
+ debug_depth (0)
+{
+ sanitizer.init (blob);
+ sanitizer.set_num_glyphs (face->get_num_glyphs ());
+ sanitizer.start_processing ();
+ sanitizer.set_max_ops (HB_SANITIZE_MAX_OPS_MAX);
+}
+
+AAT::hb_aat_apply_context_t::~hb_aat_apply_context_t (void)
+{
+ sanitizer.end_processing ();
+}
+
+void
+AAT::hb_aat_apply_context_t::set_ankr_table (const AAT::ankr *ankr_table_,
+ const char *ankr_end_)
+{
+ ankr_table = ankr_table_;
+ ankr_end = ankr_end_;
+}
+
+
+/*
* mort/morx/kerx/trak
*/
@@ -273,8 +311,8 @@ hb_aat_layout_position (hb_ot_shape_plan_t *plan,
hb_blob_t *ankr_blob;
const AAT::ankr& ankr = _get_ankr (font->face, &ankr_blob);
- AAT::hb_aat_apply_context_t c (plan, font, buffer, blob,
- ankr, ankr_blob->data + ankr_blob->length);
+ AAT::hb_aat_apply_context_t c (plan, font, buffer, blob);
+ c.set_ankr_table (&ankr, ankr_blob->data + ankr_blob->length);
kerx.apply (&c);
}
diff --git a/src/hb-ot-kern-table.hh b/src/hb-ot-kern-table.hh
index e361330b..5bc9e436 100644
--- a/src/hb-ot-kern-table.hh
+++ b/src/hb-ot-kern-table.hh
@@ -30,7 +30,6 @@
#include "hb-open-type.hh"
#include "hb-ot-shape.hh"
#include "hb-ot-layout-gsubgpos.hh"
-#include "hb-aat-layout-ankr-table.hh" // Ugly but needed.
#include "hb-aat-layout-common.hh"
diff --git a/src/hb-static.cc b/src/hb-static.cc
index e5507960..3669e08b 100644
--- a/src/hb-static.cc
+++ b/src/hb-static.cc
@@ -28,7 +28,6 @@
#include "hb-open-type.hh"
#include "hb-ot-layout-common.hh"
-#include "hb-aat-layout-ankr-table.hh" /* I don't even want to know why... */
#include "hb-aat-layout-common.hh"
#include "hb-face.hh"
More information about the HarfBuzz
mailing list