# HG changeset patch # User Jason Rumney # Date 1229000482 0 # Node ID 92ff8ff0a65579b190916ed4bed4bd383276db06 # Parent 383709672c3fe174e0076e562dc4dc73bdc7ca47 (uniscribe_encode_char): Increase glyph buffer size for surrogates. diff -r 383709672c3f -r 92ff8ff0a655 src/w32uniscribe.c --- a/src/w32uniscribe.c Thu Dec 11 12:02:49 2008 +0000 +++ b/src/w32uniscribe.c Thu Dec 11 13:01:22 2008 +0000 @@ -490,13 +490,16 @@ 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)