Closed
Bug 581087
Opened 15 years ago
Closed 15 years ago
REFTEST TEST-UNEXPECTED-FAIL | file:///c:/talos-slave/mozilla-central-win7-opt-u-reftest-d2d/build/reftest/tests/layout/reftests/forms/input-text-size-1.html |
Categories
(Core :: Graphics, defect)
Tracking
()
RESOLVED
FIXED
| Tracking | Status | |
|---|---|---|
| blocking2.0 | --- | beta4+ |
People
(Reporter: jrmuizel, Assigned: jfkthame)
References
Details
Attachments
(1 file, 1 obsolete file)
|
6.87 KB,
patch
|
bas.schouten
:
review+
|
Details | Diff | Splinter Review |
One version has a caret the other does not.
OS: Mac OS X → Windows 7
Updated•15 years ago
|
Assignee: nobody → bas.schouten
See bug 519361
Comment 2•15 years ago
|
||
Would either of you guys be willing to look at this? The textbox appears to be
wider on D2D than without. Allowing one extra character to slip in, it's not
the caret, it's a '|' character.
| Assignee | ||
Comment 3•15 years ago
|
||
This happens because the DirectWrite font metrics APIs do not provide the maxAdvance and averageCharWidth values (as GDI did), and so our dwrite code fakes them using the em-size for maxAdvance, and the width of 'x' for aveCharWidth.
Most of the time, the true values from the font are not really needed, but the TextControlFrame code looks at these two fields to decide if the font is "fixed-pitch" and behaves differently in response; for non-fixed-pitch fonts, some padding is added to the control width. See http://mxr.mozilla.org/mozilla-central/source/layout/forms/nsTextControlFrame.cpp#279.
| Assignee | ||
Comment 4•15 years ago
|
||
This resolves the problem by reading the 'hhea' and 'OS/2' tables to get the maxAdvance and aveCharWidth values, if possible (it falls back to the old "fake" values if the font tables are not available -- this shouldn't happen for valid TrueType/OpenType fonts).
Attachment #462782 -
Flags: review?(bas.schouten)
Comment 5•15 years ago
|
||
Comment on attachment 462782 [details] [diff] [review]
patch, v1 - get true maxAdvance and aveCharWidth in dwrite font metrics
One important comment, from MSDN: 'It is possible for a NULL tableContext to be returned, especially if the implementation performs direct memory mapping on the whole file. Nevertheless, always release it later, and do not use it as a test for function success.'
So we should still release it even if tableContext is NULL.
Attachment #462782 -
Flags: review?(bas.schouten) → review+
| Assignee | ||
Comment 6•15 years ago
|
||
Updated for review comment. Also made a similar change to gfxDWriteFontEntry::ReadCMAP(), where the same issue applies. (Marking for re-review so you can check I did the appropriate thing, Bas.)
Assignee: bas.schouten → jfkthame
Attachment #462782 -
Attachment is obsolete: true
Attachment #462842 -
Flags: review?(bas.schouten)
| Assignee | ||
Comment 7•15 years ago
|
||
Requesting blocking-2.0 as we need this for D2D-reftests to pass on Win7.
blocking2.0: --- → ?
Comment 8•15 years ago
|
||
Comment on attachment 462842 [details] [diff] [review]
patch, v1.1
Looks good to me!
Attachment #462842 -
Flags: review?(bas.schouten) → review+
Updated•15 years ago
|
blocking2.0: ? → beta4+
| Assignee | ||
Comment 9•15 years ago
|
||
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•