- LyXFont f = WhichFont(type, size);
-
- byte sx[80];
- if (MathIsBinary(type)) {
- byte * ps = &sx[0];
- for (int i = 0; i < ls && i < 75; ++i) {
- *(ps++) = ' ';
- *(ps++) = s[i];
- *(ps++) = ' ';
- }
- *(ps++) = '\0';
- ls *= 3;
- s = &sx[0];
- }
- return lyxfont::width(reinterpret_cast<char const *>(s), ls, f);
+ string st;
+ if (MathIsBinary(type))
+ for (int i = 0; i < ls; ++i) {
+ st += ' ';
+ st += s[i];
+ st += ' ';
+ }
+ else
+ st = string(reinterpret_cast<char const *>(s), ls);
+
+ LyXFont const f = WhichFont(type, size);
+ return lyxfont::width(st, f);