Imported Upstream version 2.6.4
[platform/upstream/harfbuzz.git] / src / hb-ot-shape-complex-arabic.cc
index bdebde0..f92e637 100644 (file)
@@ -25,6 +25,9 @@
  */
 
 #include "hb.hh"
+
+#ifndef HB_NO_OT_SHAPE
+
 #include "hb-ot-shape-complex-arabic.hh"
 #include "hb-ot-shape.hh"
 
@@ -383,6 +386,10 @@ arabic_fallback_shape (const hb_ot_shape_plan_t *plan,
                       hb_font_t *font,
                       hb_buffer_t *buffer)
 {
+#ifdef HB_NO_OT_SHAPE_COMPLEX_ARABIC_FALLBACK
+  return;
+#endif
+
   const arabic_shape_plan_t *arabic_plan = (const arabic_shape_plan_t *) plan->data;
 
   if (!arabic_plan->do_fallback)
@@ -469,13 +476,13 @@ apply_stch (const hb_ot_shape_plan_t *plan HB_UNUSED,
     {
       if (!hb_in_range<uint8_t> (info[i - 1].arabic_shaping_action(), STCH_FIXED, STCH_REPEATING))
       {
-        if (step == CUT)
+       if (step == CUT)
        {
          --j;
          info[j] = info[i - 1];
          pos[j] = pos[i - 1];
        }
-        continue;
+       continue;
       }
 
       /* Yay, justification! */
@@ -533,10 +540,10 @@ apply_stch (const hb_ot_shape_plan_t *plan HB_UNUSED,
       hb_position_t shortfall = sign * w_remaining - sign * w_repeating * (n_copies + 1);
       if (shortfall > 0 && n_repeating > 0)
       {
-        ++n_copies;
-        hb_position_t excess = (n_copies + 1) * sign * w_repeating - sign * w_remaining;
-        if (excess > 0)
-          extra_repeat_overlap = excess / (n_copies * n_repeating);
+       ++n_copies;
+       hb_position_t excess = (n_copies + 1) * sign * w_repeating - sign * w_remaining;
+       if (excess > 0)
+         extra_repeat_overlap = excess / (n_copies * n_repeating);
       }
 
       if (step == MEASURE)
@@ -576,7 +583,7 @@ apply_stch (const hb_ot_shape_plan_t *plan HB_UNUSED,
     if (step == MEASURE)
     {
       if (unlikely (!buffer->ensure (count + extra_glyphs_needed)))
-        break;
+       break;
     }
     else
     {
@@ -706,3 +713,6 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_arabic =
   HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE,
   true, /* fallback_position */
 };
+
+
+#endif