Closed Bug 1011187 Opened 7 years ago Closed 7 years ago

HTML Canvas does not render small-caps font variants

Categories

(Core :: Canvas: 2D, defect)

32 Branch
x86_64
Windows 8.1
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla32
Tracking Status
firefox32 --- verified

People

(Reporter: simon.sarris, Assigned: jfkthame)

References

Details

Attachments

(1 file)

Setting the canvas font to a small-caps variant does not produce a small-caps effect. 

var can = document.getElementById('canvas1');
var ctx = can.getContext('2d');

ctx.font = "italic small-caps bold 22px verdana, tahoma, serif";
ctx.fillText("Test One Two Three", 50, 50);

Simple example: http://jsfiddle.net/vrS2B/

Other browsers:
  Chrome: Works
  iOS Safari: Works
  IE11: Does not work
Component: General → Canvas: 2D
Product: Firefox → Core
Confirmed 32.0a1 (2014-05-15), win 7 x64
Status: UNCONFIRMED → NEW
Ever confirmed: true
Fixing this within the current architecture used for small-caps in HTML is hard.

But if we move the implementation of small-caps from layout (nsTextFrame.cpp and nsTextRunTransformations.cpp) over into gfx, making it an attribute of gfxFontStyle that is implemented at rendering time, it'll become trivial.

I have an experimental patch for this refactoring. I'll file a separate bug for that, and tidy up the patch for review; then we can make this dependent on it.

(See also bug 935739 re XUL text.)
Depends on: 1015603
This issue is fixed by bug 1015603; here's a reftest for it.
Attachment #8428720 - Flags: review?(roc)
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Testcase:
https://hg.mozilla.org/integration/mozilla-inbound/rev/3e8879b65201
Target Milestone: --- → mozilla32
https://hg.mozilla.org/mozilla-central/rev/3e8879b65201
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Confirmed working in nightly. You guys are seriously the best in terms of bug response of all the browsers I deal with. By miles and miles.

Thank you so much.
verified based on comment 6
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.