-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathdebug-fonts.html
More file actions
147 lines (136 loc) · 5.38 KB
/
debug-fonts.html
File metadata and controls
147 lines (136 loc) · 5.38 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<!DOCTYPE html>
<html>
<head>
<title>Font Debug</title>
<link rel="stylesheet" href="/css/all.min.css">
<style>
body {
font-family: Arial, sans-serif;
padding: 20px;
background: #1e1e1e;
color: white;
}
.test-section {
margin: 20px 0;
padding: 15px;
border: 1px solid #444;
border-radius: 5px;
}
.icon-test {
margin: 10px 0;
font-size: 20px;
}
.icon-test i {
margin-right: 10px;
color: #47a864;
width: 30px;
display: inline-block;
}
.error { color: #ff6b6b; }
.success { color: #51cf66; }
#fontStatus { margin: 10px 0; }
.debug-info {
background: #2d2d2d;
padding: 10px;
border-radius: 3px;
font-family: monospace;
}
</style>
</head>
<body>
<h1>Font Awesome Debug Page</h1>
<div class="test-section">
<h2>Font Loading Status</h2>
<div id="fontStatus">Checking font loading...</div>
<div class="debug-info">
<div>CSS Path: /css/all.min.css</div>
<div>Font Path: /webfonts/fa-solid-900.woff2</div>
<div>User Agent: <span id="userAgent"></span></div>
</div>
</div>
<div class="test-section">
<h2>Icon Tests</h2>
<div class="icon-test"><i class="fa fa-tachometer"></i>Dashboard (should show speedometer)</div>
<div class="icon-test"><i class="fa fa-balance-scale"></i>Calibration (should show scales)</div>
<div class="icon-test"><i class="fa fa-cogs"></i>Settings (should show gears)</div>
<div class="icon-test"><i class="fa fa-upload"></i>Updates (should show upload arrow)</div>
<div class="icon-test"><i class="fa fa-home"></i>Home (should show house)</div>
<div class="icon-test"><i class="fa fa-wifi"></i>WiFi (should show wifi bars)</div>
<div class="icon-test"><i class="fa fa-check"></i>Check (should show checkmark)</div>
<div class="icon-test"><i class="fa fa-times"></i>Times (should show X)</div>
</div>
<div class="test-section">
<h2>Raw Unicode Tests</h2>
<div style="font-family: 'Font Awesome 6 Free'; font-weight: 900;">
<div>Dashboard: </div>
<div>Scale: </div>
<div>Cogs: </div>
<div>Upload: </div>
</div>
</div>
<script>
document.getElementById('userAgent').textContent = navigator.userAgent;
// Check if fonts are loaded
function checkFontLoading() {
const testElement = document.createElement('span');
testElement.style.fontFamily = '"Font Awesome 6 Free"';
testElement.style.fontWeight = '900';
testElement.innerHTML = '';
testElement.style.visibility = 'hidden';
document.body.appendChild(testElement);
setTimeout(() => {
const computed = window.getComputedStyle(testElement);
const fontFamily = computed.fontFamily;
const statusEl = document.getElementById('fontStatus');
if (fontFamily.includes('Font Awesome')) {
statusEl.innerHTML = '<span class="success">✓ Font Awesome 6 Free loaded successfully!</span>';
} else {
statusEl.innerHTML = '<span class="error">✗ Font Awesome 6 Free failed to load. Using fallback: ' + fontFamily + '</span>';
}
document.body.removeChild(testElement);
}, 1000);
}
// Test CSS loading
function testCSSLoading() {
fetch('/css/all.min.css')
.then(response => {
if (response.ok) {
console.log('CSS loaded successfully');
return response.text();
} else {
console.error('CSS failed to load:', response.status);
}
})
.then(css => {
if (css && css.includes('Font Awesome')) {
console.log('CSS contains Font Awesome definitions');
} else {
console.error('CSS does not contain expected Font Awesome content');
}
})
.catch(err => {
console.error('CSS loading error:', err);
});
}
// Test font file loading
function testFontLoading() {
fetch('/webfonts/fa-solid-900.woff2')
.then(response => {
if (response.ok) {
console.log('Font file loaded successfully, size:', response.headers.get('content-length'));
} else {
console.error('Font file failed to load:', response.status);
}
})
.catch(err => {
console.error('Font loading error:', err);
});
}
window.addEventListener('load', () => {
checkFontLoading();
testCSSLoading();
testFontLoading();
});
</script>
</body>
</html>