Closed Bug 588731 Opened 14 years ago Closed 14 years ago

svg text metrics incorrect with harfbuzz/GDI backend

Categories

(Core :: Graphics, defect)

x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
blocking2.0 --- beta5+

People

(Reporter: jfkthame, Assigned: jfkthame)

References

Details

Attachments

(2 files)

Turning on harfbuzz (gfx.font_rendering.harfbuzz.level=1) under GDI on Windows leads to errors in text layout for SVG text. The attached example illustrates the problem; it displays correctly with harfbuzz off, or with harfbuzz/dwrite, but the glyph positioning is wrong with harfbuzz/gdi.
Blocks: 569531
This occurs because the SVG text code uses a temporary gfxContext when creating glyph runs; when the harfbuzz shaper calls back to gfxGDIFont::GetHintedGlyphMetrics, this context has not been set up with the appropriate font and so we get metrics for the default Windows font and size instead. In the "normal" (non-SVG-text) case, the current DC has been set up appropriately at a higher level, which is why this issue only shows up within SVG, not HTML text.

This fixes a collection of mochitest failures that were occurring with harfbuzz enabled on windows.
Assignee: nobody → jfkthame
Attachment #467372 - Flags: review?(jdaggett)
Attachment #467372 - Flags: review?(jdaggett) → review+
Comment on attachment 467372 [details] [diff] [review]
patch, v1 - ensure the proper font is selected into the DC when getting glyph metrics

Requesting approval to land this on trunk. Although this is part of the build, it is currently preffed off; we need this fix in place before we can flip the pref to turn on harfbuzz by default on Windows/GDI.
Attachment #467372 - Flags: approval2.0?
Comment on attachment 467372 [details] [diff] [review]
patch, v1 - ensure the proper font is selected into the DC when getting glyph metrics

I'd even block
Attachment #467372 - Flags: approval2.0?
In fact, I will block!
blocking2.0: --- → beta5+
http://hg.mozilla.org/mozilla-central/rev/c6da8fefd6a8
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: