Hey Pedro,<br>Was there supposed to be an attachment on your last message? I didn&#39;t see one.<br><br>Regards,<br>John Klehm<br><br><div><span class="gmail_quote">On 2/8/07, <b class="gmail_sendername">Pedro Araujo Chaves Jr.
</b> &lt;<a href="mailto:inckie@gmail.com">inckie@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Attached is my proposed patch for Bug #50; the test case was attached
<br>in my previous message.<br>--<br>Patch description:<br><br>This patch fixes Wine&#39;s Bug #50: &quot;PrgWin95: Text justification needs<br>beefing up&quot;.<br><br>What it does: first, it takes in consideration that not always the
<br>number of extra pixels will be a multiple of the number of break<br>characters in a given extent of a given string that should be<br>justified, and so the integer division of extra by breaks in<br>SetTextJustification() is likely to leave a remainder (which the
<br>latter function addresses, of course, but ExtTextOutW() seems to<br>overlook � that&#39;s the reason for the changes at lines 1788 (breakRem),<br>and 1901 and 1922 (dc-&gt;breakExtra || breakRem), which prevent some<br>
lines from being ignored in the justification).<br><br>That fixed, if there remained any pixels indeed, their number<br>shouldn&#39;t be greater than dc-&gt;breakCount; then the first breakRem<br>break characters in that given extent are widened by one pixel (lines
<br>1925-1929 added).<br><br>GetTextExtentExPointW() is also fixed so that it now returns the<br>expected width of the text when it is to be justified. This has the<br>good side effect that TabbedTextOut() now also returns the proper
<br>width when called after SetTextJustification(). What the patch does<br>here is that GetTextExtentExPointW() now calculates the extra width<br>only when (breakExtra || breakRem) resolves TRUE , and corrects the<br>extra space additions by applying them only to break characters. What
<br>was broken before is that it always added extra space, regardless of<br>whether it was measuring a single character or a full string, or<br>whether it was a break character or not. (Lines added: 1191, 1199,<br>1227, 1229, 1236-1245, 1254-1268).
<br><br>This patch is copyrighted by Banco do Brasil under the LGPL.<br><br>--<br>Regards,<br>Pedro Ara�jo.<br><br><br></blockquote></div><br>