[USE] Implement dotted-circle

This makes USE feature-complete as far as the Indic-like features
are concerned.
This commit is contained in:
Behdad Esfahbod 2015-07-21 17:14:54 +01:00
parent 7ce03ebe7c
commit 40c4a991c7
2 changed files with 25 additions and 3 deletions

View File

@ -116,6 +116,15 @@ vowel_cluster =
final_consonants final_consonants
; ;
broken_cluster =
R?
consonant_modifiers
medial_consonants
dependent_vowels
vowel_modifiers
final_consonants
;
number_joiner_terminated_cluster = N VS? (HN N VS?)* H; number_joiner_terminated_cluster = N VS? (HN N VS?)* H;
numeral_cluster = N VS? (HN N VS?)*; numeral_cluster = N VS? (HN N VS?)*;
symbol_cluster = S VS? SMAbv* SMBlw*; symbol_cluster = S VS? SMAbv* SMBlw*;
@ -129,6 +138,7 @@ main := |*
number_joiner_terminated_cluster => { found_syllable (number_joiner_terminated_cluster); }; number_joiner_terminated_cluster => { found_syllable (number_joiner_terminated_cluster); };
numeral_cluster => { found_syllable (numeral_cluster); }; numeral_cluster => { found_syllable (numeral_cluster); };
symbol_cluster => { found_syllable (symbol_cluster); }; symbol_cluster => { found_syllable (symbol_cluster); };
broken_cluster => { found_syllable (broken_cluster); };
*|; *|;

View File

@ -160,6 +160,7 @@ enum syllable_type_t {
number_joiner_terminated_cluster, number_joiner_terminated_cluster,
numeral_cluster, numeral_cluster,
symbol_cluster, symbol_cluster,
broken_cluster,
}; };
#include "hb-ot-shape-complex-use-machine.hh" #include "hb-ot-shape-complex-use-machine.hh"
@ -317,7 +318,9 @@ reorder_syllable (const hb_ot_shape_plan_t *plan,
if (unlikely (!(FLAG_SAFE (syllable_type) & if (unlikely (!(FLAG_SAFE (syllable_type) &
(FLAG (virama_terminated_cluster) | (FLAG (virama_terminated_cluster) |
FLAG (consonant_cluster) | FLAG (consonant_cluster) |
FLAG (vowel_cluster))))) FLAG (vowel_cluster) |
FLAG (broken_cluster) |
0))))
return; return;
hb_glyph_info_t *info = buffer->info; hb_glyph_info_t *info = buffer->info;
@ -376,7 +379,6 @@ insert_dotted_circles (const hb_ot_shape_plan_t *plan HB_UNUSED,
hb_font_t *font, hb_font_t *font,
hb_buffer_t *buffer) hb_buffer_t *buffer)
{ {
#if 0
/* Note: This loop is extra overhead, but should not be measurable. */ /* Note: This loop is extra overhead, but should not be measurable. */
bool has_broken_syllables = false; bool has_broken_syllables = false;
unsigned int count = buffer->len; unsigned int count = buffer->len;
@ -391,6 +393,10 @@ insert_dotted_circles (const hb_ot_shape_plan_t *plan HB_UNUSED,
return; return;
hb_codepoint_t dottedcircle_glyph;
if (!font->get_glyph (0x25CCu, 0, &dottedcircle_glyph))
return;
hb_glyph_info_t dottedcircle = {0}; hb_glyph_info_t dottedcircle = {0};
if (!font->get_glyph (0x25CCu, 0, &dottedcircle.codepoint)) if (!font->get_glyph (0x25CCu, 0, &dottedcircle.codepoint))
return; return;
@ -412,6 +418,13 @@ insert_dotted_circles (const hb_ot_shape_plan_t *plan HB_UNUSED,
info.cluster = buffer->cur().cluster; info.cluster = buffer->cur().cluster;
info.mask = buffer->cur().mask; info.mask = buffer->cur().mask;
info.syllable() = buffer->cur().syllable(); info.syllable() = buffer->cur().syllable();
/* TODO Set glyph_props? */
/* Insert dottedcircle after possible Repha. */
while (buffer->idx < buffer->len &&
last_syllable == buffer->cur().syllable() &&
buffer->cur().use_category() == USE_R)
buffer->next_glyph ();
buffer->output_info (info); buffer->output_info (info);
} }
@ -420,7 +433,6 @@ insert_dotted_circles (const hb_ot_shape_plan_t *plan HB_UNUSED,
} }
buffer->swap_buffers (); buffer->swap_buffers ();
#endif
} }
static void static void