RE: Shouldn't fonts embedded through @font-face be available in <canvas>?
Sergey Malkin <[email protected]>
| Newsgroups | gmane.comp.web.css.general,gmane.comp.web.fonts |
|---|---|
| Message-ID | <F759D7752D3BBC4999CA69FF4FB8BC130264E874@TK5EX14MBXW652.wingroup.windeploy.ntdev.microsoft.com> |
Adam wrote: > I just tested, and none of the implementations (Webkit, Firefox, Opera) One implementation is missing from your "none" list ;). Try attached in IE9 Beta or PPB5 (replace font url with your favorite). Thanks, Sergey
canvas.html
(text/html, 512 B)
<!DOCTYPE HTML>
<html>
<head>
<style>
@font-face {
font-family: CanvasTest;
src: url('Whimsy.woff');
}</style>
</head>
<body>
<div style="font-family:CanvasTest; font-size:24pt;">This is div</div>
<canvas id=canvas width=500 height=500"></canvas>
<script language="javascript">
var ctx = canvas.getContext("2d");
ctx.font = "24pt CanvasTest";
ctx.fillText("This is Canvas", 10, 50);
ctx.font = "24pt Arial";
ctx.fillText("This is Canvas", 10, 80);
</script>
</body>
</html>
CanvasWoff.png
(image/png, 10.7 KB) - not displayed