| @@ -102,10 +102,8 @@ | ||
| 102 | 102 | return array(); |
| 103 | 103 | |
| 104 | 104 | $fonts = file_get_contents(dirname(__FILE__) . '/gwf.json'); |
| 105 | 105 | $fonts = json_decode($fonts); |
| 106 | - if( !property_exists($fonts, $face) ) | |
| 107 | - return null; | |
| 108 | 106 | $weights = $fonts->{$face}->weights; |
| 109 | 107 | |
| 110 | 108 | foreach ($weights as $weight) |
| 111 | 109 | { |
| @@ -123,36 +121,13 @@ | ||
| 123 | 121 | return array(); |
| 124 | 122 | |
| 125 | 123 | $fonts = file_get_contents(dirname(__FILE__) . '/gwf.json'); |
| 126 | 124 | $fonts = json_decode($fonts); |
| 127 | - if( !property_exists($fonts, $face) ) | |
| 128 | - return null; | |
| 129 | 125 | $styles = $fonts->{$face}->styles; |
| 130 | 126 | |
| 131 | 127 | foreach ($styles as $style) |
| 132 | 128 | { |
| 133 | 129 | $result[] = array('value' => $style, 'label' => $style); |
| 134 | - } | |
| 135 | - | |
| 136 | - return $result; | |
| 137 | -} | |
| 138 | - | |
| 139 | -VP_Security::instance()->whitelist_function('vp_get_gwf_subset'); | |
| 140 | - | |
| 141 | -function vp_get_gwf_subset($face) | |
| 142 | -{ | |
| 143 | - if(empty($face)) | |
| 144 | - return array(); | |
| 145 | - | |
| 146 | - $fonts = file_get_contents(dirname(__FILE__) . '/gwf.json'); | |
| 147 | - $fonts = json_decode($fonts); | |
| 148 | - if( !property_exists($fonts, $face) ) | |
| 149 | - return null; | |
| 150 | - $subsets = $fonts->{$face}->subsets; | |
| 151 | - | |
| 152 | - foreach ($subsets as $subset) | |
| 153 | - { | |
| 154 | - $result[] = array('value' => $subset, 'label' => $subset); | |
| 155 | 130 | } |
| 156 | 131 | |
| 157 | 132 | return $result; |
| 158 | 133 | } |