summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2006-09-11 21:03:30 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2006-09-11 21:03:30 +0000
commitfca3a5693a7516bb4871576886609f9baf97ac74 (patch)
treed08ccd84df27b69378321fd241f4d3384e725f9d
parentb8fac1bfdd04bd0daa078c15e24116efca14f616 (diff)
downloadpango-fca3a5693a7516bb4871576886609f9baf97ac74.tar.gz
Bug 355435 – Invalid calls to pango_map_get_engine() Patch from
2006-09-11 Behdad Esfahbod <behdad@gnome.org> Bug 355435 – Invalid calls to pango_map_get_engine() Patch from Theppitak Karoonboonyanan * pango/break.c (pango_get_log_attrs): * pango/pango-renderer.c (add_underline): * pango/pangofc-font.c (pango_fc_font_find_shaper): * pango/pangowin32.c (pango_win32_font_find_shaper): * pango/pangox.c (pango_x_font_find_shaper): Pass a PangoScript to pango_map_get_engine, not a gunichar!
-rw-r--r--ChangeLog12
-rw-r--r--pango/break.c9
-rw-r--r--pango/pango-renderer.c1
-rw-r--r--pango/pangofc-font.c4
-rw-r--r--pango/pangowin32.c4
-rw-r--r--pango/pangox.c4
6 files changed, 26 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index c97f873a..e38021f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
2006-09-11 Behdad Esfahbod <behdad@gnome.org>
+ Bug 355435 – Invalid calls to pango_map_get_engine()
+ Patch from Theppitak Karoonboonyanan
+
+ * pango/break.c (pango_get_log_attrs):
+ * pango/pango-renderer.c (add_underline):
+ * pango/pangofc-font.c (pango_fc_font_find_shaper):
+ * pango/pangowin32.c (pango_win32_font_find_shaper):
+ * pango/pangox.c (pango_x_font_find_shaper):
+ Pass a PangoScript to pango_map_get_engine, not a gunichar!
+
+2006-09-11 Behdad Esfahbod <behdad@gnome.org>
+
Bug 347146 – underline/overstrike spaces
* pango/pango-renderer.c (add_underline), (add_strikethrough),
diff --git a/pango/break.c b/pango/break.c
index b8a47ccd..7a23ac19 100644
--- a/pango/break.c
+++ b/pango/break.c
@@ -1624,6 +1624,7 @@ pango_get_log_attrs (const char *text,
const char *end;
PangoEngineLang* range_engine;
const char *range_start;
+ PangoScript script;
int chars_in_range;
static guint engine_type_id = 0;
static guint render_type_id = 0;
@@ -1649,8 +1650,8 @@ pango_get_log_attrs (const char *text,
lang_map = pango_find_map (language, engine_type_id, render_type_id);
range_start = text;
- range_engine = (PangoEngineLang*) pango_map_get_engine (lang_map,
- g_utf8_get_char (text));
+ script = pango_script_for_unichar (g_utf8_get_char (text));
+ range_engine = (PangoEngineLang*) pango_map_get_engine (lang_map, script);
analysis.lang_engine = range_engine;
chars_broken = 0;
chars_in_range = 1;
@@ -1664,9 +1665,9 @@ pango_get_log_attrs (const char *text,
g_assert (range_start <= end);
g_assert (end - pos < length);
+ script = pango_script_for_unichar (g_utf8_get_char (pos));
analysis.lang_engine =
- (PangoEngineLang*) pango_map_get_engine (lang_map,
- g_utf8_get_char (pos));
+ (PangoEngineLang*) pango_map_get_engine (lang_map, script);
if (range_engine != analysis.lang_engine)
{
diff --git a/pango/pango-renderer.c b/pango/pango-renderer.c
index 7d165f82..02ee4e38 100644
--- a/pango/pango-renderer.c
+++ b/pango/pango-renderer.c
@@ -317,7 +317,6 @@ add_underline (PangoRenderer *renderer,
new_rect.y += ink_rect->y + ink_rect->height + underline_thickness;
break;
}
- int new_pos;
if (renderer->underline == state->underline &&
new_rect.y == current_rect->y &&
diff --git a/pango/pangofc-font.c b/pango/pangofc-font.c
index b2abb694..5f62f428 100644
--- a/pango/pangofc-font.c
+++ b/pango/pangofc-font.c
@@ -263,9 +263,11 @@ pango_fc_font_find_shaper (PangoFont *font,
guint32 ch)
{
PangoMap *shaper_map = NULL;
+ PangoScript script;
shaper_map = pango_fc_get_shaper_map (language);
- return (PangoEngineShape *)pango_map_get_engine (shaper_map, ch);
+ script = pango_script_for_unichar (ch);
+ return (PangoEngineShape *)pango_map_get_engine (shaper_map, script);
}
static PangoCoverage *
diff --git a/pango/pangowin32.c b/pango/pangowin32.c
index b0ce7151..71f2ddeb 100644
--- a/pango/pangowin32.c
+++ b/pango/pangowin32.c
@@ -863,9 +863,11 @@ pango_win32_font_find_shaper (PangoFont *font,
guint32 ch)
{
PangoMap *shape_map = NULL;
+ PangoScript script;
shape_map = pango_win32_get_shaper_map (lang);
- return (PangoEngineShape *)pango_map_get_engine (shape_map, ch);
+ script = pango_script_for_unichar (ch);
+ return (PangoEngineShape *)pango_map_get_engine (shape_map, script);
}
/* Utility functions */
diff --git a/pango/pangox.c b/pango/pangox.c
index 0e03afaa..a9f0b3b1 100644
--- a/pango/pangox.c
+++ b/pango/pangox.c
@@ -1361,9 +1361,11 @@ pango_x_font_find_shaper (PangoFont *font,
guint32 ch)
{
PangoMap *shape_map = NULL;
+ PangoScript script;
shape_map = pango_x_get_shaper_map (language);
- return (PangoEngineShape *)pango_map_get_engine (shape_map, ch);
+ script = pango_script_for_unichar (ch);
+ return (PangoEngineShape *)pango_map_get_engine (shape_map, script);
}
/* Utility functions */