aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--win32/PlatWin.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx
index 90540baf6..ab0cba5e1 100644
--- a/win32/PlatWin.cxx
+++ b/win32/PlatWin.cxx
@@ -526,6 +526,11 @@ void Surface::MeasureWidths(Font &font_, const char *s, int len, int *positions)
// Eeek - a NULL DC or other foolishness could cause this.
// The least we can do is set the positions to zero!
memset(positions, 0, len * sizeof(*positions));
+ } else if (fit < len) {
+ // For some reason, such as an incomplete DBCS character
+ // Not all the positions are filled in so make them equal to end.
+ for (int i=fit;i<len;i++)
+ positions[i] = positions[fit-1];
}
}
}