diff --git a/headers/private/servers/app/ServerFont.h b/headers/private/servers/app/ServerFont.h index 8c4bc063c0..728b208de2 100644 --- a/headers/private/servers/app/ServerFont.h +++ b/headers/private/servers/app/ServerFont.h @@ -127,6 +127,7 @@ class ServerFont { BPoint offsetArray[]) const; bool GetEscapements(const char charArray[], int32 numChars, + int32 numBytes, float widthArray[], escapement_delta delta) const; diff --git a/src/servers/app/ServerApp.cpp b/src/servers/app/ServerApp.cpp index 8af0b31433..12d4d1874b 100644 --- a/src/servers/app/ServerApp.cpp +++ b/src/servers/app/ServerApp.cpp @@ -1852,7 +1852,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link) font.SetRotation(rotation); font.SetFlags(flags); - if (font.GetEscapements(charArray, numChars, escapements, delta)) { + if (font.GetEscapements(charArray, numChars, numBytes, escapements, delta)) { fLink.StartMessage(B_OK); fLink.Attach(escapements, numChars * sizeof(float)); } else diff --git a/src/servers/app/ServerFont.cpp b/src/servers/app/ServerFont.cpp index 854a1a6d93..fa59a8c854 100644 --- a/src/servers/app/ServerFont.cpp +++ b/src/servers/app/ServerFont.cpp @@ -509,7 +509,7 @@ ServerFont::GetEscapements(const char charArray[], int32 numChars, // GetEscapements bool -ServerFont::GetEscapements(const char charArray[], int32 numChars, +ServerFont::GetEscapements(const char charArray[], int32 numChars, int32 numBytes, float widthArray[], escapement_delta delta) const { if (!fStyle || !charArray || numChars <= 0) @@ -525,7 +525,6 @@ ServerFont::GetEscapements(const char charArray[], int32 numChars, // UTF8 handling...this can probably be smarter // Here is what I do in the AGGTextRenderer to handle UTF8... // It is probably highly inefficient, so it should be reviewed. - int32 numBytes = UTF8CountBytes(charArray, numChars); int32 convertedLength = numBytes * 2; char* convertedBuffer = new char[convertedLength]; @@ -631,7 +630,7 @@ ServerFont::GetBoundingBoxesForStrings(char *charArray[], int32 lengthArray[], FT_Set_Char_Size(face, 0, int32(fSize * 64), 72, 72); for (int32 i=0; i