diff --git a/src/servers/app/ServerApp.cpp b/src/servers/app/ServerApp.cpp index aa671dabe5..c5140bb2e9 100644 --- a/src/servers/app/ServerApp.cpp +++ b/src/servers/app/ServerApp.cpp @@ -1347,13 +1347,13 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link) if (!stringArray[i] || lengthArray[i] <= 0) widthArray[i] = 0.0; else { - widthArray[i] = fDesktop->GetDisplayDriver()->StringWidth(stringArray[i], lengthArray[i], font); + //widthArray[i] = fDesktop->GetDisplayDriver()->StringWidth(stringArray[i], lengthArray[i], font); // NOTE: The line below will return the exact same thing. However, // the line above uses the AGG rendering backend, for which glyph caching // actually works. It is about 20 times faster! // TODO: I've disabled the AGG version for now, as it produces a dead lock // (font use), that I am currently too lazy to investigate... -// widthArray[i] = font.StringWidth(stringArray[i], lengthArray[i]); + widthArray[i] = font.StringWidth(stringArray[i], lengthArray[i]); } } diff --git a/src/servers/app/ServerFont.cpp b/src/servers/app/ServerFont.cpp index 48ef156fde..6dc4a1e79a 100644 --- a/src/servers/app/ServerFont.cpp +++ b/src/servers/app/ServerFont.cpp @@ -556,8 +556,9 @@ ServerFont::GetEscapements(const char charArray[], int32 numChars, int32 numByte bool -ServerFont::GetBoundingBoxesAsString(const char charArray[], int32 numChars, BRect rectArray[], - bool string_escapement, font_metric_mode mode, escapement_delta delta) +ServerFont::GetBoundingBoxesAsString(const char charArray[], int32 numChars, + BRect rectArray[], bool string_escapement, font_metric_mode mode, + escapement_delta delta) { if (!fStyle || !charArray || numChars <= 0 || !rectArray) return false; @@ -629,7 +630,7 @@ ServerFont::GetBoundingBoxesForStrings(char *charArray[], int32 lengthArray[], FT_Set_Char_Size(face, 0, int32(fSize * 64), 72, 72); - for (int32 i=0; iglyph->metrics.horiAdvance / 64.0; + width += face->glyph->advance.x / 64.0; } } delete[] convertedBuffer;