-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
74 lines (67 loc) · 2.48 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
68
69
70
71
72
73
74
<!DOCTYPE html>
<html lang="en">
<head>
<title>Font List Example</title>
<meta charset="utf-8" />
<script type="text/javascript">
function populateFontList(fontArr)
{
var allFontsCounter = 0;
var regularFontsCounter = 0;
var allFontsHTML = '<ul>';
var regularFontsHTML = allFontsHTML;
for (var key in fontArr)
{
var fontName = fontArr[key];
// trim
fontName = fontName.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
if (fontName.match(/[_\-\s]Italic$/)
|| fontName.match(/[_\-\s](Demi)?[Bb]old$/)
|| fontName.match(/[_\-\s]Medium$/)
|| fontName.match(/[_\-\s](Ultra)?[Ll]ight$/)
|| fontName.match(/[_\-\s]Condensed$/)
)
allFontsHTML += '<li style="color:#aaa;">'+fontName+'</li>';
else
{
allFontsHTML += '<li>'+fontName+'</li>';
fontName = fontName.replace(/\s*Regular$/, '');
regularFontsHTML += '<li>'+fontName+'</li>';
regularFontsCounter++;
}
allFontsCounter++;
}
regularFontsHTML += '</ul>';
allFontsHTML += '</ul>';
allFontsHTML = allFontsCounter+' fonts altogether:'+allFontsHTML;
regularFontsHTML = regularFontsCounter+' "regular" fonts:'+regularFontsHTML;
document.getElementById('fontList').innerHTML = allFontsHTML;
document.getElementById('regularFontList').innerHTML = regularFontsHTML;
console.log("JS: populateFontList finished");
}
window.onload = function()
{
document.body.innerHTML += '<object id="fontListSWF" type="application/x-shockwave-flash" data="FontList.swf" width="100" height="100">\
<param name="allowScriptAccess" value="always">\
</object>';
}
</script>
</head>
<body>
<table style="width:100%;">
<tr>
<td style="vertical-align: top;">
<h2>All Fonts:</h2>
<div id="fontList">
Listing not done yet... <em>(make sure Javascript and Flash are enabled)</em>
</div>
</td>
<td style="vertical-align: top;">
<h2>"Regular" Fonts:</h2>
<div id="regularFontList">
Listing not done yet... <em>(make sure Javascript and Flash are enabled)</em>
</div>
</td>
</tr>
</table>
</body>