-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathcompute_FontAwesome_subset.php
More file actions
64 lines (55 loc) · 1.26 KB
/
Copy pathcompute_FontAwesome_subset.php
File metadata and controls
64 lines (55 loc) · 1.26 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
<?php
$directories = [
"www/",
"www/accordius/",
"www/ea/"
];
$files = [
"head.js",
"script.js",
"style.css.php",
"style_mobile_additions.css.php",
"theme_tweaker.css.php",
"theme-brutalist.css.php",
"theme-classic.css.php",
"theme-default.css.php",
"theme-grey.css.php",
"theme-less.css.php",
"theme-rts.css.php",
"theme-ultramodern.css.php",
"theme-zero.css.php",
];
$additional_files = [
"www/about.html",
"lw2.lisp",
"src/data-viewers/comment.lisp",
"src/data-viewers/post.lisp",
"src/data-viewers/tag.lisp",
];
$characters = [ ];
function process_file($filename) {
if (!file_exists($filename))
return;
global $characters;
$contents = file_get_contents($filename);
preg_match_all('/&#x(.{4})/', $contents, $matches);
$characters = array_merge($characters, $matches[1]);
preg_match_all('/\\\([FE].{3})/i', $contents, $matches);
$characters = array_merge($characters, $matches[1]);
}
foreach ($directories as $directory) {
foreach ($files as $file) {
process_file($directory.$file);
}
}
foreach ($additional_files as $file) {
process_file($file);
}
foreach ($characters as $key => $value) {
$characters[$key] = strtoupper($value);
}
$characters = array_unique($characters);
sort($characters);
echo implode(",",$characters);
echo "\n";
?>