Add client triggers.
[lw2-viewer.git] / compute_FontAwesome_subset.php
blobcb6a2858b30293a9e498b48a5c31f2a0665cc2a8
1 <?php
3 $directories = [
4 "www/",
5 "www/accordius/",
6 "www/ea/"
7 ];
8 $files = [
9 "script.js",
10 "style.css.php",
11 "style_mobile_additions.css.php",
12 "theme_tweaker.css.php",
13 "theme-brutalist.css.php",
14 "theme-classic.css.php",
15 "theme-default.css.php",
16 "theme-grey.css.php",
17 "theme-less.css.php",
18 "theme-rts.css.php",
19 "theme-ultramodern.css.php",
20 "theme-zero.css.php",
22 $additional_files = [
23 "lw2.lisp"
25 $characters = [ ];
27 function process_file($filename) {
28 if (!file_exists($filename))
29 return;
31 global $characters;
33 $contents = file_get_contents($filename);
35 preg_match_all('/&#x(.{4})/', $contents, $matches);
36 $characters = array_merge($characters, $matches[1]);
38 preg_match_all('/\\\(F.{3})/', $contents, $matches);
39 $characters = array_merge($characters, $matches[1]);
42 foreach ($directories as $directory) {
43 foreach ($files as $file) {
44 process_file($directory.$file);
47 foreach ($additional_files as $file) {
48 process_file($file);
51 foreach ($characters as $key => $value) {
52 $characters[$key] = strtoupper($value);
54 $characters = array_unique($characters);
55 sort($characters);
56 echo implode(",",$characters);
57 echo "\n";