You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
<?php
|
|
|
|
|
|
|
|
// Script to convert icons.json in the FontAwesome download into a PHP array for SiteWriter
|
|
|
|
|
|
|
|
$json = file_get_contents(__DIR__ . "/icons.json");
|
|
|
|
$icons = json_decode($json, true);
|
|
|
|
$output = [];
|
|
|
|
foreach ($icons as $icon => $data) {
|
|
|
|
$meta = [];
|
|
|
|
$meta["label"] = $data["label"];
|
|
|
|
$meta["search"] = $data["search"]["terms"];
|
|
|
|
foreach ($data["styles"] as $s) {
|
|
|
|
$class = "fa";
|
|
|
|
switch ($s) {
|
|
|
|
case "solid":
|
|
|
|
$class = "fas";
|
|
|
|
break;
|
|
|
|
case "regular":
|
|
|
|
$class = "far";
|
|
|
|
break;
|
|
|
|
case "brands":
|
|
|
|
$class = "fab";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
$output["$class fa-$icon"] = $meta;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var_export($output);
|