-
Notifications
You must be signed in to change notification settings - Fork 1
/
fontSize.html
57 lines (40 loc) · 1.33 KB
/
fontSize.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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta charset="utf-8" />
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<script src="jquery-1.6.4.min.js"></script>
<script>
setTimeout(function() {
if (window.evoPdfConverter) {
window.evoPdfConverter.startConversion();
}
}, 15000)
</script>
</head>
<body>
<span id="measureSpan" style="display:none"></span>
<div id="outputDiv"></div>
<script>
var span = $('#measureSpan');
var div = $('#outputDiv');
var text = 'abcdef ghijklm nopqr stuvw xyz0123 456789A BCDEFGHI JKLMNOPQ RSTUVW XYZ';
span.html(text);
var results = '<table><tr><th>font</th><th>width</th><th>height</th><th>text</th></tr>';
for (var i = 5; i < 11; i++) {
for (var j = 0; j < 10; j++) {
var fontSize = i + '.' + j;
var font = fontSize + 'pt Tahoma';
span.css('font', font);
var w = span.width();
var h = span.height();
results += '<tr><td>' + fontSize + '</td><td>' + w + '</td><td>' + h + '</td><td style="font:' + font + '">' + text + '</td></tr>';
}
}
results += '</table>';
div.html(results);
</script>
</body>
</html>