blob: 6f2642da1e1320af572d5799b68c7934208ec6d6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p><canvas width="500" height="200" id="c"></canvas></p>
<script type="text/javascript">
const t1 = '你好';
const t2 = 'Hello';
var c = document.getElementById('c').getContext('2d');
c.font = 'serif';
c.fontSize = '15';
c.fillText(t1, 10, 100);
c.fillText(t2, 10, 100);
</script>
</body>
</html>
|