[unsafe-to-break] Allocate public bits from 0
This commit is contained in:
parent
91ce0c45d6
commit
5287ccc935
|
@ -72,8 +72,9 @@ typedef struct hb_glyph_info_t {
|
||||||
} hb_glyph_info_t;
|
} hb_glyph_info_t;
|
||||||
|
|
||||||
typedef enum { /*< flags >*/
|
typedef enum { /*< flags >*/
|
||||||
HB_GLYPH_FLAG_UNSAFE_TO_BREAK = 0x00000002,
|
HB_GLYPH_FLAG_UNSAFE_TO_BREAK = 0x00000001,
|
||||||
HB_GLYPH_FLAG_DEFINED = 0x00000002 /* OR of all defined flags */
|
|
||||||
|
HB_GLYPH_FLAG_DEFINED = 0x00000001 /* OR of all defined flags */
|
||||||
} hb_glyph_flags_t;
|
} hb_glyph_flags_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -138,7 +138,11 @@ hb_ot_map_builder_t::compile (hb_ot_map_t &m,
|
||||||
const int *coords,
|
const int *coords,
|
||||||
unsigned int num_coords)
|
unsigned int num_coords)
|
||||||
{
|
{
|
||||||
m.global_mask = 1;
|
ASSERT_STATIC (!(HB_GLYPH_FLAG_DEFINED & (HB_GLYPH_FLAG_DEFINED + 1)));
|
||||||
|
unsigned int global_bit_mask = HB_GLYPH_FLAG_DEFINED + 1;
|
||||||
|
unsigned int global_bit_shift = _hb_popcount32 (HB_GLYPH_FLAG_DEFINED);
|
||||||
|
|
||||||
|
m.global_mask = global_bit_mask;
|
||||||
|
|
||||||
unsigned int required_feature_index[2];
|
unsigned int required_feature_index[2];
|
||||||
hb_tag_t required_feature_tag[2];
|
hb_tag_t required_feature_tag[2];
|
||||||
|
@ -190,8 +194,7 @@ hb_ot_map_builder_t::compile (hb_ot_map_t &m,
|
||||||
|
|
||||||
|
|
||||||
/* Allocate bits now */
|
/* Allocate bits now */
|
||||||
unsigned int next_bit = 1;
|
unsigned int next_bit = global_bit_shift + 1;
|
||||||
next_bit++; /* Allocate for HB_GLYPH_FLAG_UNSAFE_TO_BREAK */
|
|
||||||
|
|
||||||
for (unsigned int i = 0; i < feature_infos.len; i++)
|
for (unsigned int i = 0; i < feature_infos.len; i++)
|
||||||
{
|
{
|
||||||
|
@ -251,8 +254,8 @@ hb_ot_map_builder_t::compile (hb_ot_map_t &m,
|
||||||
map->auto_zwj = !(info->flags & F_MANUAL_ZWJ);
|
map->auto_zwj = !(info->flags & F_MANUAL_ZWJ);
|
||||||
if ((info->flags & F_GLOBAL) && info->max_value == 1) {
|
if ((info->flags & F_GLOBAL) && info->max_value == 1) {
|
||||||
/* Uses the global bit */
|
/* Uses the global bit */
|
||||||
map->shift = 0;
|
map->shift = global_bit_shift;
|
||||||
map->mask = 1;
|
map->mask = global_bit_mask;
|
||||||
} else {
|
} else {
|
||||||
map->shift = next_bit;
|
map->shift = next_bit;
|
||||||
map->mask = (1u << (next_bit + bits_needed)) - (1u << next_bit);
|
map->mask = (1u << (next_bit + bits_needed)) - (1u << next_bit);
|
||||||
|
@ -289,7 +292,7 @@ hb_ot_map_builder_t::compile (hb_ot_map_t &m,
|
||||||
add_lookups (m, face, table_index,
|
add_lookups (m, face, table_index,
|
||||||
required_feature_index[table_index],
|
required_feature_index[table_index],
|
||||||
variations_index,
|
variations_index,
|
||||||
1 /* mask */);
|
global_bit_mask);
|
||||||
|
|
||||||
for (unsigned i = 0; i < m.features.len; i++)
|
for (unsigned i = 0; i < m.features.len; i++)
|
||||||
if (m.features[i].stage[table_index] == stage)
|
if (m.features[i].stage[table_index] == stage)
|
||||||
|
|
Loading…
Reference in New Issue