[pango] [OT] Hookup glib unicode funcs
- From: Behdad Esfahbod <behdad src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [pango] [OT] Hookup glib unicode funcs
- Date: Tue, 11 Aug 2009 14:13:03 +0000 (UTC)
commit 106c0db2c0d88d956a3e2184259c19948d9ea4b5
Author: Behdad Esfahbod <behdad behdad org>
Date: Mon Aug 10 23:40:28 2009 -0400
[OT] Hookup glib unicode funcs
pango/opentype/hb-buffer.c | 14 +++++++-------
pango/opentype/hb-glib.c | 4 +++-
pango/opentype/hb-glib.h | 4 ++--
pango/opentype/hb-ot-layout.cc | 10 +++++-----
pango/opentype/hb-private.h | 2 +-
pango/pango-ot-info.c | 2 ++
pango/pango-ot-private.h | 1 +
7 files changed, 21 insertions(+), 16 deletions(-)
---
diff --git a/pango/opentype/hb-buffer.c b/pango/opentype/hb-buffer.c
index 3341661..2a566b1 100644
--- a/pango/opentype/hb-buffer.c
+++ b/pango/opentype/hb-buffer.c
@@ -180,7 +180,7 @@ hb_buffer_set_direction (hb_buffer_t *buffer,
/* HarfBuzz-Internal API */
-HB_INTERNAL void
+void
_hb_buffer_clear_output (hb_buffer_t *buffer)
{
buffer->out_length = 0;
@@ -202,7 +202,7 @@ hb_buffer_clear_positions (hb_buffer_t *buffer)
memset (buffer->positions, 0, sizeof (buffer->positions[0]) * buffer->in_length);
}
-HB_INTERNAL void
+void
_hb_buffer_swap (hb_buffer_t *buffer)
{
unsigned int tmp;
@@ -244,7 +244,7 @@ _hb_buffer_swap (hb_buffer_t *buffer)
The cluster value for the glyph at position buffer->in_pos is used
for all replacement glyphs */
-HB_INTERNAL void
+void
_hb_buffer_add_output_glyphs (hb_buffer_t *buffer,
unsigned int num_in,
unsigned int num_out,
@@ -286,7 +286,7 @@ _hb_buffer_add_output_glyphs (hb_buffer_t *buffer,
}
-HB_INTERNAL void
+void
_hb_buffer_add_output_glyph (hb_buffer_t *buffer,
hb_codepoint_t glyph_index,
unsigned short component,
@@ -315,7 +315,7 @@ _hb_buffer_add_output_glyph (hb_buffer_t *buffer,
buffer->out_length = buffer->out_pos;
}
-HB_INTERNAL void
+void
_hb_buffer_next_glyph (hb_buffer_t *buffer)
{
if (buffer->out_string != buffer->in_string)
@@ -331,14 +331,14 @@ _hb_buffer_next_glyph (hb_buffer_t *buffer)
buffer->out_length = buffer->out_pos;
}
-HB_INTERNAL void
+void
_hb_buffer_replace_glyph (hb_buffer_t *buffer,
hb_codepoint_t glyph_index)
{
_hb_buffer_add_output_glyph (buffer, glyph_index, 0xFFFF, 0xFFFF);
}
-HB_INTERNAL unsigned short
+unsigned short
_hb_buffer_allocate_lig_id (hb_buffer_t *buffer)
{
return ++buffer->max_lig_id;
diff --git a/pango/opentype/hb-glib.c b/pango/opentype/hb-glib.c
index 3e4b450..c3c1153 100644
--- a/pango/opentype/hb-glib.c
+++ b/pango/opentype/hb-glib.c
@@ -40,7 +40,7 @@ static unsigned int hb_glib_get_eastasian_width_nil (hb_codepoint_t unicode) { r
hb_unicode_funcs_t *
-hb_glib_unicode_funcs_create (void)
+hb_glib_get_unicode_funcs (void)
{
if (HB_UNLIKELY (!glib_ufuncs)) {
glib_ufuncs = hb_unicode_funcs_create ();
@@ -50,6 +50,8 @@ hb_glib_unicode_funcs_create (void)
hb_unicode_funcs_set_script_func (glib_ufuncs, hb_glib_get_script_nil);
hb_unicode_funcs_set_combining_class_func (glib_ufuncs, hb_glib_get_combining_class_nil);
hb_unicode_funcs_set_eastasian_width_func (glib_ufuncs, hb_glib_get_eastasian_width_nil);
+
+ hb_unicode_funcs_make_immutable (glib_ufuncs);
}
return hb_unicode_funcs_reference (glib_ufuncs);
diff --git a/pango/opentype/hb-glib.h b/pango/opentype/hb-glib.h
index 6a7f550..6c94993 100644
--- a/pango/opentype/hb-glib.h
+++ b/pango/opentype/hb-glib.h
@@ -27,14 +27,14 @@
#ifndef HB_GLIB_H
#define HB_GLIB_H
-#include "hb-common.h"
+#include "hb.h"
#include "hb-unicode.h"
HB_BEGIN_DECLS
hb_unicode_funcs_t *
-hb_glib_unicode_funcs_create (void);
+hb_glib_get_unicode_funcs (void);
HB_END_DECLS
diff --git a/pango/opentype/hb-ot-layout.cc b/pango/opentype/hb-ot-layout.cc
index fd7deb6..8d0a25a 100644
--- a/pango/opentype/hb-ot-layout.cc
+++ b/pango/opentype/hb-ot-layout.cc
@@ -101,7 +101,7 @@ hb_ot_layout_has_font_glyph_classes (hb_face_t *face)
return _get_gdef (face).has_glyph_classes ();
}
-HB_INTERNAL hb_bool_t
+hb_bool_t
_hb_ot_layout_has_new_glyph_classes (hb_face_t *face)
{
return face->ot_layout.new_gdef.len > 0;
@@ -131,7 +131,7 @@ _hb_ot_layout_get_glyph_property (hb_face_t *face,
}
}
-HB_INTERNAL hb_bool_t
+hb_bool_t
_hb_ot_layout_check_glyph_property (hb_face_t *face,
hb_internal_glyph_info_t *ginfo,
unsigned int lookup_flags,
@@ -170,7 +170,7 @@ _hb_ot_layout_check_glyph_property (hb_face_t *face,
return true;
}
-HB_INTERNAL hb_bool_t
+hb_bool_t
_hb_ot_layout_skip_mark (hb_face_t *face,
hb_internal_glyph_info_t *ginfo,
unsigned int lookup_flags,
@@ -203,7 +203,7 @@ _hb_ot_layout_skip_mark (hb_face_t *face,
return false;
}
-HB_INTERNAL void
+void
_hb_ot_layout_set_glyph_class (hb_face_t *face,
hb_codepoint_t glyph,
hb_ot_layout_glyph_class_t klass)
@@ -252,7 +252,7 @@ _hb_ot_layout_set_glyph_class (hb_face_t *face,
return;
}
-HB_INTERNAL void
+void
_hb_ot_layout_set_glyph_property (hb_face_t *face,
hb_codepoint_t glyph,
unsigned int property)
diff --git a/pango/opentype/hb-private.h b/pango/opentype/hb-private.h
index 98b322f..dbeafef 100644
--- a/pango/opentype/hb-private.h
+++ b/pango/opentype/hb-private.h
@@ -106,7 +106,7 @@ typedef GStaticMutex hb_mutex_t;
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#ifndef HB_INTERNAL
-# define HB_INTERNAL
+# define HB_INTERNAL extern
#endif
#ifndef NULL
diff --git a/pango/pango-ot-info.c b/pango/pango-ot-info.c
index 9dd34ff..a4d54fd 100644
--- a/pango/pango-ot-info.c
+++ b/pango/pango-ot-info.c
@@ -128,6 +128,8 @@ pango_ot_info_get (FT_Face face)
info->hb_face = hb_face_create_for_data (blob, face->face_index);
hb_blob_destroy (blob);
+ hb_face_set_unicode_funcs (info->hb_face, hb_glib_get_unicode_funcs ());
+
/* XXX this is such a waste if not SFNT */
if (!hb_ot_layout_has_font_glyph_classes (info->hb_face))
synthesize_class_def (info);
diff --git a/pango/pango-ot-private.h b/pango/pango-ot-private.h
index 9b0f84e..a011b74 100644
--- a/pango/pango-ot-private.h
+++ b/pango/pango-ot-private.h
@@ -26,6 +26,7 @@
#include <pango/pango-ot.h>
#include "opentype/hb-ot.h"
+#include "opentype/hb-glib.h"
G_BEGIN_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]