Separate fallback kern vs mark positioning
authorBehdad Esfahbod <behdad@behdad.org>
Tue, 9 Oct 2018 03:30:24 +0000 (23:30 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Tue, 9 Oct 2018 03:30:24 +0000 (23:30 -0400)
src/hb-ot-shape-fallback.cc
src/hb-ot-shape-fallback.hh
src/hb-ot-shape.cc
src/hb-ot-shape.hh

index fb7db1d..e1dd603 100644 (file)
@@ -162,9 +162,9 @@ recategorize_combining_class (hb_codepoint_t u,
 }
 
 void
-_hb_ot_shape_fallback_position_recategorize_marks (const hb_ot_shape_plan_t *plan HB_UNUSED,
-                                                  hb_font_t *font HB_UNUSED,
-                                                  hb_buffer_t  *buffer)
+_hb_ot_shape_fallback_mark_position_recategorize_marks (const hb_ot_shape_plan_t *plan HB_UNUSED,
+                                                       hb_font_t *font HB_UNUSED,
+                                                       hb_buffer_t  *buffer)
 {
   unsigned int count = buffer->len;
   hb_glyph_info_t *info = buffer->info;
@@ -417,9 +417,9 @@ position_cluster (const hb_ot_shape_plan_t *plan,
 }
 
 void
-_hb_ot_shape_fallback_position (const hb_ot_shape_plan_t *plan,
-                               hb_font_t *font,
-                               hb_buffer_t  *buffer)
+_hb_ot_shape_fallback_mark_position (const hb_ot_shape_plan_t *plan,
+                                    hb_font_t *font,
+                                    hb_buffer_t  *buffer)
 {
   _hb_buffer_assert_gsubgpos_vars (buffer);
 
index 730e7f2..12f18ed 100644 (file)
 #include "hb-ot-shape.hh"
 
 
-HB_INTERNAL void _hb_ot_shape_fallback_position (const hb_ot_shape_plan_t *plan,
-                                                hb_font_t *font,
-                                                hb_buffer_t  *buffer);
+HB_INTERNAL void _hb_ot_shape_fallback_mark_position (const hb_ot_shape_plan_t *plan,
+                                                     hb_font_t *font,
+                                                     hb_buffer_t  *buffer);
 
-HB_INTERNAL void _hb_ot_shape_fallback_position_recategorize_marks (const hb_ot_shape_plan_t *plan,
-                                                                   hb_font_t *font,
-                                                                   hb_buffer_t  *buffer);
+HB_INTERNAL void _hb_ot_shape_fallback_mark_position_recategorize_marks (const hb_ot_shape_plan_t *plan,
+                                                                        hb_font_t *font,
+                                                                        hb_buffer_t  *buffer);
 
 
 HB_INTERNAL void _hb_ot_shape_fallback_kern (const hb_ot_shape_plan_t *plan,
index d3cf7e1..b8136b4 100644 (file)
@@ -70,7 +70,8 @@ hb_ot_shape_planner_t::compile (hb_ot_shape_plan_t &plan,
                      plan.shaper->gpos_tag != plan.map.chosen_script[1];
   plan.apply_gpos = !disable_gpos && hb_ot_layout_has_positioning (face);
 
-  plan.fallback_positioning = !plan.apply_gpos;
+  plan.fallback_kerning = !plan.apply_gpos;
+  plan.fallback_mark_positioning = !plan.apply_gpos;
   plan.fallback_glyph_classes = !hb_ot_layout_has_glyph_classes (face);
 }
 
@@ -648,8 +649,8 @@ hb_ot_substitute_default (const hb_ot_shape_context_t *c)
   hb_ot_shape_setup_masks (c);
 
   /* This is unfortunate to go here, but necessary... */
-  if (c->plan->fallback_positioning)
-    _hb_ot_shape_fallback_position_recategorize_marks (c->plan, c->font, buffer);
+  if (c->plan->fallback_mark_positioning)
+    _hb_ot_shape_fallback_mark_position_recategorize_marks (c->plan, c->font, buffer);
 
   hb_ot_map_glyphs_fast (buffer);
 
@@ -762,7 +763,7 @@ hb_ot_position_complex (const hb_ot_shape_context_t *c)
    * If fallback positinoing happens or GPOS is present, we don't
    * care.
    */
-  bool adjust_offsets_when_zeroing = c->plan->fallback_positioning &&
+  bool adjust_offsets_when_zeroing = c->plan->fallback_mark_positioning &&
                                     !c->plan->shaper->fallback_position &&
                                     HB_DIRECTION_IS_FORWARD (c->buffer->props.direction);
 
@@ -826,15 +827,15 @@ hb_ot_position (const hb_ot_shape_context_t *c)
 
   hb_ot_position_complex (c);
 
-  if (c->plan->fallback_positioning && c->plan->shaper->fallback_position)
-    _hb_ot_shape_fallback_position (c->plan, c->font, c->buffer);
+  if (c->plan->fallback_mark_positioning && c->plan->shaper->fallback_position)
+    _hb_ot_shape_fallback_mark_position (c->plan, c->font, c->buffer);
 
   if (HB_DIRECTION_IS_BACKWARD (c->buffer->props.direction))
     hb_buffer_reverse (c->buffer);
 
   /* Visual fallback goes here. */
 
-  if (c->plan->fallback_positioning)
+  if (c->plan->fallback_kerning)
     _hb_ot_shape_fallback_kern (c->plan, c->font, c->buffer);
 
   _hb_buffer_deallocate_gsubgpos_vars (c->buffer);
index 23c385a..7a1e385 100644 (file)
@@ -46,11 +46,11 @@ struct hb_ot_shape_plan_t
   bool has_frac : 1;
   bool kerning_requested : 1;
   bool has_gpos_mark : 1;
-  bool fallback_positioning : 1;
   bool fallback_glyph_classes : 1;
+  bool fallback_kerning : 1;
+  bool fallback_mark_positioning : 1;
 
   bool apply_morx : 1;
-
   bool apply_gpos : 1;