Imported Upstream version 1.7.6
[platform/upstream/harfbuzz.git] / src / hb-font-private.hh
index fbb16a0..992152f 100644 (file)
@@ -108,6 +108,8 @@ struct hb_font_t {
   unsigned int x_ppem;
   unsigned int y_ppem;
 
+  float ptem;
+
   /* Font variation coordinates. */
   unsigned int num_coords;
   int *coords;
@@ -116,16 +118,6 @@ struct hb_font_t {
   void              *user_data;
   hb_destroy_func_t  destroy;
 
-  enum dirty_t {
-    NOTHING    = 0x0000,
-    FACE       = 0x0001,
-    PARENT     = 0x0002,
-    FUNCS      = 0x0004,
-    SCALE      = 0x0008,
-    PPEM       = 0x0010,
-    VARIATIONS = 0x0020,
-  } dirty;
-
   struct hb_shaper_data_t shaper_data;
 
 
@@ -136,6 +128,8 @@ struct hb_font_t {
   inline hb_position_t em_scale_y (int16_t v) { return em_scale (v, y_scale); }
   inline hb_position_t em_scalef_x (float v) { return em_scalef (v, this->x_scale); }
   inline hb_position_t em_scalef_y (float v) { return em_scalef (v, this->y_scale); }
+  inline float em_fscale_x (int16_t v) { return em_fscale (v, x_scale); }
+  inline float em_fscale_y (int16_t v) { return em_fscale (v, y_scale); }
   inline hb_position_t em_scale_dir (int16_t v, hb_direction_t direction)
   { return em_scale (v, dir_scale (direction)); }
 
@@ -549,12 +543,14 @@ struct hb_font_t {
   }
   inline hb_position_t em_scalef (float v, int scale)
   {
-    return (hb_position_t) (v * scale / face->get_upem ());
+    return (hb_position_t) round (v * scale / face->get_upem ());
+  }
+  inline float em_fscale (int16_t v, int scale)
+  {
+    return (float) v * scale / face->get_upem ();
   }
 };
 
-HB_MARK_AS_FLAG_T (hb_font_t::dirty_t);
-
 #define HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS
 #define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_PROTOTYPE(shaper, font);
 #include "hb-shaper-list.hh"