summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2009-08-10 23:40:28 -0400
committerBehdad Esfahbod <behdad@behdad.org>2009-08-10 23:40:28 -0400
commit106c0db2c0d88d956a3e2184259c19948d9ea4b5 (patch)
tree888c0c289ff421f120567ffb9de80a3eafe775d0
parent5586ef604f0212f8edebbbffbe7596d3bdca3474 (diff)
downloadpango-106c0db2c0d88d956a3e2184259c19948d9ea4b5.tar.gz
[OT] Hookup glib unicode funcs
-rw-r--r--pango/opentype/hb-buffer.c14
-rw-r--r--pango/opentype/hb-glib.c4
-rw-r--r--pango/opentype/hb-glib.h4
-rw-r--r--pango/opentype/hb-ot-layout.cc10
-rw-r--r--pango/opentype/hb-private.h2
-rw-r--r--pango/pango-ot-info.c2
-rw-r--r--pango/pango-ot-private.h1
7 files changed, 21 insertions, 16 deletions
diff --git a/pango/opentype/hb-buffer.c b/pango/opentype/hb-buffer.c
index 33416610..2a566b1c 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 3e4b4505..c3c1153b 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 6a7f5508..6c949932 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 fd7deb63..8d0a25a4 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 98b322fb..dbeafef1 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 9dd34ff2..a4d54fd9 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 9b0f84ef..a011b74d 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