Imported Upstream version 1.7.6
[platform/upstream/harfbuzz.git] / src / hb-fallback-shape.cc
index 9d061a9..3f09c3f 100644 (file)
 #include "hb-shaper-impl-private.hh"
 
 
+HB_SHAPER_DATA_ENSURE_DEFINE(fallback, face)
+HB_SHAPER_DATA_ENSURE_DEFINE(fallback, font)
+
+
 /*
  * shaper face data
  */
@@ -73,7 +77,9 @@ struct hb_fallback_shaper_shape_plan_data_t {};
 hb_fallback_shaper_shape_plan_data_t *
 _hb_fallback_shaper_shape_plan_data_create (hb_shape_plan_t    *shape_plan HB_UNUSED,
                                            const hb_feature_t *user_features HB_UNUSED,
-                                           unsigned int        num_user_features HB_UNUSED)
+                                           unsigned int        num_user_features HB_UNUSED,
+                                           const int          *coords HB_UNUSED,
+                                           unsigned int        num_coords HB_UNUSED)
 {
   return (hb_fallback_shaper_shape_plan_data_t *) HB_SHAPER_DATA_SUCCEEDED;
 }
@@ -106,7 +112,7 @@ _hb_fallback_shape (hb_shape_plan_t    *shape_plan HB_UNUSED,
    */
 
   hb_codepoint_t space;
-  bool has_space = font->get_glyph (' ', 0, &space);
+  bool has_space = (bool) font->get_nominal_glyph (' ', &space);
 
   buffer->clear_positions ();
 
@@ -123,7 +129,7 @@ _hb_fallback_shape (hb_shape_plan_t    *shape_plan HB_UNUSED,
       pos[i].y_advance = 0;
       continue;
     }
-    font->get_glyph (info[i].codepoint, 0, &info[i].codepoint);
+    (void) font->get_nominal_glyph (info[i].codepoint, &info[i].codepoint);
     font->get_glyph_advance_for_direction (info[i].codepoint,
                                           direction,
                                           &pos[i].x_advance,
@@ -137,5 +143,7 @@ _hb_fallback_shape (hb_shape_plan_t    *shape_plan HB_UNUSED,
   if (HB_DIRECTION_IS_BACKWARD (direction))
     hb_buffer_reverse (buffer);
 
+  buffer->safe_to_break_all ();
+
   return true;
 }