Work in progress... improvements on font stuff, reverted to using Painter to get the string width. Since it actually uses glyph caching, it is about 20 times faster than the implementation in ServerFont (and a about twice the time as R5). I added a StringWidth method to Painter and AGGTextRenderer which works as correct as ServerFont::StringWidth, which btw was broken, because I mixed up glyph count and byte count...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12745 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1215,7 +1215,11 @@ ServerApp::DispatchMessage(int32 code, LinkMsgReader &msg)
|
||||
font.SetSize(size);
|
||||
font.SetSpacing(spacing);
|
||||
|
||||
width = font.StringWidth(string, length);
|
||||
width = desktop->GetDisplayDriver()->StringWidth(string, length, 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!
|
||||
//width = font.StringWidth(string, length);
|
||||
|
||||
replylink.StartMessage(SERVER_TRUE);
|
||||
replylink.Attach<float>(width);
|
||||
|
||||
Reference in New Issue
Block a user