Characters in monospaced text display don't always line up

RESOLVED FIXED

Status

()

Core
Graphics
--
minor
RESOLVED FIXED
11 years ago
11 years ago

People

(Reporter: Peter Weilbacher, Assigned: Peter Weilbacher)

Tracking

Trunk
x86
OS/2
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

(Assignee)

Description

11 years ago
Created attachment 289176 [details]
screenshot of the problem in SeaMonkey MailNews

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.
(Assignee)

Comment 1

11 years ago
Created attachment 291116 [details] [diff] [review]
fix

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
(Assignee)

Comment 2

11 years ago
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.)
(Assignee)

Comment 3

11 years ago
Created attachment 291295 [details] [diff] [review]
[checked in] cleaned up fix

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
(Assignee)

Updated

11 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.