[HarfBuzz] harfbuzz-ng: Branch 'master' - 3 commits
Behdad Esfahbod
behdad at kemper.freedesktop.org
Wed Sep 21 13:50:48 PDT 2011
src/hb-blob.cc | 2 +-
src/hb-font.cc | 16 +++++++++++++---
util/options.cc | 11 +++++++----
3 files changed, 21 insertions(+), 8 deletions(-)
New commits:
commit b95324cdd217f44c40c5fd44898e659500f19511
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Wed Sep 21 16:50:39 2011 -0400
Minor
diff --git a/src/hb-blob.cc b/src/hb-blob.cc
index 58d7324..b2b1d9c 100644
--- a/src/hb-blob.cc
+++ b/src/hb-blob.cc
@@ -64,8 +64,8 @@ static hb_blob_t _hb_blob_nil = {
TRUE, /* immutable */
- 0, /* length */
NULL, /* data */
+ 0, /* length */
HB_MEMORY_MODE_READONLY, /* mode */
NULL, /* user_data */
commit 0cd33592ab4bb486ffc438ba0efdac2fa7a1bb7f
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Wed Sep 21 16:49:33 2011 -0400
Fix possible leaks
diff --git a/src/hb-font.cc b/src/hb-font.cc
index 40d93ec..d549455 100644
--- a/src/hb-font.cc
+++ b/src/hb-font.cc
@@ -286,8 +286,11 @@ hb_font_funcs_set_##name##_func (hb_font_funcs_t *ffuncs, \
void *user_data, \
hb_destroy_func_t destroy) \
{ \
- if (ffuncs->immutable) \
+ if (ffuncs->immutable) { \
+ if (destroy) \
+ destroy (user_data); \
return; \
+ } \
\
if (ffuncs->destroy.name) \
ffuncs->destroy.name (ffuncs->user_data.name); \
@@ -901,8 +904,11 @@ hb_font_set_funcs (hb_font_t *font,
void *user_data,
hb_destroy_func_t destroy)
{
- if (font->immutable)
+ if (font->immutable) {
+ if (destroy)
+ destroy (user_data);
return;
+ }
if (font->destroy)
font->destroy (font->user_data);
@@ -922,8 +928,12 @@ hb_font_set_funcs_data (hb_font_t *font,
void *user_data,
hb_destroy_func_t destroy)
{
- if (font->immutable)
+ /* Destroy user_data? */
+ if (font->immutable) {
+ if (destroy)
+ destroy (user_data);
return;
+ }
if (font->destroy)
font->destroy (font->user_data);
commit d3f3690b485e1d240fec4f204aef54e07853a244
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Wed Sep 21 16:41:43 2011 -0400
hb-shape: In --no-glyph-names, output glyph number directly
Ie. write "86" instead of "gid86".
diff --git a/util/options.cc b/util/options.cc
index 4429e85..29e0b4f 100644
--- a/util/options.cc
+++ b/util/options.cc
@@ -646,10 +646,13 @@ format_options_t::serialize (hb_buffer_t *buffer,
g_string_append_c (gs, '|');
char glyph_name[30];
- if (show_glyph_names && !FT_Get_Glyph_Name (ft_face, info->codepoint, glyph_name, sizeof (glyph_name)))
- g_string_append_printf (gs, "%s", glyph_name);
- else
- g_string_append_printf (gs, "gid%d", info->codepoint);
+ if (show_glyph_names) {
+ if (!FT_Get_Glyph_Name (ft_face, info->codepoint, glyph_name, sizeof (glyph_name)))
+ g_string_append_printf (gs, "%s", glyph_name);
+ else
+ g_string_append_printf (gs, "gid%d", info->codepoint);
+ } else
+ g_string_append_printf (gs, "%d", info->codepoint);
if (show_clusters)
g_string_append_printf (gs, "=%d", info->cluster);
More information about the HarfBuzz
mailing list