forked from paulrosen/abcjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
font_gen.html
42 lines (38 loc) · 1.11 KB
/
font_gen.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
<?xml version="1.0"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>abcjs: Font Generator</title>
<script src="raphael.js"></script>
<script src="font_generator/Emmentaler_400.font.js"></script>
<script src="write/sprintf.js"></script>
<script src="font_generator/scalefontemmentaler.js"></script>
<script>
function doScale() {
var paper = Raphael(document.getElementById("canvas"), 1000, 600);
var font = paper.getFont("Emmentaler", 500);
scale_font(font, 30, paper);
}
function showFont() {
var paper = Raphael(document.getElementById("canvas"), 1000, 10000);
var font = paper.getFont("Emmentaler", 500);
var scale = 30 / 1000;
var x = 0;
var y = 50;
for (glyph in font.glyphs) {
try {
symb = paper.path(font.glyphs[glyph].d).attr({fill: "#000", stroke: "none"});
symb.scale(scale, scale, x + 30, y);
// symb.translate(x + 30, y);
paper.text(x, y, glyph.charCodeAt(0).toString(16));
} catch (e) {
}
x = (x + 100) % 900;
if (x == 0) y += 50;
}
}
</script>
</head>
<body onload="showFont();">
<div id="canvas"></div>
</body>
</html>