The default bug view has changed. See this FAQ.

Printing MathML: mfrac and msqrt bars are too thick

RESOLVED FIXED in mozilla2.0b11

Status

()

Core
MathML
RESOLVED FIXED
7 years ago
5 years ago

People

(Reporter: fredw, Unassigned)

Tracking

({helpwanted})

Trunk
mozilla2.0b11
x86
Linux
helpwanted
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [Fixed in bug 490475], URL)

Attachments

(1 attachment)

(Reporter)

Description

7 years ago
Created attachment 426856 [details]
Screenshot of a postscript of the MathML torture test

When printing MathML documents, the bars <mfrac/> and <msqrt/> are too thick. I attach a screenshot showing the problem.
(Reporter)

Comment 1

7 years ago
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
(Reporter)

Comment 3

7 years ago
> 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
(Reporter)

Updated

6 years ago
Keywords: helpwanted
Whiteboard: [good second bug]
(Reporter)

Comment 4

5 years ago
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
Last Resolved: 5 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.