27 #ifndef HB_OT_SHAPE_COMPLEX_ARABIC_FALLBACK_HH
28 #define HB_OT_SHAPE_COMPLEX_ARABIC_FALLBACK_HH
38 static const hb_tag_t arabic_fallback_features[] =
50 unsigned int feature_index)
54 unsigned int num_glyphs = 0;
66 u_glyph > 0xFFFFu || s_glyph > 0xFFFFu)
69 glyphs[num_glyphs] = u_glyph;
70 substitutes[num_glyphs] = s_glyph;
80 hb_stable_sort (&glyphs[0], num_glyphs,
105 unsigned int num_first_glyphs = 0;
111 unsigned int num_ligatures = 0;
116 for (
unsigned int first_glyph_idx = 0; first_glyph_idx <
ARRAY_LENGTH (first_glyphs); first_glyph_idx++)
122 first_glyphs[num_first_glyphs] = first_glyph;
123 ligature_per_first_glyph_count_list[num_first_glyphs] = 0;
124 first_glyphs_indirection[num_first_glyphs] = first_glyph_idx;
127 hb_stable_sort (&first_glyphs[0], num_first_glyphs,
129 &first_glyphs_indirection[0]);
132 for (
unsigned int i = 0;
i < num_first_glyphs;
i++)
134 unsigned int first_glyph_idx = first_glyphs_indirection[
i];
136 for (
unsigned int second_glyph_idx = 0; second_glyph_idx <
ARRAY_LENGTH (ligature_table[0].ligatures); second_glyph_idx++)
138 hb_codepoint_t second_u = ligature_table[first_glyph_idx].ligatures[second_glyph_idx].second;
139 hb_codepoint_t ligature_u = ligature_table[first_glyph_idx].ligatures[second_glyph_idx].ligature;
146 ligature_per_first_glyph_count_list[
i]++;
148 ligature_list[num_ligatures] = ligature_glyph;
149 component_count_list[num_ligatures] = 2;
150 component_list[num_ligatures] = second_glyph;
166 hb_array (ligature_per_first_glyph_count_list, num_first_glyphs),
167 hb_array (ligature_list, num_ligatures),
168 hb_array (component_count_list, num_ligatures),
169 hb_array (component_list, num_ligatures));
179 unsigned int feature_index)
181 if (feature_index < 4)
182 return arabic_fallback_synthesize_lookup_single (plan,
font, feature_index);
184 return arabic_fallback_synthesize_lookup_ligature (plan,
font);
187 #define ARABIC_FALLBACK_MAX_LOOKUPS 5
199 #if defined(_WIN32) && !defined(HB_NO_WIN1256)
200 #define HB_WITH_WIN1256
203 #ifdef HB_WITH_WIN1256
222 #ifdef HB_WITH_WIN1256
232 const Manifest &manifest =
reinterpret_cast<const Manifest&
> (arabic_win1256_gsub_lookups.manifest);
233 static_assert (
sizeof (arabic_win1256_gsub_lookups.manifestData) ==
239 for (
unsigned int i = 0;
i <
count;
i++)
242 if (fallback_plan->mask_array[
j])
244 fallback_plan->lookup_array[
j] =
const_cast<OT::SubstLookup*
> (&(&manifest+manifest[
i].lookupOffset));
245 if (fallback_plan->lookup_array[
j])
247 fallback_plan->accel_array[
j].init (*fallback_plan->lookup_array[
j]);
253 fallback_plan->num_lookups =
j;
254 fallback_plan->free_lookups =
false;
269 for (
unsigned int i = 0;
i <
ARRAY_LENGTH(arabic_fallback_features) ;
i++)
302 if (arabic_fallback_plan_init_unicode (fallback_plan, plan,
font))
303 return fallback_plan;
307 if (arabic_fallback_plan_init_win1256 (fallback_plan, plan,
font))
308 return fallback_plan;
318 if (!fallback_plan || fallback_plan->
num_lookups == 0)
small capitals from c petite p scientific f u
small capitals from c petite p scientific i
[1]
#define ARRAY_LENGTH_CONST(__array)
hb_array_t< T > hb_array(T *array, unsigned int length)
hb_sorted_array_t< T > hb_sorted_array(T *array, unsigned int length)
void const void *obj HB_UNUSED
hb_bool_t hb_font_get_glyph(hb_font_t *font, hb_codepoint_t unicode, hb_codepoint_t variation_selector, hb_codepoint_t *glyph)
void hb_ot_layout_substitute_lookup(OT::hb_ot_apply_context_t *c, const OT::SubstLookup &lookup, const OT::hb_ot_layout_lookup_accelerator_t &accel)
OT::Array16Of< ManifestLookup > Manifest
#define ARABIC_FALLBACK_MAX_LOOKUPS
#define SHAPING_TABLE_FIRST
#define SHAPING_TABLE_LAST
GLenum GLenum GLsizei count
GLenum GLuint GLenum GLsizei const GLchar * buf
#define HB_TAG(c1, c2, c3, c4)
OT::Offset16To< OT::SubstLookup > lookupOffset
static HB_INTERNAL int cmp(const IntType *a, const IntType *b)
bool serialize_ligature(hb_serialize_context_t *c, uint32_t lookup_props, hb_sorted_array_t< const HBGlyphID16 > first_glyphs, hb_array_t< const unsigned int > ligature_per_first_glyph_count_list, hb_array_t< const HBGlyphID16 > ligatures_list, hb_array_t< const unsigned int > component_count_list, hb_array_t< const HBGlyphID16 > component_list)
bool serialize_single(hb_serialize_context_t *c, uint32_t lookup_props, hb_sorted_array_t< const HBGlyphID16 > glyphs, hb_array_t< const HBGlyphID16 > substitutes)
void init(const TLookup &lookup)
OT::SubstLookup * lookup_array[ARABIC_FALLBACK_MAX_LOOKUPS]
OT::hb_ot_layout_lookup_accelerator_t accel_array[ARABIC_FALLBACK_MAX_LOOKUPS]
hb_mask_t mask_array[ARABIC_FALLBACK_MAX_LOOKUPS]
hb_mask_t get_1_mask(hb_tag_t feature_tag) const
XmlOutput::xml_output tag(const QString &name)