Imported Upstream version 2.3.1
[platform/upstream/harfbuzz.git] / src / hb-font.h
index c95b61d..e2086d8 100644 (file)
@@ -110,7 +110,7 @@ typedef struct hb_glyph_extents_t
 /* func types */
 
 typedef hb_bool_t (*hb_font_get_font_extents_func_t) (hb_font_t *font, void *font_data,
-                                                      hb_font_extents_t *metrics,
+                                                      hb_font_extents_t *extents,
                                                       void *user_data);
 typedef hb_font_get_font_extents_func_t hb_font_get_font_h_extents_func_t;
 typedef hb_font_get_font_extents_func_t hb_font_get_font_v_extents_func_t;
@@ -125,6 +125,14 @@ typedef hb_bool_t (*hb_font_get_variation_glyph_func_t) (hb_font_t *font, void *
                                                         hb_codepoint_t *glyph,
                                                         void *user_data);
 
+typedef unsigned int (*hb_font_get_nominal_glyphs_func_t) (hb_font_t *font, void *font_data,
+                                                          unsigned int count,
+                                                          const hb_codepoint_t *first_unicode,
+                                                          unsigned int unicode_stride,
+                                                          hb_codepoint_t *first_glyph,
+                                                          unsigned int glyph_stride,
+                                                          void *user_data);
+
 
 typedef hb_position_t (*hb_font_get_glyph_advance_func_t) (hb_font_t *font, void *font_data,
                                                           hb_codepoint_t glyph,
@@ -132,6 +140,16 @@ typedef hb_position_t (*hb_font_get_glyph_advance_func_t) (hb_font_t *font, void
 typedef hb_font_get_glyph_advance_func_t hb_font_get_glyph_h_advance_func_t;
 typedef hb_font_get_glyph_advance_func_t hb_font_get_glyph_v_advance_func_t;
 
+typedef void (*hb_font_get_glyph_advances_func_t) (hb_font_t* font, void* font_data,
+                                                  unsigned int count,
+                                                  const hb_codepoint_t *first_glyph,
+                                                  unsigned glyph_stride,
+                                                  hb_position_t *first_advance,
+                                                  unsigned advance_stride,
+                                                  void *user_data);
+typedef hb_font_get_glyph_advances_func_t hb_font_get_glyph_h_advances_func_t;
+typedef hb_font_get_glyph_advances_func_t hb_font_get_glyph_v_advances_func_t;
+
 typedef hb_bool_t (*hb_font_get_glyph_origin_func_t) (hb_font_t *font, void *font_data,
                                                      hb_codepoint_t glyph,
                                                      hb_position_t *x, hb_position_t *y,
@@ -139,12 +157,6 @@ typedef hb_bool_t (*hb_font_get_glyph_origin_func_t) (hb_font_t *font, void *fon
 typedef hb_font_get_glyph_origin_func_t hb_font_get_glyph_h_origin_func_t;
 typedef hb_font_get_glyph_origin_func_t hb_font_get_glyph_v_origin_func_t;
 
-typedef hb_position_t (*hb_font_get_glyph_kerning_func_t) (hb_font_t *font, void *font_data,
-                                                          hb_codepoint_t first_glyph, hb_codepoint_t second_glyph,
-                                                          void *user_data);
-typedef hb_font_get_glyph_kerning_func_t hb_font_get_glyph_h_kerning_func_t;
-typedef hb_font_get_glyph_kerning_func_t hb_font_get_glyph_v_kerning_func_t;
-
 
 typedef hb_bool_t (*hb_font_get_glyph_extents_func_t) (hb_font_t *font, void *font_data,
                                                       hb_codepoint_t glyph,
@@ -217,6 +229,22 @@ hb_font_funcs_set_nominal_glyph_func (hb_font_funcs_t *ffuncs,
                                      void *user_data, hb_destroy_func_t destroy);
 
 /**
+ * hb_font_funcs_set_nominal_glyphs_func:
+ * @ffuncs: font functions.
+ * @func: (closure user_data) (destroy destroy) (scope notified):
+ * @user_data:
+ * @destroy:
+ *
+ *
+ *
+ * Since: 2.0.0
+ **/
+HB_EXTERN void
+hb_font_funcs_set_nominal_glyphs_func (hb_font_funcs_t *ffuncs,
+                                      hb_font_get_nominal_glyphs_func_t func,
+                                      void *user_data, hb_destroy_func_t destroy);
+
+/**
  * hb_font_funcs_set_variation_glyph_func:
  * @ffuncs: font functions.
  * @func: (closure user_data) (destroy destroy) (scope notified):
@@ -265,7 +293,7 @@ hb_font_funcs_set_glyph_v_advance_func (hb_font_funcs_t *ffuncs,
                                        void *user_data, hb_destroy_func_t destroy);
 
 /**
- * hb_font_funcs_set_glyph_h_origin_func:
+ * hb_font_funcs_set_glyph_h_advances_func:
  * @ffuncs: font functions.
  * @func: (closure user_data) (destroy destroy) (scope notified):
  * @user_data:
@@ -273,15 +301,15 @@ hb_font_funcs_set_glyph_v_advance_func (hb_font_funcs_t *ffuncs,
  *
  * 
  *
- * Since: 0.9.2
+ * Since: 1.8.6
  **/
 HB_EXTERN void
-hb_font_funcs_set_glyph_h_origin_func (hb_font_funcs_t *ffuncs,
-                                      hb_font_get_glyph_h_origin_func_t func,
-                                      void *user_data, hb_destroy_func_t destroy);
+hb_font_funcs_set_glyph_h_advances_func (hb_font_funcs_t *ffuncs,
+                                       hb_font_get_glyph_h_advances_func_t func,
+                                       void *user_data, hb_destroy_func_t destroy);
 
 /**
- * hb_font_funcs_set_glyph_v_origin_func:
+ * hb_font_funcs_set_glyph_v_advances_func:
  * @ffuncs: font functions.
  * @func: (closure user_data) (destroy destroy) (scope notified):
  * @user_data:
@@ -289,15 +317,15 @@ hb_font_funcs_set_glyph_h_origin_func (hb_font_funcs_t *ffuncs,
  *
  * 
  *
- * Since: 0.9.2
+ * Since: 1.8.6
  **/
 HB_EXTERN void
-hb_font_funcs_set_glyph_v_origin_func (hb_font_funcs_t *ffuncs,
-                                      hb_font_get_glyph_v_origin_func_t func,
-                                      void *user_data, hb_destroy_func_t destroy);
+hb_font_funcs_set_glyph_v_advances_func (hb_font_funcs_t *ffuncs,
+                                       hb_font_get_glyph_v_advances_func_t func,
+                                       void *user_data, hb_destroy_func_t destroy);
 
 /**
- * hb_font_funcs_set_glyph_h_kerning_func:
+ * hb_font_funcs_set_glyph_h_origin_func:
  * @ffuncs: font functions.
  * @func: (closure user_data) (destroy destroy) (scope notified):
  * @user_data:
@@ -308,12 +336,12 @@ hb_font_funcs_set_glyph_v_origin_func (hb_font_funcs_t *ffuncs,
  * Since: 0.9.2
  **/
 HB_EXTERN void
-hb_font_funcs_set_glyph_h_kerning_func (hb_font_funcs_t *ffuncs,
-                                       hb_font_get_glyph_h_kerning_func_t func,
-                                       void *user_data, hb_destroy_func_t destroy);
+hb_font_funcs_set_glyph_h_origin_func (hb_font_funcs_t *ffuncs,
+                                      hb_font_get_glyph_h_origin_func_t func,
+                                      void *user_data, hb_destroy_func_t destroy);
 
 /**
- * hb_font_funcs_set_glyph_v_kerning_func:
+ * hb_font_funcs_set_glyph_v_origin_func:
  * @ffuncs: font functions.
  * @func: (closure user_data) (destroy destroy) (scope notified):
  * @user_data:
@@ -324,9 +352,9 @@ hb_font_funcs_set_glyph_h_kerning_func (hb_font_funcs_t *ffuncs,
  * Since: 0.9.2
  **/
 HB_EXTERN void
-hb_font_funcs_set_glyph_v_kerning_func (hb_font_funcs_t *ffuncs,
-                                       hb_font_get_glyph_v_kerning_func_t func,
-                                       void *user_data, hb_destroy_func_t destroy);
+hb_font_funcs_set_glyph_v_origin_func (hb_font_funcs_t *ffuncs,
+                                      hb_font_get_glyph_v_origin_func_t func,
+                                      void *user_data, hb_destroy_func_t destroy);
 
 /**
  * hb_font_funcs_set_glyph_extents_func:
@@ -417,6 +445,21 @@ HB_EXTERN hb_position_t
 hb_font_get_glyph_v_advance (hb_font_t *font,
                             hb_codepoint_t glyph);
 
+HB_EXTERN void
+hb_font_get_glyph_h_advances (hb_font_t* font,
+                             unsigned int count,
+                             const hb_codepoint_t *first_glyph,
+                             unsigned glyph_stride,
+                             hb_position_t *first_advance,
+                             unsigned advance_stride);
+HB_EXTERN void
+hb_font_get_glyph_v_advances (hb_font_t* font,
+                             unsigned int count,
+                             const hb_codepoint_t *first_glyph,
+                             unsigned glyph_stride,
+                             hb_position_t *first_advance,
+                             unsigned advance_stride);
+
 HB_EXTERN hb_bool_t
 hb_font_get_glyph_h_origin (hb_font_t *font,
                            hb_codepoint_t glyph,
@@ -426,13 +469,6 @@ hb_font_get_glyph_v_origin (hb_font_t *font,
                            hb_codepoint_t glyph,
                            hb_position_t *x, hb_position_t *y);
 
-HB_EXTERN hb_position_t
-hb_font_get_glyph_h_kerning (hb_font_t *font,
-                            hb_codepoint_t left_glyph, hb_codepoint_t right_glyph);
-HB_EXTERN hb_position_t
-hb_font_get_glyph_v_kerning (hb_font_t *font,
-                            hb_codepoint_t top_glyph, hb_codepoint_t bottom_glyph);
-
 HB_EXTERN hb_bool_t
 hb_font_get_glyph_extents (hb_font_t *font,
                           hb_codepoint_t glyph,
@@ -472,6 +508,14 @@ hb_font_get_glyph_advance_for_direction (hb_font_t *font,
                                         hb_direction_t direction,
                                         hb_position_t *x, hb_position_t *y);
 HB_EXTERN void
+hb_font_get_glyph_advances_for_direction (hb_font_t* font,
+                                         hb_direction_t direction,
+                                         unsigned int count,
+                                         const hb_codepoint_t *first_glyph,
+                                         unsigned glyph_stride,
+                                         hb_position_t *first_advance,
+                                         unsigned advance_stride);
+HB_EXTERN void
 hb_font_get_glyph_origin_for_direction (hb_font_t *font,
                                        hb_codepoint_t glyph,
                                        hb_direction_t direction,
@@ -487,12 +531,6 @@ hb_font_subtract_glyph_origin_for_direction (hb_font_t *font,
                                             hb_direction_t direction,
                                             hb_position_t *x, hb_position_t *y);
 
-HB_EXTERN void
-hb_font_get_glyph_kerning_for_direction (hb_font_t *font,
-                                        hb_codepoint_t first_glyph, hb_codepoint_t second_glyph,
-                                        hb_direction_t direction,
-                                        hb_position_t *x, hb_position_t *y);
-
 HB_EXTERN hb_bool_t
 hb_font_get_glyph_extents_for_origin (hb_font_t *font,
                                      hb_codepoint_t glyph,