Rename hb_glyph_map_t to hb_set_t
This commit is contained in:
parent
a4385f0b0a
commit
6a9be5bd35
|
@ -131,7 +131,7 @@ struct RangeRecord
|
||||||
return c->check_struct (this);
|
return c->check_struct (this);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool intersects (const hb_glyph_map_t *glyphs) const {
|
inline bool intersects (const hb_set_t *glyphs) const {
|
||||||
return glyphs->intersects (start, end);
|
return glyphs->intersects (start, end);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -358,7 +358,7 @@ struct CoverageFormat1
|
||||||
return glyphArray.sanitize (c);
|
return glyphArray.sanitize (c);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool intersects_coverage (const hb_glyph_map_t *glyphs, unsigned int index) const {
|
inline bool intersects_coverage (const hb_set_t *glyphs, unsigned int index) const {
|
||||||
return glyphs->has (glyphArray[index]);
|
return glyphs->has (glyphArray[index]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -402,7 +402,7 @@ struct CoverageFormat2
|
||||||
return rangeRecord.sanitize (c);
|
return rangeRecord.sanitize (c);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool intersects_coverage (const hb_glyph_map_t *glyphs, unsigned int index) const {
|
inline bool intersects_coverage (const hb_set_t *glyphs, unsigned int index) const {
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
unsigned int count = rangeRecord.len;
|
unsigned int count = rangeRecord.len;
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
|
@ -476,7 +476,7 @@ struct Coverage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool intersects (const hb_glyph_map_t *glyphs) const {
|
inline bool intersects (const hb_set_t *glyphs) const {
|
||||||
/* TODO speed this up */
|
/* TODO speed this up */
|
||||||
Coverage::Iter iter;
|
Coverage::Iter iter;
|
||||||
for (iter.init (*this); iter.more (); iter.next ()) {
|
for (iter.init (*this); iter.more (); iter.next ()) {
|
||||||
|
@ -486,7 +486,7 @@ struct Coverage
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool intersects_coverage (const hb_glyph_map_t *glyphs, unsigned int index) const {
|
inline bool intersects_coverage (const hb_set_t *glyphs, unsigned int index) const {
|
||||||
switch (u.format) {
|
switch (u.format) {
|
||||||
case 1: return u.format1.intersects_coverage (glyphs, index);
|
case 1: return u.format1.intersects_coverage (glyphs, index);
|
||||||
case 2: return u.format2.intersects_coverage (glyphs, index);
|
case 2: return u.format2.intersects_coverage (glyphs, index);
|
||||||
|
@ -574,7 +574,7 @@ struct ClassDefFormat1
|
||||||
&& classValue.sanitize (c);
|
&& classValue.sanitize (c);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool intersects_class (const hb_glyph_map_t *glyphs, unsigned int klass) const {
|
inline bool intersects_class (const hb_set_t *glyphs, unsigned int klass) const {
|
||||||
unsigned int count = classValue.len;
|
unsigned int count = classValue.len;
|
||||||
for (unsigned int i = 0; i < count; i++)
|
for (unsigned int i = 0; i < count; i++)
|
||||||
if (classValue[i] == klass && glyphs->has (startGlyph + i))
|
if (classValue[i] == klass && glyphs->has (startGlyph + i))
|
||||||
|
@ -608,7 +608,7 @@ struct ClassDefFormat2
|
||||||
return rangeRecord.sanitize (c);
|
return rangeRecord.sanitize (c);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool intersects_class (const hb_glyph_map_t *glyphs, unsigned int klass) const {
|
inline bool intersects_class (const hb_set_t *glyphs, unsigned int klass) const {
|
||||||
unsigned int count = rangeRecord.len;
|
unsigned int count = rangeRecord.len;
|
||||||
for (unsigned int i = 0; i < count; i++)
|
for (unsigned int i = 0; i < count; i++)
|
||||||
if (rangeRecord[i].value == klass && rangeRecord[i].intersects (glyphs))
|
if (rangeRecord[i].value == klass && rangeRecord[i].intersects (glyphs))
|
||||||
|
@ -647,7 +647,7 @@ struct ClassDef
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool intersects_class (const hb_glyph_map_t *glyphs, unsigned int klass) const {
|
inline bool intersects_class (const hb_set_t *glyphs, unsigned int klass) const {
|
||||||
switch (u.format) {
|
switch (u.format) {
|
||||||
case 1: return u.format1.intersects_class (glyphs, klass);
|
case 1: return u.format1.intersects_class (glyphs, klass);
|
||||||
case 2: return u.format2.intersects_class (glyphs, klass);
|
case 2: return u.format2.intersects_class (glyphs, klass);
|
||||||
|
|
|
@ -58,13 +58,13 @@ static inline uint8_t allocate_lig_id (hb_buffer_t *buffer) {
|
||||||
struct hb_closure_context_t
|
struct hb_closure_context_t
|
||||||
{
|
{
|
||||||
hb_face_t *face;
|
hb_face_t *face;
|
||||||
hb_glyph_map_t *glyphs;
|
hb_set_t *glyphs;
|
||||||
unsigned int nesting_level_left;
|
unsigned int nesting_level_left;
|
||||||
unsigned int debug_depth;
|
unsigned int debug_depth;
|
||||||
|
|
||||||
|
|
||||||
hb_closure_context_t (hb_face_t *face_,
|
hb_closure_context_t (hb_face_t *face_,
|
||||||
hb_glyph_map_t *glyphs_,
|
hb_set_t *glyphs_,
|
||||||
unsigned int nesting_level_left_ = MAX_NESTING_LEVEL) :
|
unsigned int nesting_level_left_ = MAX_NESTING_LEVEL) :
|
||||||
face (face_), glyphs (glyphs_),
|
face (face_), glyphs (glyphs_),
|
||||||
nesting_level_left (nesting_level_left_),
|
nesting_level_left (nesting_level_left_),
|
||||||
|
@ -227,7 +227,7 @@ struct hb_apply_context_t
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef bool (*intersects_func_t) (hb_glyph_map_t *glyphs, const USHORT &value, const void *data);
|
typedef bool (*intersects_func_t) (hb_set_t *glyphs, const USHORT &value, const void *data);
|
||||||
typedef bool (*match_func_t) (hb_codepoint_t glyph_id, const USHORT &value, const void *data);
|
typedef bool (*match_func_t) (hb_codepoint_t glyph_id, const USHORT &value, const void *data);
|
||||||
typedef bool (*closure_lookup_func_t) (hb_closure_context_t *c, unsigned int lookup_index);
|
typedef bool (*closure_lookup_func_t) (hb_closure_context_t *c, unsigned int lookup_index);
|
||||||
typedef bool (*apply_lookup_func_t) (hb_apply_context_t *c, unsigned int lookup_index);
|
typedef bool (*apply_lookup_func_t) (hb_apply_context_t *c, unsigned int lookup_index);
|
||||||
|
@ -243,16 +243,16 @@ struct ContextApplyFuncs
|
||||||
apply_lookup_func_t apply;
|
apply_lookup_func_t apply;
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline bool intersects_glyph (hb_glyph_map_t *glyphs, const USHORT &value, const void *data HB_UNUSED)
|
static inline bool intersects_glyph (hb_set_t *glyphs, const USHORT &value, const void *data HB_UNUSED)
|
||||||
{
|
{
|
||||||
return glyphs->has (value);
|
return glyphs->has (value);
|
||||||
}
|
}
|
||||||
static inline bool intersects_class (hb_glyph_map_t *glyphs, const USHORT &value, const void *data)
|
static inline bool intersects_class (hb_set_t *glyphs, const USHORT &value, const void *data)
|
||||||
{
|
{
|
||||||
const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
|
const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data);
|
||||||
return class_def.intersects_class (glyphs, value);
|
return class_def.intersects_class (glyphs, value);
|
||||||
}
|
}
|
||||||
static inline bool intersects_coverage (hb_glyph_map_t *glyphs, const USHORT &value, const void *data)
|
static inline bool intersects_coverage (hb_set_t *glyphs, const USHORT &value, const void *data)
|
||||||
{
|
{
|
||||||
const OffsetTo<Coverage> &coverage = (const OffsetTo<Coverage>&)value;
|
const OffsetTo<Coverage> &coverage = (const OffsetTo<Coverage>&)value;
|
||||||
return (data+coverage).intersects (glyphs);
|
return (data+coverage).intersects (glyphs);
|
||||||
|
|
|
@ -95,7 +95,7 @@ _hb_ot_layout_destroy (hb_ot_layout_t *layout);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct _hb_glyph_map_t
|
struct _hb_set_t
|
||||||
{
|
{
|
||||||
void clear (void) {
|
void clear (void) {
|
||||||
memset (elts, 0, sizeof elts);
|
memset (elts, 0, sizeof elts);
|
||||||
|
|
|
@ -472,7 +472,7 @@ hb_ot_layout_substitute_finish (hb_buffer_t *buffer HB_UNUSED)
|
||||||
|
|
||||||
hb_bool_t
|
hb_bool_t
|
||||||
hb_ot_layout_substitute_closure_lookup (hb_face_t *face,
|
hb_ot_layout_substitute_closure_lookup (hb_face_t *face,
|
||||||
hb_glyph_map_t *glyphs,
|
hb_set_t *glyphs,
|
||||||
unsigned int lookup_index)
|
unsigned int lookup_index)
|
||||||
{
|
{
|
||||||
hb_closure_context_t c (face, glyphs);
|
hb_closure_context_t c (face, glyphs);
|
||||||
|
|
|
@ -183,11 +183,11 @@ void
|
||||||
hb_ot_layout_substitute_finish (hb_buffer_t *buffer);
|
hb_ot_layout_substitute_finish (hb_buffer_t *buffer);
|
||||||
|
|
||||||
|
|
||||||
typedef struct _hb_glyph_map_t hb_glyph_map_t;
|
typedef struct _hb_set_t hb_set_t;
|
||||||
|
|
||||||
hb_bool_t
|
hb_bool_t
|
||||||
hb_ot_layout_substitute_closure_lookup (hb_face_t *face,
|
hb_ot_layout_substitute_closure_lookup (hb_face_t *face,
|
||||||
hb_glyph_map_t *glyphs,
|
hb_set_t *glyphs,
|
||||||
unsigned int lookup_index);
|
unsigned int lookup_index);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -126,7 +126,7 @@ struct hb_ot_map_t
|
||||||
hb_buffer_t *buffer) const;
|
hb_buffer_t *buffer) const;
|
||||||
|
|
||||||
HB_INTERNAL void substitute_closure (hb_face_t *face,
|
HB_INTERNAL void substitute_closure (hb_face_t *face,
|
||||||
hb_glyph_map_t *glyphs) const;
|
hb_set_t *glyphs) const;
|
||||||
|
|
||||||
hb_mask_t global_mask;
|
hb_mask_t global_mask;
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,7 @@ void hb_ot_map_t::apply (unsigned int table_index,
|
||||||
}
|
}
|
||||||
|
|
||||||
void hb_ot_map_t::substitute_closure (hb_face_t *face,
|
void hb_ot_map_t::substitute_closure (hb_face_t *face,
|
||||||
hb_glyph_map_t *glyphs) const
|
hb_set_t *glyphs) const
|
||||||
{
|
{
|
||||||
unsigned int table_index = 0;
|
unsigned int table_index = 0;
|
||||||
unsigned int i = 0;
|
unsigned int i = 0;
|
||||||
|
|
Loading…
Reference in New Issue