diff options
author | Behdad Esfahbod <behdad@gnome.org> | 2007-08-21 02:54:05 +0000 |
---|---|---|
committer | Behdad Esfahbod <behdad@src.gnome.org> | 2007-08-21 02:54:05 +0000 |
commit | 7c1a1c9db2cbbca42ff1e8afb2050df2a40a6854 (patch) | |
tree | c087d420438b3231a6e6c4b6b5bd866a12f3a251 /pango/pango-gravity.c | |
parent | 22b8a1913a9e862e5d20e90c3b9ca50d37a214b1 (diff) | |
download | pango-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-gravity.c')
-rw-r--r-- | pango/pango-gravity.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pango/pango-gravity.c b/pango/pango-gravity.c index 1c2d8b0d..28b77e1a 100644 --- a/pango/pango-gravity.c +++ b/pango/pango-gravity.c @@ -223,8 +223,10 @@ const PangoScriptProperties script_properties[] = static PangoScriptProperties get_script_properties (PangoScript script) { + g_return_val_if_fail (script >= 0, script_properties[0]); + if ((guint)script >= G_N_ELEMENTS (script_properties)) - script = 0; + return script_properties[0]; return script_properties[script]; } |