<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>25961</bug_id>
          
          <creation_ts>2009-05-22 07:13:43 -0700</creation_ts>
          <short_desc>wx port measures character widths incorrectly (Windows specific)</short_desc>
          <delta_ts>2009-05-22 13:12:44 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit wx</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Kevin Watters">kevinwatters</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>122652</commentid>
    <comment_count>0</comment_count>
    <who name="Kevin Watters">kevinwatters</who>
    <bug_when>2009-05-22 07:13:43 -0700</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>122653</commentid>
    <comment_count>1</comment_count>
      <attachid>30579</attachid>
    <who name="Kevin Watters">kevinwatters</who>
    <bug_when>2009-05-22 07:14:48 -0700</bug_when>
    <thetext>Created attachment 30579
Do not use GetCharABCWidths for single character measurements

Fixes the single character measuring problem and makes GDI font rendering match with Firefox/IE.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>122658</commentid>
    <comment_count>2</comment_count>
      <attachid>30579</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-05-22 07:28:54 -0700</bug_when>
    <thetext>Comment on attachment 30579
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&apos;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&apos;s DumpRenderTree).

Thanks for the patch!  r- for lack of test.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>122684</commentid>
    <comment_count>3</comment_count>
    <who name="Kevin Ollivier">kevino</who>
    <bug_when>2009-05-22 10:11:44 -0700</bug_when>
    <thetext>Sorry, I know changing a review is unusual, but Eric didn&apos;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&apos;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&apos;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&apos;d be unable to commit anything. Similarly, adding comments to every patch because our testing framework isn&apos;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&apos;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!
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>122725</commentid>
    <comment_count>4</comment_count>
    <who name="Kevin Ollivier">kevino</who>
    <bug_when>2009-05-22 13:12:44 -0700</bug_when>
    <thetext>Landed in r44057, thanks!</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>30579</attachid>
            <date>2009-05-22 07:14:48 -0700</date>
            <delta_ts>2009-05-22 08:56:32 -0700</delta_ts>
            <desc>Do not use GetCharABCWidths for single character measurements</desc>
            <filename>fontprops.patch</filename>
            <type>text/plain</type>
            <size>1098</size>
            <attacher name="Kevin Watters">kevinwatters</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiA0NDAzMSkKKysrIFdlYkNvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBA
IC0xLDMgKzEsMTIgQEAKKzIwMDktMDUtMjEgIEtldmluIFdhdHRlcnMgIDxrZXZpbndhdHRlcnNA
Z21haWwuY29tPgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAg
ICAgIE9ubHkgYWNjb3VudCBmb3Igb3ZlcmhhbmcgZm9yIG11bHRpLWNoYXJhY3RlciBzdHJpbmdz
LgorCisgICAgICAgICogcGxhdGZvcm0vd3gvd3hjb2RlL3dpbi9mb250cHJvcHMuY3BwOgorICAg
ICAgICAoR2V0VGV4dEV4dGVudCk6CisKIDIwMDktMDUtMjEgIFN0ZXBoYW5pZSBMZXdpcyAgPHNs
ZXdpc0BhcHBsZS5jb20+CiAKICAgICAgICAgUmV2aWV3ZWQgYnkgTWFyayBSb3dlLgpJbmRleDog
V2ViQ29yZS9wbGF0Zm9ybS93eC93eGNvZGUvd2luL2ZvbnRwcm9wcy5jcHAKPT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQot
LS0gV2ViQ29yZS9wbGF0Zm9ybS93eC93eGNvZGUvd2luL2ZvbnRwcm9wcy5jcHAJKHJldmlzaW9u
IDQ0MDE2KQorKysgV2ViQ29yZS9wbGF0Zm9ybS93eC93eGNvZGUvd2luL2ZvbnRwcm9wcy5jcHAJ
KHdvcmtpbmcgY29weSkKQEAgLTkxLDcgKzkxLDcgQEAKICAgICAvLyBhY2NvdW50cyBmb3IgdW5k
ZXIvb3Zlcmhhbmcgb2YgdGhlIGZpcnN0L2xhc3QgY2hhcmFjdGVyIHdoaWxlIHdlIHdhbnQKICAg
ICAvLyBqdXN0IHRoZSBib3VuZGluZyByZWN0IGZvciB0aGlzIHN0cmluZyBzbyBhZGp1c3QgdGhl
IHdpZHRoIGFzIG5lZWRlZAogICAgIC8vICh1c2luZyBBUEkgbm90IGF2YWlsYWJsZSBpbiAyMDAy
IFNES3Mgb2YgV2luQ0UpCi0gICAgaWYgKCBsZW4gPiAwICkKKyAgICBpZiAoIGxlbiA+IDEgKQog
ICAgIHsKICAgICAgICAgQUJDIHdpZHRoOwogICAgICAgICBjb25zdCB3eENoYXIgY2hGaXJzdCA9
ICpzdHIuYmVnaW4oKTsK
</data>
<flag name="review"
          id="15462"
          type_id="1"
          status="+"
          setter="kevino"
    />
          </attachment>
      

    </bug>

</bugzilla>