{
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;
#include "hb.hh"
#include "hb-machinery.hh"
-#include "hb-set-digest.hh"
#include "hb-ot-cmap-table.hh"
#include "hb-ot-glyf-table.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 \
const OffsetTo<PosLookupList> &list = CastR<OffsetTo<PosLookupList> > (lookupList);
return_trace (list.sanitize (c, this));
}
+
+ typedef GSUBGPOS::accelerator_t<GPOS> accelerator_t;
};
const OffsetTo<SubstLookupList> &list = CastR<OffsetTo<SubstLookupList> > (lookupList);
return_trace (list.sanitize (c, this));
}
+
+ typedef GSUBGPOS::accelerator_t<GSUB> accelerator_t;
};
DEFINE_SIZE_STATIC (4);
};
-
template <typename context_t>
static inline void recurse_lookups (context_t *c,
unsigned int lookupCount,
(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 */
#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: */
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;