WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
25961
wx port measures character widths incorrectly (Windows specific)
https://bugs.webkit.org/show_bug.cgi?id=25961
Summary
wx port measures character widths incorrectly (Windows specific)
Kevin Watters
Reported
2009-05-22 07:13:43 PDT
The GetTextExtent function in platform/wx/wxcode/win/fontprops.cpp measures font character widths incorrectly. Code copied from wx internals assumes that you are measuring font strings of more then one character, and accounts for overhang by subtracting values obtained from the GetCharABCWidths function. This is incorrect for measuring the width of individual characters, like WebKit asks for.
Attachments
Do not use GetCharABCWidths for single character measurements
(1.07 KB, patch)
2009-05-22 07:14 PDT
,
Kevin Watters
kevino
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Kevin Watters
Comment 1
2009-05-22 07:14:48 PDT
Created
attachment 30579
[details]
Do not use GetCharABCWidths for single character measurements Fixes the single character measuring problem and makes GDI font rendering match with Firefox/IE.
Eric Seidel (no email)
Comment 2
2009-05-22 07:28:54 PDT
Comment on
attachment 30579
[details]
Do not use GetCharABCWidths for single character measurements Where is this code used? Which multi-character strings does this affect? Test case? Also, the style is not webkit style in fontprops.cpp Normally all code in WebCore matches WK style, I guess we've made an exception for wx files? Please either add a test case or update the ChangeLog to explain why one is not possible (and if needed, file a bug requesting the additional features being added to wx's DumpRenderTree). Thanks for the patch! r- for lack of test.
Kevin Ollivier
Comment 3
2009-05-22 10:11:44 PDT
Sorry, I know changing a review is unusual, but Eric didn't even give me an opportunity to review the patch myself, and given all the questions he asked I have to wonder why he didn't even give someone more qualified a chance to review it. In fact, I had seen this patch even before it was posted, and this is code that initially was going to go into wx, but now will probably be phased out in the not-too-distant future. Until we do so, though, we need this as a stopgap measure. In addition, we're still working on getting a complete testing framework up and running for wx, so if we were to r- patches on those grounds, we'd be unable to commit anything. Similarly, adding comments to every patch because our testing framework isn't yet ready for action seems a bit silly. By this rule, almost every wx patch ever committed should have this note, to the point that we should probably write a script adding it. ;-) wx is not in the same place, port-wise, as Win, Mac or Chromium and I'd appreciate it if in the future, patch reviewers would either take that into consideration before giving an r-, or preferably just leave port-specific reviews to port reviewers. I assure you, I very rarely let a patch sit around more than a few days in the queue without review!
Kevin Ollivier
Comment 4
2009-05-22 13:12:44 PDT
Landed in
r44057
, thanks!
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug