Last Comment Bug 546044 - Printing MathML: mfrac and msqrt bars are too thick
: Printing MathML: mfrac and msqrt bars are too thick
[Fixed in bug 490475]
: helpwanted
Product: Core
Classification: Components
Component: MathML (show other bugs)
: Trunk
: x86 Linux
: -- normal with 1 vote (vote)
: mozilla2.0b11
Assigned To: Nobody; OK to take it and work on it
: Anthony Jones (:kentuckyfriedtakahe, :k17e)
Depends on: 490475
  Show dependency treegraph
Reported: 2010-02-13 14:12 PST by Frédéric Wang (:fredw)
Modified: 2012-02-26 16:27 PST (History)
3 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Screenshot of a postscript of the MathML torture test (4.71 KB, image/png)
2010-02-13 14:12 PST, Frédéric Wang (:fredw)
no flags Details

Description Frédéric Wang (:fredw) 2010-02-13 14:12:24 PST
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.
Comment 1 Frédéric Wang (:fredw) 2010-02-14 03:09:14 PST
I've just tried to display variables of

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.
Comment 2 Karl Tomlinson (back Dec 13 :karlt) 2010-02-14 11:51:47 PST
Does using CAIRO_HINT_METRICS_OFF here help?

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().
Comment 3 Frédéric Wang (:fredw) 2010-02-14 12:35:20 PST
> 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
Comment 4 Frédéric Wang (:fredw) 2012-02-26 09:58:18 PST
It seems that this works for me now.
Karl, are you aware of any changes that could have fixed this bug?
Comment 5 Karl Tomlinson (back Dec 13 :karlt) 2012-02-26 16:25:28 PST
Bug 490475, I expect.

Note You need to log in before you can comment on or make changes to this bug.