summaryrefslogtreecommitdiff
path: root/modules/thai
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2006-01-29 23:06:59 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2006-01-29 23:06:59 +0000
commit1a00555cd87c8454301b65fe7939e277b7d67998 (patch)
treee990bb0669d6b249f3d8c7bc71145c4f5fb43ac9 /modules/thai
parent9d18a76a5d226de48eb41f0c2ba23d7e42195ff8 (diff)
downloadpango-1a00555cd87c8454301b65fe7939e277b7d67998.tar.gz
If locking font face failed, do not assert, just return zero glyphs with
2006-01-29 Behdad Esfahbod <behdad@gnome.org> * modules/arabic/arabic-fc.c, modules/basic/basic-fc.c modules/hebrew/hebrew-fc.c, modules/indic/indic-fc.c modules/khmer/khmer-fc.c, modules/syriac/syriac-fc.c modules/thai/thai-ot.c, modules/thai/thai-shaper.c modules/tibetan/tibetan-fc.c: If locking font face failed, do not assert, just return zero glyphs with an implicit warning. * pango/fonts.c, pango/glyphstring.c pango/modules.c pango/pango-color.c, pango/pango-context.c pango/pango-coverage.c, pango/pango-fontmap.c pango/pango-glyph-item.c, pango/pango-item.c pango/pango-layout.c, pango/pango-markup.c pango/pango-ot-buffer.c, pango/pango-script.c pango/pango-tabs.c, pango/pango-utils.c pango/pangoatsui-fontmap.c, pango/pangocairo-fcfont.c pango/pangocairo-fcfontmap.c, pango/pangocairo-fontmap.c pango/pangocairo-win32font.c, pango/pangofc-font.c pango/pangofc-fontmap.c, pango/pangoft2-fontmap.c pango/pangoft2-render.c, pango/pangoft2.c pango/pangowin32-fontcache.c, pango/pangoxft-font.c pango/pangoxft-render.c, pango/break.c pango/ellipsize.c: Use g_slice for allocating all types. Also, change some g_error's to g_critical's...
Diffstat (limited to 'modules/thai')
-rw-r--r--modules/thai/thai-ot.c7
-rw-r--r--modules/thai/thai-shaper.c13
2 files changed, 11 insertions, 9 deletions
diff --git a/modules/thai/thai-ot.c b/modules/thai/thai-ot.c
index b82033bb..23c20190 100644
--- a/modules/thai/thai-ot.c
+++ b/modules/thai/thai-ot.c
@@ -76,7 +76,7 @@ thai_ot_get_ruleset (PangoFont *font)
fc_font = PANGO_FC_FONT (font);
face = pango_fc_font_lock_face (fc_font);
- g_assert (face != NULL);
+ g_return_val_if_fail (face != NULL, NULL);
info = pango_ot_info_get (face);
if (info != NULL)
@@ -148,7 +148,7 @@ lao_ot_get_ruleset (PangoFont *font)
fc_font = PANGO_FC_FONT (font);
face = pango_fc_font_lock_face (fc_font);
- g_assert (face != NULL);
+ g_return_val_if_fail (face != NULL, NULL);
info = pango_ot_info_get (face);
if (info != NULL)
@@ -216,9 +216,6 @@ thai_ot_shape (PangoFont *font,
PangoOTRuleset *th_ruleset;
PangoOTRuleset *lo_ruleset;
- g_return_if_fail (font != NULL);
- g_return_if_fail (glyphs != NULL);
-
th_ruleset = thai_ot_get_ruleset (font);
lo_ruleset = lao_ot_get_ruleset (font);
diff --git a/modules/thai/thai-shaper.c b/modules/thai/thai-shaper.c
index a2a5bf37..bb62a9c1 100644
--- a/modules/thai/thai-shaper.c
+++ b/modules/thai/thai-shaper.c
@@ -531,11 +531,16 @@ thai_engine_shape (PangoEngineShape *engine,
PangoAnalysis *analysis,
PangoGlyphString *glyphs)
{
- ThaiFontInfo *font_info;
+ gint n_chars;
const char *p;
+ ThaiFontInfo *font_info;
const char *log_cluster;
gunichar cluster[MAX_CLUSTER_CHRS];
- gint num_chrs;
+
+ g_return_if_fail (font != NULL);
+ g_return_if_fail (text != NULL);
+ g_return_if_fail (length >= 0);
+ g_return_if_fail (analysis != NULL);
pango_glyph_string_set_size (glyphs, 0);
@@ -545,8 +550,8 @@ thai_engine_shape (PangoEngineShape *engine,
while (p < text + length)
{
log_cluster = p;
- p = get_next_cluster (p, text + length - p, cluster, &num_chrs);
- add_cluster (font_info, glyphs, log_cluster - text, cluster, num_chrs);
+ p = get_next_cluster (p, text + length - p, cluster, &n_chars);
+ add_cluster (font_info, glyphs, log_cluster - text, cluster, n_chars);
}
thai_ot_shape (font, glyphs);
}