* The string length of the UTF8 ellipsis was incorrect (would have been 3).
* Whitespace cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26961 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -849,18 +849,18 @@ ServerFont::TruncateString(BString* inOut, uint32 mode, float width) const
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// the width of the "…" glyph
|
// the width of the "…" glyph
|
||||||
float ellipsisWidth = StringWidth(B_UTF8_ELLIPSIS, 1);
|
float ellipsisWidth = StringWidth(B_UTF8_ELLIPSIS, strlen(B_UTF8_ELLIPSIS));
|
||||||
const char *string = inOut->String();
|
const char* string = inOut->String();
|
||||||
int32 length = inOut->Length();
|
int32 length = inOut->Length();
|
||||||
|
|
||||||
// temporary array to hold result
|
// temporary array to hold result
|
||||||
char *result = new char[length + 3];
|
char* result = new char[length + 3];
|
||||||
|
|
||||||
// count the individual glyphs
|
// count the individual glyphs
|
||||||
int32 numChars = UTF8CountChars(string, -1);
|
int32 numChars = UTF8CountChars(string, -1);
|
||||||
|
|
||||||
// get the escapement of each glyph in font units
|
// get the escapement of each glyph in font units
|
||||||
float *escapementArray = new float[numChars];
|
float* escapementArray = new float[numChars];
|
||||||
static escapement_delta delta = (escapement_delta){ 0.0, 0.0 };
|
static escapement_delta delta = (escapement_delta){ 0.0, 0.0 };
|
||||||
if (GetEscapements(string, length, numChars, delta, escapementArray)
|
if (GetEscapements(string, length, numChars, delta, escapementArray)
|
||||||
== B_OK) {
|
== B_OK) {
|
||||||
|
|||||||
Reference in New Issue
Block a user