Fix _GDI::generateCharToGlyph to properly handle missing glyphs.
git-svn-id: http://skia.googlecode.com/svn/trunk@10945 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gm/verttext.cpp b/gm/verttext.cpp
index 164f990..1f1c64d 100644
--- a/gm/verttext.cpp
+++ b/gm/verttext.cpp
@@ -23,7 +23,7 @@
//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 @@
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];