function enlightenment_build_google_fonts_list() { $fonts = $_POST['data']['items']; $local = enlightenment_web_fonts(); $output = ''; foreach ($fonts as $font) { if (array_key_exists($font['family'], $local)) { continue; } if (current_theme_supports('enlightenment-web-fonts', 'filter_by_subsets')) { $continue = false; foreach (current_theme_supports('enlightenment-web-fonts', 'subsets') as $subset) { if (!in_array($subset, $font['subsets'])) { $continue = true; } } if ($continue) { continue; } } $output .= enlightenment_checkbox(array('name' => current_theme_supports('enlightenment-theme-settings', 'option_name') . '[web_fonts][' . $font['family'] . '][family]', 'value' => $font['family'], 'checked' => false, 'label' => $font['family']), false); $output .= enlightenment_hidden_input(array('name' => current_theme_supports('enlightenment-theme-settings', 'option_name') . '[web_fonts][' . $font['family'] . '][category]', 'value' => $font['category']), false); $output .= enlightenment_hidden_input(array('name' => current_theme_supports('enlightenment-theme-settings', 'option_name') . '[web_fonts][' . $font['family'] . '][variants]', 'value' => join(',', $font['variants'])), false); $output .= enlightenment_hidden_input(array('name' => current_theme_supports('enlightenment-theme-settings', 'option_name') . '[web_fonts][' . $font['family'] . '][subsets]', 'value' => join(',', $font['subsets'])), false); $output .= '<br />'; } echo apply_filters('enlightenment_build_google_fonts_list', $output); die; }
function enlightenment_available_fonts() { $fonts = array('Helvetica Neue' => array('category' => 'sans-serif', 'family' => '"Helvetica Neue", Helvetica, "Nimbus Sans L"'), 'Geneva' => array('category' => 'sans-serif', 'family' => 'Geneva, Verdana, "DejaVu Sans"'), 'Tahoma' => array('category' => 'sans-serif', 'family' => 'Tahoma, "DejaVu Sans"'), 'Trebuchet MS' => array('category' => 'sans-serif', 'family' => '"Trebuchet MS", "Bitstream Vera Sans"'), 'Lucida Grande' => array('category' => 'sans-serif', 'family' => '"Lucida Grande", "Lucida Sans Unicode", "Bitstream Vera Sans"'), 'Georgia' => array('category' => 'serif', 'family' => 'Georgia, "URW Bookman L"'), 'Times' => array('category' => 'serif', 'family' => 'Times, "Times New Roman", "Century Schoolbook L"'), 'Palatino' => array('category' => 'serif', 'family' => 'Palatino, "Palatino Linotype", "URW Palladio L"'), 'Courier' => array('category' => 'monospace', 'family' => 'Courier, "Courier New", "Nimbus Mono L"'), 'Monaco' => array('category' => 'monospace', 'family' => 'Monaco, Consolas, "Lucida Console", "Bitstream Vera Sans Mono"')); if (current_theme_supports('enlightenment-web-fonts')) { $web_fonts = enlightenment_web_fonts(); $fonts = array_merge($fonts, $web_fonts); } return apply_filters('enlightenment_available_fonts', $fonts); }
function enlightenment_enqueue_theme_options_font($option) { $default_options = enlightenment_default_theme_options(); if (enlightenment_theme_option($option . '_font_family') != $default_options[$option . '_font_family'] && array_key_exists(enlightenment_theme_option($option . '_font_family'), enlightenment_web_fonts())) { enlightenment_enqueue_font(enlightenment_theme_option($option . '_font_family'), array(enlightenment_theme_option($option . '_font_style'))); } }
function enlightenment_get_font_atts($font) { $fonts = enlightenment_web_fonts(); if (isset($fonts[$font])) { return $fonts[$font]; } return false; }