summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2011-07-21 12:00:36 -0400
committerBehdad Esfahbod <behdad@behdad.org>2011-07-21 12:00:36 -0400
commit26475e516f2384efaefe3dd97bd99f2176291354 (patch)
tree5aae12786acef44b06b1ff2c755e12158d9bae9b /modules
parent0b469b7eeb36ce8181b404f24eaaacaa9ec2c3fe (diff)
downloadpango-26475e516f2384efaefe3dd97bd99f2176291354.tar.gz
[HB] Fix cluster setting with recent HB change
Diffstat (limited to 'modules')
-rw-r--r--modules/basic/basic-fc.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/basic/basic-fc.c b/modules/basic/basic-fc.c
index 42832470..e1e7aa1c 100644
--- a/modules/basic/basic-fc.c
+++ b/modules/basic/basic-fc.c
@@ -293,7 +293,14 @@ basic_engine_shape (PangoEngineShape *engine G_GNUC_UNUSED,
for (i = 0; i < num_glyphs; i++)
{
glyphs->glyphs[i].glyph = hb_glyph->codepoint;
- glyphs->log_clusters[i] = hb_glyph->cluster;
+ if (i && glyphs->log_clusters[i-1] != hb_glyph->cluster) {
+ GUnicodeType t = g_unichar_type (g_utf8_get_char (text + hb_glyph->cluster));
+ if ((1<<t) & ((1<<G_UNICODE_COMBINING_MARK)|(1<<G_UNICODE_ENCLOSING_MARK)|(1<<G_UNICODE_NON_SPACING_MARK)))
+ glyphs->log_clusters[i] = last_cluster;
+ else
+ glyphs->log_clusters[i] = hb_glyph->cluster;
+ } else
+ glyphs->log_clusters[i] = hb_glyph->cluster;
glyphs->glyphs[i].attr.is_cluster_start = glyphs->log_clusters[i] != last_cluster;
last_cluster = glyphs->log_clusters[i];