From b4233ec94bf12fa12409f74203a9428c0ba3776d Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Thu, 11 Dec 2008 13:02:52 +0000 Subject: [PATCH] (uniscribe_encode_char): Increase glyph buffer size for surrogates. --- src/ChangeLog | 5 +++++ src/w32uniscribe.c | 11 +++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 453c61bbbb2..10fd86ad62c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2008-12-11 Jason Rumney + + * w32uniscribe.c (uniscribe_encode_char): Increase glyph buffer + size for surrogates. + 2008-12-11 Juanma Barranquero * w32proc.c (Fw32_get_locale_info): Decode long form of locale name. diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c index 25224302247..12870129776 100644 --- a/src/w32uniscribe.c +++ b/src/w32uniscribe.c @@ -490,13 +490,16 @@ uniscribe_encode_char (font, c) if (SUCCEEDED (ScriptItemize (ch, len, 2, NULL, NULL, items, &nitems))) { HRESULT result; - /* Some Indic characters result in more than 1 glyph. */ - WORD glyphs[1], clusters[1]; - SCRIPT_VISATTR attrs[1]; + /* Surrogates seem to need 2 here, even though only one glyph is + returned. Indic characters can also produce 2 or more glyphs for + a single code point, but they need to use uniscribe_shape + above for correct display. */ + WORD glyphs[2], clusters[2]; + SCRIPT_VISATTR attrs[2]; int nglyphs; result = ScriptShape (context, &(uniscribe_font->cache), - ch, len, 1, &(items[0].a), + ch, len, 2, &(items[0].a), glyphs, clusters, attrs, &nglyphs); if (result == E_PENDING) -- 2.39.2