-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
67 lines (63 loc) · 1.57 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<!DOCTYPE html>
<html>
<head>
<title>JavaScript Audio Write Example</title>
<script type="text/javascript" src="jquery-1.7.2.js"></script>
<script type="text/javascript" src="js-printf.js"></script>
<script type="text/javascript" src="load.js"></script>
<script type="text/javascript" src="index.js"></script>
<script type="text/javascript">
var cvs = null, ctx = null, outlines = null, loader = new Load();
$(function(){
cvs = document.getElementById('c-test'), ctx = cvs.getContext("2d");
cvs.width = 1850;
cvs.height = 225;
$.get("node/export.out.txt",function(data){
outlines = loader.getOutline(data);
$.log("load outlines");
});
})
function draw(idx, offset){
offset = offset?offset:0;
var out = outlines[idx];
drawOutline(out, ctx, offset);
}
function doTest(){
var left = 0;
for(var i=0;i<outlines.length;i++){
var o = outlines[i];
drawOutline(o, ctx, left);
left += o.width;
}
}
</script>
<style type="text/css">
* {
padding: 0px;
margin: 0px;
}
body{
padding-left: 10px;
}
#c-test{
border: 1px dashed blue;
}
#title{
font-size: 100px;
font-family: "MusetteMusic4b";
padding: 0px;
margin: 0px;
}
</style>
</head>
<body>
<div id="title">
<span>a</span><span>b</span><span>R</span>
</div>
<div style="font:100px MusetteMusic4b;position:absolute;left: 300px;top:500px;">R</div>
<canvas id="c-test"></canvas>
<div>
<input type="button" value="draw" onclick="doTest();" />
</div>
</body>
</html>