summaryrefslogtreecommitdiff
path: root/pango/pango-language.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2007-08-21 02:54:05 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2007-08-21 02:54:05 +0000
commit7c1a1c9db2cbbca42ff1e8afb2050df2a40a6854 (patch)
treec087d420438b3231a6e6c4b6b5bd866a12f3a251 /pango/pango-language.c
parent22b8a1913a9e862e5d20e90c3b9ca50d37a214b1 (diff)
downloadpango-7c1a1c9db2cbbca42ff1e8afb2050df2a40a6854.tar.gz
Bug 348348 – Add a way to get the script name of a gunichar
2007-08-20 Behdad Esfahbod <behdad@gnome.org> Bug 348348 – Add a way to get the script name of a gunichar * configure.in: Require glib 2.14, for GUnicodeScript stuff. * docs/tmpl/scripts.sgml: Document that #PangoScript is interchangeable with GUnicodeScript. * pango/pango-script.c (pango_script_for_unichar): Use g_unichar_get_script(), and document it. * tools/Makefile.am: * tools/gen-script-table.pl: * pango/Makefile.am: * pango/pango-script-table.h: Remove pango-script-table.h and its generator. * pango/pango-gravity.c (get_script_properties): * pango/pango-language.c (pango_script_get_sample_language): * pango/pango-ot-tag.c (pango_ot_tag_from_script): Protect against unexpected script values. svn path=/trunk/; revision=2406
Diffstat (limited to 'pango/pango-language.c')
-rw-r--r--pango/pango-language.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/pango/pango-language.c b/pango/pango-language.c
index e6567924..f1fe14a9 100644
--- a/pango/pango-language.c
+++ b/pango/pango-language.c
@@ -434,7 +434,7 @@ script_for_lang_compare (gconstpointer key,
* to write @language or if nothing is known about @language
* (including the case that @language is %NULL),
* %FALSE otherwise.
- *
+
* Since: 1.4
**/
gboolean
@@ -715,7 +715,9 @@ pango_script_get_sample_language (PangoScript script)
PangoLanguage *result;
g_return_val_if_fail (script >= 0, NULL);
- g_return_val_if_fail ((guint)script < G_N_ELEMENTS (sample_languages), NULL);
+
+ if ((guint)script >= G_N_ELEMENTS (sample_languages))
+ return NULL;
result = _pango_script_get_default_language (script);
if (result)