From 33346487cbb64134d7204abe32d9318c1b511aa8 Mon Sep 17 00:00:00 2001 From: "bungeman@google.com" Date: Tue, 27 Aug 2013 19:05:32 +0000 Subject: Fix _GDI::generateCharToGlyph to properly handle missing glyphs. git-svn-id: http://skia.googlecode.com/svn/trunk@10945 2bbb7eff-a529-9590-31e7-b0007b416f81 --- gm/verttext.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gm') diff --git a/gm/verttext.cpp b/gm/verttext.cpp index 164f990913..1f1c64dfe6 100644 --- a/gm/verttext.cpp +++ b/gm/verttext.cpp @@ -23,7 +23,7 @@ static const char gText[] = "Hello"; //static const char gText[] = "﹁テスト︒﹂"; //static const char gText[] = {0xEF,0xB9,0x81, 0xE3,0x83,0x86, 0xE3,0x82,0xB9, 0xE3,0x83,0x88, 0xEF,0xB8,0x92, 0xEF,0xB9,0x82, 0x0}; -static const size_t gLen = sizeof(gText) - 1; +static const size_t gLen = sizeof(gText) - sizeof(gText[0]); class VertTextGM : public GM { public: @@ -70,8 +70,8 @@ protected: p.setColor(0xFF0000FF); SkScalar adv[gLen]; - paint.getTextWidths(gText, gLen, adv, NULL); - for (size_t i = 0; i < gLen; ++i) { + int numChars = paint.getTextWidths(gText, gLen, adv, NULL); + for (int i = 0; i < numChars; ++i) { canvas->drawCircle(x, y, SK_Scalar1 * 3 / 2, p); if (paint.isVerticalText()) { y += adv[i]; -- cgit v1.2.3