29 #ifndef HB_NO_OT_SHAPE
36 #define arabic_shaping_action() complex_var_u8_auxiliary()
38 #define HB_BUFFER_SCRATCH_FLAG_ARABIC_HAS_STCH HB_BUFFER_SCRATCH_FLAG_COMPLEX0
42 #define HB_ARABIC_GENERAL_CATEGORY_IS_WORD(gen_cat) \
43 (FLAG_UNSAFE (gen_cat) & \
44 (FLAG (HB_UNICODE_GENERAL_CATEGORY_UNASSIGNED) | \
45 FLAG (HB_UNICODE_GENERAL_CATEGORY_PRIVATE_USE) | \
47 FLAG (HB_UNICODE_GENERAL_CATEGORY_MODIFIER_LETTER) | \
48 FLAG (HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER) | \
51 FLAG (HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK) | \
52 FLAG (HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK) | \
53 FLAG (HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK) | \
54 FLAG (HB_UNICODE_GENERAL_CATEGORY_DECIMAL_NUMBER) | \
55 FLAG (HB_UNICODE_GENERAL_CATEGORY_LETTER_NUMBER) | \
56 FLAG (HB_UNICODE_GENERAL_CATEGORY_OTHER_NUMBER) | \
57 FLAG (HB_UNICODE_GENERAL_CATEGORY_CURRENCY_SYMBOL) | \
58 FLAG (HB_UNICODE_GENERAL_CATEGORY_MODIFIER_SYMBOL) | \
59 FLAG (HB_UNICODE_GENERAL_CATEGORY_MATH_SYMBOL) | \
60 FLAG (HB_UNICODE_GENERAL_CATEGORY_OTHER_SYMBOL)))
88 unsigned int j_type = joining_type(
u);
99 #define FEATURE_IS_SYRIAC(tag) hb_in_range<unsigned char> ((unsigned char) (tag), '2', '3')
101 static const hb_tag_t arabic_features[] =
133 static const struct arabic_state_table_entry {
142 { {
NONE,
NONE,0}, {
NONE,
ISOL,2}, {
NONE,
ISOL,1}, {
NONE,
ISOL,2}, {
NONE,
ISOL,1}, {
NONE,
ISOL,6}, },
145 { {
NONE,
NONE,0}, {
NONE,
ISOL,2}, {
NONE,
ISOL,1}, {
NONE,
ISOL,2}, {
NONE,
FIN2,5}, {
NONE,
ISOL,6}, },
148 { {
NONE,
NONE,0}, {
NONE,
ISOL,2}, {
INIT,
FINA,1}, {
INIT,
FINA,3}, {
INIT,
FINA,4}, {
INIT,
FINA,6}, },
151 { {
NONE,
NONE,0}, {
NONE,
ISOL,2}, {
MEDI,
FINA,1}, {
MEDI,
FINA,3}, {
MEDI,
FINA,4}, {
MEDI,
FINA,6}, },
154 { {
NONE,
NONE,0}, {
NONE,
ISOL,2}, {
MED2,
ISOL,1}, {
MED2,
ISOL,2}, {
MED2,
FIN2,5}, {
MED2,
ISOL,6}, },
157 { {
NONE,
NONE,0}, {
NONE,
ISOL,2}, {
ISOL,
ISOL,1}, {
ISOL,
ISOL,2}, {
ISOL,
FIN2,5}, {
ISOL,
ISOL,6}, },
160 { {
NONE,
NONE,0}, {
NONE,
ISOL,2}, {
NONE,
ISOL,1}, {
NONE,
ISOL,2}, {
NONE,
FIN3,5}, {
NONE,
ISOL,6}, }
202 map->enable_feature (
HB_TAG(
's',
't',
'c',
'h'));
203 map->add_gsub_pause (record_stch);
205 map->enable_feature (
HB_TAG(
'c',
'c',
'm',
'p'));
206 map->enable_feature (
HB_TAG(
'l',
'o',
'c',
'l'));
208 map->add_gsub_pause (
nullptr);
214 map->add_gsub_pause (
nullptr);
224 map->add_gsub_pause (arabic_fallback_shape);
229 map->add_gsub_pause (
nullptr);
240 map->enable_feature (
HB_TAG(
'm',
's',
'e',
't'));
293 unsigned int prev = UINT_MAX,
state = 0;
296 for (
unsigned int i = 0;
i <
buffer->context_len[0];
i++)
298 unsigned int this_type = get_joining_type (
buffer->context[0][
i],
buffer->unicode->general_category (
buffer->context[0][
i]));
303 const arabic_state_table_entry *
entry = &arabic_state_table[
state][this_type];
308 for (
unsigned int i = 0;
i <
count;
i++)
310 unsigned int this_type = get_joining_type (
info[
i].codepoint, _hb_glyph_info_get_general_category (&
info[
i]));
317 const arabic_state_table_entry *
entry = &arabic_state_table[
state][this_type];
319 if (
entry->prev_action !=
NONE && prev != UINT_MAX)
321 info[prev].arabic_shaping_action() =
entry->prev_action;
322 buffer->unsafe_to_break (prev,
i + 1);
326 if (prev == UINT_MAX)
329 buffer->unsafe_to_concat_from_outbuffer (0,
i + 1);
335 buffer->unsafe_to_concat (prev,
i + 1);
339 info[
i].arabic_shaping_action() =
entry->curr_action;
345 for (
unsigned int i = 0;
i <
buffer->context_len[1];
i++)
347 unsigned int this_type = get_joining_type (
buffer->context[1][
i],
buffer->unicode->general_category (
buffer->context[1][
i]));
352 const arabic_state_table_entry *
entry = &arabic_state_table[
state][this_type];
353 if (
entry->prev_action !=
NONE && prev != UINT_MAX)
355 info[prev].arabic_shaping_action() =
entry->prev_action;
372 for (
unsigned int i = 1;
i <
count;
i++)
373 if (
unlikely (hb_in_ranges<hb_codepoint_t> (
info[
i].codepoint, 0x180Bu, 0x180Du, 0x180Fu, 0x180Fu)))
374 info[
i].arabic_shaping_action() =
info[
i - 1].arabic_shaping_action();
386 mongolian_variation_selectors (
buffer);
390 for (
unsigned int i = 0;
i <
count;
i++)
408 #ifdef HB_NO_OT_SHAPE_COMPLEX_ARABIC_FALLBACK
422 fallback_plan = arabic_fallback_plan_create (plan,
font);
425 arabic_fallback_plan_destroy (fallback_plan);
430 arabic_fallback_plan_shape (fallback_plan,
font,
buffer);
457 for (
unsigned int i = 0;
i <
count;
i++)
460 unsigned int comp = _hb_glyph_info_get_lig_comp (&
info[
i]);
483 int sign =
font->x_scale < 0 ? -1 : +1;
484 unsigned int extra_glyphs_needed = 0;
485 enum { MEASURE, CUT } ;
492 unsigned int new_len =
count + extra_glyphs_needed;
493 unsigned int j = new_len;
494 for (
unsigned int i =
count;
i;
i--)
515 unsigned int end =
i;
528 w_repeating +=
width;
536 (_hb_glyph_info_is_default_ignorable (&
info[
context - 1]) ||
544 DEBUG_MSG (ARABIC,
nullptr,
"%s stretch at (%d,%d,%d)",
547 DEBUG_MSG (ARABIC,
nullptr,
"fixed tiles: count=%d width=%d", n_fixed, w_fixed);
548 DEBUG_MSG (ARABIC,
nullptr,
"repeating tiles: count=%d width=%d", n_repeating, w_repeating);
554 if (sign * w_remaining > sign * w_repeating && sign * w_repeating > 0)
555 n_copies = (sign * w_remaining) / (sign * w_repeating) - 1;
559 hb_position_t shortfall = sign * w_remaining - sign * w_repeating * (n_copies + 1);
560 if (shortfall > 0 && n_repeating > 0)
563 hb_position_t excess = (n_copies + 1) * sign * w_repeating - sign * w_remaining;
565 extra_repeat_overlap = excess / (n_copies * n_repeating);
570 extra_glyphs_needed += n_copies * n_repeating;
571 DEBUG_MSG (ARABIC,
nullptr,
"will add extra %d copies of repeating tiles", n_copies);
577 for (
unsigned int k =
end; k >
start; k--)
585 DEBUG_MSG (ARABIC,
nullptr,
"appending %d copies of glyph %d; j=%d",
587 for (
unsigned int n = 0;
n <
repeat;
n++)
591 x_offset += extra_repeat_overlap;
592 pos[k - 1].x_offset = x_offset;
629 modifier_combining_marks[] =
651 for (
unsigned int i = 0;
i <
ARRAY_LENGTH (modifier_combining_marks);
i++)
652 if (
u == modifier_combining_marks[
i])
668 for (
unsigned int cc = 220; cc <= 230; cc += 10)
711 unsigned int new_start =
start +
j -
i;
713 while (
start < new_start)
715 _hb_glyph_info_set_modified_combining_class (&
info[
start], new_cc);
725 collect_features_arabic,
730 postprocess_glyphs_arabic,
736 reorder_marks_arabic,
small capitals from c petite p scientific f u
small capitals from c petite p scientific i
[1]
xD9 x84 xD8 xAD xD9 x80 xF0 x90 xAC x9A xE0 xA7 xA6 xE0 xA7 xAA xF0 x91 x84 xA4 xF0 x91 x84 x89 xF0 x91 x84 x9B xF0 x90 x8A xAB xF0 x90 x8B x89 xE2 xB2 x9E xE2 xB2 x9F xD0 xBE xD0 x9E xF0 x90 x90 x84 xF0 x90 x90 xAC xE1 x83 x98 xE1 x83 x94 xE1 x83 x90 xE1 xB2 xBF xE2 xB0 x95 xE2 xB1 x85 xCE xBF xCE x9F xE0 xA8 xA0 xE0 xA8 xB0 xE0 xA9 xA6 Kayah xEA xA4 x8D xEA xA4 x80 Khmer xE1 xA7 xA1 xE1 xA7 xAA xE0 xBB x90 Latin Subscript xE2 x82 x92 xE2 x82 x80 xEA x93 xB3 xF0 x96 xB9 xA1 xF0 x96 xB9 x9B xF0 x96 xB9 xAF xE1 x80 x9D xE1 x80 x84 xE1 x80 x82 no script
QMap< QString, QString > map
[6]
#define HB_BUFFER_DEALLOCATE_VAR(b, var)
#define HB_BUFFER_ALLOCATE_VAR(b, var)
#define DEBUG_MSG(WHAT, OBJ,...)
void const void *obj HB_UNUSED
#define FEATURE_IS_SYRIAC(tag)
#define HB_BUFFER_SCRATCH_FLAG_ARABIC_HAS_STCH
void data_destroy_arabic(void *data)
#define HB_ARABIC_GENERAL_CATEGORY_IS_WORD(gen_cat)
void setup_masks_arabic_plan(const arabic_shape_plan_t *arabic_plan, hb_buffer_t *buffer, hb_script_t script)
#define arabic_shaping_action()
void * data_create_arabic(const hb_ot_shape_plan_t *plan)
const hb_ot_complex_shaper_t _hb_ot_complex_shaper_arabic
@ JOINING_GROUP_DALATH_RISH
@ HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE
#define HB_OT_SHAPE_COMPLEX_MAX_COMBINING_MARKS
@ HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT
#define HB_MODIFIED_COMBINING_CLASS_CCC26
#define HB_MODIFIED_COMBINING_CLASS_CCC22
backing_store_ptr info
[4]
GeneratorWrapper< T > repeat(size_t repeats, GeneratorWrapper< T > &&generator)
void *PRIV() memmove(void *d, const void *s, size_t n)
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro vuzp8 reg2 vuzp d d ®2 endm macro vzip8 reg2 vzip d d ®2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld[DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld if[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp skip1(dst_w_bpp<=(lowbit *8)) &&((lowbit *8)<(pixblock_size *dst_w_bpp)) .if lowbit< 16 tst DST_R
[3]
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLint GLint GLint GLint GLint GLint GLint GLbitfield mask
#define HB_TAG(c1, c2, c3, c4)
hb_unicode_general_category_t
@ HB_UNICODE_GENERAL_CATEGORY_FORMAT
@ HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK
@ HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK
hb_mask_t mask_array[ARABIC_NUM_FEATURES+1]
hb_atomic_ptr_t< arabic_fallback_plan_t > fallback_plan
bool cmpexch(const T *old, T *new_) const
hb_mask_t get_1_mask(hb_tag_t feature_tag) const
bool needs_fallback(hb_tag_t feature_tag) const
hb_segment_properties_t props
hb_segment_properties_t props