[gnome-characters] libgc: Minor fixes to pango glyph check
- From: Daiki Ueno <dueno src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-characters] libgc: Minor fixes to pango glyph check
- Date: Sat, 9 May 2015 02:35:55 +0000 (UTC)
commit 458e034cdead92368c9f9d8b36590d5c0a7b5479
Author: Daiki Ueno <dueno src gnome org>
Date: Sat May 9 11:32:47 2015 +0900
libgc: Minor fixes to pango glyph check
Make gc_pango_context_font_has_glyph fail earlier if g_ucs4_to_utf8
returns NULL.
lib/gc.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/lib/gc.c b/lib/gc.c
index b883e12..83c7c8b 100644
--- a/lib/gc.c
+++ b/lib/gc.c
@@ -805,6 +805,12 @@ gc_pango_context_font_has_glyph (PangoContext *context,
PangoFont *font,
gunichar uc)
{
+ PangoLayout *layout;
+ GError *error;
+ gchar *utf8;
+ glong items_written;
+ int retval;
+
#ifdef HAVE_PANGOFT2
if (PANGO_IS_FC_FONT (font))
/* Fast path when the font is loaded as PangoFcFont. */
@@ -815,17 +821,12 @@ gc_pango_context_font_has_glyph (PangoContext *context,
#endif
/* Slow path performing actual rendering. */
- PangoLayout *layout;
- GError *error;
- gchar *utf8;
- glong items_written;
- int retval;
-
utf8 = g_ucs4_to_utf8 (&uc, 1, NULL, &items_written, &error);
if (!utf8)
{
g_printerr ("error in decoding: %s\n", error->message);
g_error_free (error);
+ return FALSE;
}
layout = pango_layout_new (context);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]