[pango] [HB] Add font funcs prototypes



commit 0a8034ea52c1297e330e75ce5cccb3a6bf602fff
Author: Behdad Esfahbod <behdad behdad org>
Date:   Tue Aug 18 18:37:36 2009 -0400

    [HB] Add font funcs prototypes

 pango/opentype/hb-font-private.h |    2 --
 pango/opentype/hb-font.cc        |   14 ++++++--------
 pango/opentype/hb-font.h         |   23 ++++++++++++++++-------
 3 files changed, 22 insertions(+), 17 deletions(-)
---
diff --git a/pango/opentype/hb-font-private.h b/pango/opentype/hb-font-private.h
index efd7109..8d921c7 100644
--- a/pango/opentype/hb-font-private.h
+++ b/pango/opentype/hb-font-private.h
@@ -45,12 +45,10 @@ struct _hb_font_funcs_t {
 
   hb_bool_t immutable;
 
-  /*
   hb_font_get_glyph_func_t glyph_func;
   hb_font_get_contour_point_func_t contour_point_func;
   hb_font_get_glyph_metrics_func_t glyph_metrics_func;
   hb_font_get_kerning_func_t kerning_func;
-  */
 };
 
 HB_INTERNAL hb_font_funcs_t
diff --git a/pango/opentype/hb-font.cc b/pango/opentype/hb-font.cc
index b090ad9..df3d80b 100644
--- a/pango/opentype/hb-font.cc
+++ b/pango/opentype/hb-font.cc
@@ -40,14 +40,12 @@
 hb_font_funcs_t _hb_font_funcs_nil = {
   HB_REFERENCE_COUNT_INVALID, /* ref_count */
 
-  TRUE  /* immutable */
-
-  /*
-  hb_font_get_glyph_func_t glyph_func;
-  hb_font_get_contour_point_func_t contour_point_func;
-  hb_font_get_glyph_metrics_func_t glyph_metrics_func;
-  hb_font_get_kerning_func_t kerning_func;
-  */
+  TRUE,  /* immutable */
+
+  NULL, /* glyph_func */
+  NULL, /* contour_point_func */
+  NULL, /* glyph_metrics_func */
+  NULL  /* kerning_func */
 };
 
 hb_font_funcs_t *
diff --git a/pango/opentype/hb-font.h b/pango/opentype/hb-font.h
index 26e49bb..f65ba71 100644
--- a/pango/opentype/hb-font.h
+++ b/pango/opentype/hb-font.h
@@ -33,13 +33,13 @@
 
 HB_BEGIN_DECLS
 
+typedef struct _hb_face_t hb_face_t;
+typedef struct _hb_font_t hb_font_t;
 
 /*
  * hb_face_t
  */
 
-typedef struct _hb_face_t hb_face_t;
-
 hb_face_t *
 hb_face_create_for_data (hb_blob_t    *blob,
 			 unsigned int  index);
@@ -94,7 +94,20 @@ hb_font_funcs_copy (hb_font_funcs_t *ffuncs);
 void
 hb_font_funcs_make_immutable (hb_font_funcs_t *ffuncs);
 
-/*
+
+/* funcs */
+
+typedef struct _hb_glyph_metrics_t hb_glyph_metrics_t;
+
+typedef hb_codepoint_t (*hb_font_get_glyph_func_t) (hb_font_t *font, hb_face_t *face, const void *user_data,
+						    hb_codepoint_t unicode, hb_codepoint_t variant_selector);
+typedef hb_bool_t (*hb_font_get_contour_point_func_t) (hb_font_t *font, hb_face_t *face, const void *user_data,
+						       hb_codepoint_t glyph, hb_position_t *x, hb_position_t *y);
+typedef void (*hb_font_get_glyph_metrics_func_t) (hb_font_t *font, hb_face_t *face, const void *user_data,
+						  hb_codepoint_t glyph, hb_glyph_metrics_t *metrics);
+typedef hb_position_t (*hb_font_get_kerning_func_t) (hb_font_t *font, hb_face_t *face, const void *user_data,
+						     hb_codepoint_t first_glyph, hb_codepoint_t second_glyph);
+
 
 void
 hb_font_funcs_set_glyph_func (hb_font_funcs_t *ffuncs,
@@ -112,8 +125,6 @@ void
 hb_font_funcs_set_kerning_func (hb_font_funcs_t *ffuncs,
 				hb_font_get_kerning_func_t kerning_func);
 
-*/
-
 
 /*
  * hb_font_t
@@ -121,8 +132,6 @@ hb_font_funcs_set_kerning_func (hb_font_funcs_t *ffuncs,
 
 /* Fonts are very light-weight objects */
 
-typedef struct _hb_font_t hb_font_t;
-
 hb_font_t *
 hb_font_create (void);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]