11 static $generic_names = array(
20 $fonts = explode(
',', $string);
22 foreach($fonts as $font) {
24 if ($font ===
'')
continue;
26 if (isset($generic_names[$font])) {
27 $final .= $font .
', ';
31 if ($font[0] ===
'"' || $font[0] ===
"'") {
32 $length = strlen($font);
33 if ($length <= 2)
continue;
35 if ($font[$length - 1] !== $quote)
continue;
36 $font = substr($font, 1, $length - 2);
39 for ($i = 0, $c = strlen($font); $i < $c; $i++) {
40 if ($font[$i] ===
'\\') {
46 if (ctype_xdigit($font[$i])) {
48 for ($a = 1, $i++; $i < $c && $a < 6; $i++, $a++) {
49 if (!ctype_xdigit($font[$i]))
break;
58 if ($i < $c && trim($font[$i]) !==
'') $i--;
61 if ($font[$i] ===
"\n")
continue;
63 $new_font .= $font[$i];
70 if (ctype_alnum($font) && $font !==
'') {
72 $final .= $font .
', ';
79 $font = str_replace(
"\\",
"\\\\", $font);
80 $font = str_replace(
"'",
"\\'", $font);
81 $final .=
"'$font', ";
83 $final = rtrim($final,
', ');
84 if ($final ===
'')
return false;