Closed Bug 400578 Opened 17 years ago Closed 17 years ago

Font rendering using itemized glyph runs ugly with font-size-adjust style

Categories

(Core :: Layout: Text and Fonts, defect, P4)

x86
Linux
defect

Tracking

()

RESOLVED FIXED
mozilla1.9beta3

People

(Reporter: stephen.moehle, Assigned: karlt)

References

Details

(Keywords: regression)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a9pre) Gecko/2007101920 Firefox/3.0a9pre
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a9pre) Gecko/2007101920 Firefox/3.0a9pre

Font rendering using itemized glyph runs, CreateGlyphRunsItemizing(), looks pretty bad when the font-size-adjust style is used. The text seems squished horizontally. Fast path (8 bit, CreateGlyphRunsFast()) rendering looks fine. See the attached test case for examples.

I believe this is a regression from bug 362682 as build 2007-10-05-04 does not exhibit the problem and 2007-10-06-04 does. I also think the changes to CreateGlyphRunsItemizing() are key. If I restore that, and the code it depends on, to the pre bug 362682 state, rendering is fine.

Reproducible: Always
Keywords: regression
Version: unspecified → Trunk
I guess the problem is that the PangoFont that Pango uses in pango_shape does not adjust the size whereas gfxPangoFont from GetOrMakeFont does adjust.

http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/gfx/thebes/src/gfxPangoFonts.cpp&rev=1.109&mark=1094,1128#1094

Getting Pango to adjust for fallback fonts would require either support from Pango (not available yet) or significant changes to the font selection algorithm.  But a hack to get the adjustment correct for the first specified and available font could make things work most of the time.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: blocking1.9?
Depends on: 401988
Flags: blocking1.9? → blocking1.9+
Assignee: nobody → mozbugz
The testcase now renders as expected due to changes in bug 401988.

These changes are enough to get the adjustment right for the primary font (from the FcFontSort) for the specified language.  If other fonts are required (for different languages for example) then the same adjustment is applied rather than calculating the adjustment for each font, but that is good enough for now.
(The spacing and size-adjustment will still match now.)
Status: NEW → RESOLVED
Closed: 17 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9 M11
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: