Closed Bug 131437 Opened 23 years ago Closed 3 years ago

Weird FreeType font spacing

Categories

(Core :: Internationalization, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED INVALID
mozilla1.1alpha

People

(Reporter: tenthumbs, Unassigned)

Details

(Keywords: intl)

Attachments

(6 files, 1 obsolete file)

This fell out of bug 130661. The attached image is a montage of various screenshots of mozilla and ftstring from FreeType 2.0.9. All the text is anti-aliased. Note that the default mozilla freetype settings (no hinting) render the text quite differently. The best looking text for me is hinting but no autohinting. Note that mozilla and ftstring render the text almost identically although ftstring does seem to do a better job. There is also the issue of apparent darkening in the unhinted rendering but I guess that should be another bug.
Attached image screenshot montage
Text is nominally 14pt Verdana regular.
s/apparent darkening/apparent boldening/
could you try applying the patch in bug 130661 and see if that has an affect?
I don't really have to time to compile mozilla at the moment but I doubt 130661 is relevant, that's why I filed this bug. The only font directory mozilla sees has only normal weight fonts. I also checked that each font file has only one face in it. I did some more testing and it seems that only proportional fonts are affected. Look at the mozilla screenshots in the upcoming attachment. The unhinted/hinted layouts are significantly different for proportional fonts but the same for the fixed width ones. For Verdana, I tried the ftstring utility. Those screenshots show little difference. I also selected the test strings alone from the images and cropped out any surrounding white space as a measure of the bounding box for the entire string. I get unhinted | hint, no autohint -------------------------------- mozilla | 491x17 | 509x15 | | ftstring | 516x17 | 509x15 Obviously, there's some horizontal spacing problem in the unhinted case.
Attached file screenshots.zip (obsolete) —
Zip file with various screenshots.
Attached image ftstring-anti.png
Attachment #74616 - Attachment is obsolete: true
Attached image ftstring-hint-anti.png
Attached image moz-anti.png
Attached image moz-hint-anti.png
1st: thanks for the detailed report. It definitely helps, :). I see that for the string "@ABCDE..." the 'C' for moz is one pixel smaller (there are probably other spots that differ but I'm just point out the first one). I note that the advance width for the first 3 chars is correct then the 4th char is one short. This makes me think it could be a rounding error for the advance width.
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.1
would you try this patch?
I will probably need to work on this make it round correctly for negative numbers.
I really meant it when I said I didn't have time to compile mozilla. It's either compile mozilla or produce these wonderful bug reports. :-) Wouldn't an inline function be better than a macro? Something like inline int FT16_16ToReg (int x) { return (x + ((x<0) ? -0x7fff : 0x7fff)) >> 16; } BTW, if negative numbers are really possible then you need to fix FT_FLOOR as well, although you don't appear to use it right now.
Keywords: intl
QA Contact: ruixu → ylong
QA Contact: amyy → i18n

The bug assignee didn't login in Bugzilla in the last 7 months.
:m_kato, could you have a look please?
For more information, please visit auto_nag documentation.

Assignee: bstell → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(m_kato)

Closing old bugs as invalid.

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INVALID
Flags: needinfo?(m_kato)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: