diff options
author | bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-08-27 19:05:32 +0000 |
---|---|---|
committer | bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-08-27 19:05:32 +0000 |
commit | 33346487cbb64134d7204abe32d9318c1b511aa8 (patch) | |
tree | 20d65a225567e3ceebc1dec95f9c9394ec1a8264 /gm/verttext.cpp | |
parent | e09d6f48190ee8c015fc22e9531293861bd99184 (diff) |
Fix _GDI::generateCharToGlyph to properly handle missing glyphs.
git-svn-id: http://skia.googlecode.com/svn/trunk@10945 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm/verttext.cpp')
-rw-r--r-- | gm/verttext.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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]; |