Closed
Bug 368107
Opened 18 years ago
Closed 11 years ago
Should round letter-spacing and word-spacing to the nearest pixel
Categories
(Core :: CSS Parsing and Computation, defect)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
INVALID
People
(Reporter: masayuki, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(4 files)
Spinning off from bug 367848.
The decimal of the device pixels of letter-spacing and word-spacing is dropped on WinIE7 and Opera9(Win). Gecko inserts the space if the accumulation spaces are over a device pixel. This is not a big compatibility issue. But I think that the different width spaces are not good for the looks.
Reporter | ||
Comment 1•18 years ago
|
||
Comment 2•18 years ago
|
||
I'm still somewhat against this (although not strongly), as I said in bug 367848 comment 3. At some point font rendering will probably support sub-pixel positioning. There are good reasons to round borders and text-decorations that don't apply here.
Summary: Should drop the decimal for letter-spacing and word-spacing → Should round letter-spacing and word-spacing to the nearest pixel
Comment 3•18 years ago
|
||
And in fact, Mac does currently appear to do sub-pixel text rendering.
Reporter | ||
Comment 4•18 years ago
|
||
I tested on linux. If the font is rendered with bitmap glyphs, the sub-pixel rendering is disabled. (I think that such is good thing for bitmap glyphs.) If we only support the vector fonts, sub-pixel rendering is good way. But we must support the bitmap glyphs, we still have the issue in cairo rendering... (Note that the some CJK fonts have bitmap glyphs for small sizes. e.g., between 9pt and 12pt.)
Reporter | ||
Comment 5•18 years ago
|
||
I tested on Mac. Mac may always use the vector glyphs even if the font has bitmap glyphs.
I think that on the Mac, we may not need to round. But on linux, I don't think so. (of course, on Win, we should round it.)
We have two ways:
1. only on Win/Linux, we round the values.
2. on all platforms, we round it.
Reporter | ||
Comment 6•18 years ago
|
||
Note that Safari rounds the values to the lower device pixels.
Comment 7•18 years ago
|
||
3. leave our current behavior
Reporter | ||
Comment 8•18 years ago
|
||
(In reply to comment #3)
> And in fact, Mac does currently appear to do sub-pixel text rendering.
>
dbaron:
What document tell you the information? I'm working on text-decoration offset issues, in the testing, I found the fact that Mac doesn't support the sub-pixel rendering for vertical positioning. I.g., in the following fragment,
<span>XXX</span><span style="position: relative; top: 0.4px;">XXXX</span>
The all characters rendered in same Y position.
Reporter | ||
Comment 9•18 years ago
|
||
I have a question. Would the sub-pixel rendering be supported on Linux?
See the screenshot. This is a screenshot of the following testcase:
<p style="letter-spacing: 0.12em;">
<span>EEEE</span><br/>
<span style="position: relative; left: 0.4px;">EEEE</span><br/>
<span style="position: relative; left: 0.5px;">EEEE</span><br/>
<span style="position: relative; left: 1px;">EEEE</span>
</p>
It looks like the first two lines are rendered in same X position. And last two lines are too.
Comment 10•18 years ago
|
||
(In reply to comment #8)
> What document tell you the information?
I observed it, looking at *horizontal* positioning. See bug 359903 comment 8.
Updated•17 years ago
|
QA Contact: ian → style-system
Reporter | ||
Comment 11•15 years ago
|
||
I'm resetting bugs which are assigned to me but I'm not working on them and I don't have plan for fixing them in near future.
Assignee: masayuki → nobody
We could do this for platforms that don't support horizontal subpixel positioning. But of our major platforms, that's only Windows.
Reporter | ||
Comment 13•15 years ago
|
||
roc: see comment 9. Does gecko of Linux support the subpixel positioning now?
I'm not sure.
It may depend on the kind of screen you have.
Reporter | ||
Comment 16•15 years ago
|
||
I retested on Ubuntu9.04 on VMware6.5 of Windows, but the subpixel positioning is not supported on latest trunk build. The display is "Unknown" for Ubuntu.
Reporter | ||
Updated•15 years ago
|
Status: ASSIGNED → NEW
Comment 17•13 years ago
|
||
Google Chrome rounds, Fx shows a moiré. I strongly suggest to do it like chrome.
Comment 18•13 years ago
|
||
We support subpixel positioning on Windows now with D2D. Subpixel positioning is definitely the future. I stand by comment #12: if we're going to do anything here at all, we should detect whether the platform does subpixel positioning and if it does not, then round letter-spacing/word-spacing. I'd take a patch for that, although I wouldn't ask anyone to work on it.
Comment 20•11 years ago
|
||
Bug 939132 suggests an alternative (better, IMO) solution to the problem here.
Reporter | ||
Comment 21•11 years ago
|
||
In these days, IE 11 and Chrome uses subpixle text positioning. So, they render the testcase similar to Gecko.
So, there is no reason to change our behavior now.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•