< prev index next >
src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-use.cc
Print this page
@@ -142,11 +142,11 @@
map->add_gsub_pause (reorder);
/* "Topographical features" */
for (unsigned int i = 0; i < ARRAY_LENGTH (arabic_features); i++)
map->add_feature (arabic_features[i], 1, F_NONE);
- map->add_gsub_pause (NULL);
+ map->add_gsub_pause (nullptr);
/* "Standard typographic presentation" and "Positional feature application" */
for (unsigned int i = 0; i < ARRAY_LENGTH (other_features); i++)
map->add_feature (other_features[i], 1, F_GLOBAL | F_MANUAL_ZWJ);
}
@@ -197,21 +197,21 @@
static void *
data_create_use (const hb_ot_shape_plan_t *plan)
{
use_shape_plan_t *use_plan = (use_shape_plan_t *) calloc (1, sizeof (use_shape_plan_t));
if (unlikely (!use_plan))
- return NULL;
+ return nullptr;
use_plan->rphf_mask = plan->map.get_1_mask (HB_TAG('r','p','h','f'));
if (has_arabic_joining (plan->props.script))
{
use_plan->arabic_plan = (arabic_shape_plan_t *) data_create_arabic (plan);
if (unlikely (!use_plan->arabic_plan))
{
free (use_plan);
- return NULL;
+ return nullptr;
}
}
return use_plan;
}
@@ -290,11 +290,11 @@
{
const use_shape_plan_t *use_plan = (const use_shape_plan_t *) plan->data;
if (use_plan->arabic_plan)
return;
- ASSERT_STATIC (INIT < 4 && ISOL < 4 && MEDI < 4 && FINA < 4);
+ static_assert ((INIT < 4 && ISOL < 4 && MEDI < 4 && FINA < 4), "");
hb_mask_t masks[4], all_masks = 0;
for (unsigned int i = 0; i < 4; i++)
{
masks[i] = plan->map.get_1_mask (arabic_features[i]);
if (masks[i] == plan->map.get_global_mask ())
@@ -352,10 +352,12 @@
setup_syllables (const hb_ot_shape_plan_t *plan,
hb_font_t *font HB_UNUSED,
hb_buffer_t *buffer)
{
find_syllables (buffer);
+ foreach_syllable (buffer, start, end)
+ buffer->unsafe_to_break (start, end);
setup_rphf_mask (plan, buffer);
setup_topographical_masks (plan, buffer);
}
static void
@@ -420,11 +422,11 @@
static void
reorder_syllable (hb_buffer_t *buffer, unsigned int start, unsigned int end)
{
syllable_type_t syllable_type = (syllable_type_t) (buffer->info[start].syllable() & 0x0F);
/* Only a few syllable types need reordering. */
- if (unlikely (!(FLAG_SAFE (syllable_type) &
+ if (unlikely (!(FLAG_UNSAFE (syllable_type) &
(FLAG (virama_terminated_cluster) |
FLAG (standard_cluster) |
FLAG (broken_cluster) |
0))))
return;
@@ -570,32 +572,10 @@
* Special case where the Unicode decomp gives matras in the wrong order
* for cluster validation.
*/
case 0x1112Eu : *a = 0x11127u; *b= 0x11131u; return true;
case 0x1112Fu : *a = 0x11127u; *b= 0x11132u; return true;
-
- /*
- * Decompose split matras that don't have Unicode decompositions.
- */
-
- /* Limbu */
- case 0x1925u : *a = 0x1920u; *b= 0x1923u; return true;
- case 0x1926u : *a = 0x1920u; *b= 0x1924u; return true;
-
- /* Balinese */
- case 0x1B3Cu : *a = 0x1B42u; *b= 0x1B3Cu; return true;
-
-#if 0
- /* Lepcha */
- case 0x1C29u : *a = no decomp, -> LEFT; return true;
-
- /* Javanese */
- case 0xA9C0u : *a = no decomp, -> RIGHT; return true;
-
- /* Sharada */
- case 0x111BFu : *a = no decomp, -> ABOVE; return true;
-#endif
}
return (bool) c->unicode->decompose (ab, a, b);
}
@@ -613,20 +593,20 @@
}
const hb_ot_complex_shaper_t _hb_ot_complex_shaper_use =
{
- "use",
collect_features_use,
- NULL, /* override_features */
+ nullptr, /* override_features */
data_create_use,
data_destroy_use,
- NULL, /* preprocess_text */
- NULL, /* postprocess_glyphs */
+ nullptr, /* preprocess_text */
+ nullptr, /* postprocess_glyphs */
HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT,
decompose_use,
compose_use,
setup_masks_use,
- NULL, /* disable_otl */
+ nullptr, /* disable_otl */
+ nullptr, /* reorder_marks */
HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_EARLY,
false, /* fallback_position */
};
< prev index next >