Closed Bug 546044 Opened 14 years ago Closed 12 years ago

Printing MathML: mfrac and msqrt bars are too thick

Categories

(Core :: MathML, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla2.0b11

People

(Reporter: fredw, Unassigned)

References

()

Details

(Keywords: helpwanted, Whiteboard: [Fixed in bug 490475])

Attachments

(1 file)

When printing MathML documents, the bars <mfrac/> and <msqrt/> are too thick. I attach a screenshot showing the problem.
I've just tried to display variables of
http://mxr.mozilla.org/mozilla-central/source/layout/mathml/nsMathMLFrame.cpp#278

1) Screen
ascent: 520
descent: -460
RuleThickness: 60
xHeight: 380

2) Postcript
ascent: 560
descent: -400
RuleThickness: 160
xHeight: 400

So the only workaround I've found for now is to fall-back to the former version if aRuleThickness >= xHeight / 3.
Does using CAIRO_HINT_METRICS_OFF here help?

http://hg.mozilla.org/mozilla-central/annotate/38929916c6d1/gfx/thebes/src/gfxPangoFonts.cpp#l2529

Maybe we should only use CAIRO_HINT_METRICS_ON when hint_style != CAIRO_HINT_STYLE_NONE.

But glyph positions are still snapped to pixels when they are drawn, so it actually makes sense (for ordinary text at least) to have their advances snapped to pixels (which CAIRO_HINT_METRICS_ON will do).

If CAIRO_HINT_METRICS_OFF gives better results, this could be used only in the TIGHT_HINTED_OUTLINE_EXTENTS case for GetBoundingMetrics by passing an argument to gfxFcFont::GetOrMakeFont() from a new gfxFcFont::Measure() method.

See gfxWindowsFont::Measure().

http://mxr.mozilla.org/mozilla-central/ident?i=TIGHT_HINTED_OUTLINE_EXTENTS
> Does using CAIRO_HINT_METRICS_OFF here help?

Yes, the torture test is printed correctly.

Compared to comment 1, the values when printing are now:
ascent: 505
descent: -460
RuleThickness: 45
xHeight: 378
Keywords: helpwanted
Whiteboard: [good second bug]
It seems that this works for me now.
Karl, are you aware of any changes that could have fixed this bug?
Bug 490475, I expect.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Whiteboard: [good second bug] → [Fixed in bug 490475]
Depends on: 490475
Target Milestone: --- → mozilla2.0b11
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: