Closed Bug 404196 Opened 17 years ago Closed 17 years ago

Characters in monospaced text display don't always line up

Categories

(Core :: Graphics, defect)

x86
OS/2
defect
Not set
minor

Tracking

()

RESOLVED FIXED

People

(Reporter: mozilla, Assigned: mozilla)

References

Details

Attachments

(2 files, 1 obsolete file)

SeaMonkey trunk Gecko/2007111218 on OS/2

I notice this especially with Bugzilla emails where as in the attachment the vertical bars don't line up even though a monospaced font is used. I also noticed that when I press Ctrl-+ and Ctrl-- a few times that the displacement changes depending on the font size. The same is true when I save the body as text file and display it in the browser window. For some font sizes it even matches perfectly...

I suspect that there is something wrong with the font metrics or the advance calculation in the gfxOS2Fonts or gfxOS2FontGroup code.
Attached patch fix (obsolete) — Splinter Review
Yes, my guess was right, the advances of spaces _are_ different than for other characters. I got 480 for other characters and 468 for spaces when activating #define DEBUG_thebes_2 in gfxOS2FontGroup::CreateGlyphRunsFT().

This was because I was using font units when calculating the space width in gfxOS2Font::GetMetrics(). That seemed logical because we were computing the metrics but it is out of sync with what we do in gfxOS2FontGroup::CreateGlyphRunsFT (where we used the 26.6 units of FreeType).
Assignee: nobody → mozilla
Status: NEW → ASSIGNED
I tested all the monospaced fonts that I have installed and it worked for all of them except "Monotype Sans Duospace WT J". But there the reason is that not all characters are really of the same width, so it strictly isn't a monospace font...
(Perhaps it contains kerning information and so the problem with that font would be solved when using that to correct character positions.)
I uploaded the wrong patch before that contained stuff from another bug. This is what I now checked in to trunk for this bug.
Attachment #291116 - Attachment is obsolete: true
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: