<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<canvas id="myCanvas" width="500" height="500"></canvas>
</body>
<script type="text/javascript">
var myCanvas = document.getElementById("myCanvas");
var ctx = myCanvas.getContext('2d');
//描述空心文字 
ctx.font = 'italic 50px 宋体';
ctx.strokeStyle = 'red';
ctx.strokeText('我好帅',100,100);
//实心文字
ctx.font = 'italic 50px 宋体';
ctx.strokeStyle = 'blue';
ctx.fillText('我好帅',100,100);
</script>
</html>