コード例 #1
0
ファイル: ot-google-fonts.php プロジェクト: gigikir/adebe
/**
 * Google Fonts Ajax Callback
 *
 * Returns a json string with all Google Fonts from DB
 *
 * @return string
 *
 */
function ot_ajax_get_google_font()
{
    // get the google font array - located in ot-google-fonts.php
    $google_font_array = googlefont_select();
    // loop through the cached google font array if available and append to default fonts
    $font_array = array();
    if ($google_font_array) {
        foreach ($google_font_array as $index => $value) {
            $font_array[$value['value']];
        }
    }
    // put both arrays together
    $array = array_merge($font_array);
    die(json_encode($array));
}
コード例 #2
0
ファイル: functions.php プロジェクト: gigikir/adebe
function ot_filter_recognized_font_families($array, $field_id)
{
    global $default_theme_fonts;
    // default fonts used in this theme, even though there are not google fonts
    $default_theme_fonts = array('Arial' => 'Arial', 'Helvetica' => 'Helvetica', 'Sans Serif' => 'Sans serif', 'Helvetica Neue' => 'Helvetica Neue', 'Georgia' => 'Georgia', 'Times New Roman' => 'Times New Roman', 'Serif' => 'Serif', 'Tahoma' => 'Tahoma', 'Geneva' => 'Geneva', 'Trebuchet MS' => 'Trebuchet MS', 'Verdana' => 'Verdana');
    // get the google font array - located in ot-google-fonts.php
    $google_font_array = googlefont_select();
    // loop through the cached google font array if available and append to default fonts
    $font_array = array();
    if ($google_font_array) {
        foreach ($google_font_array as $index => $value) {
            $font_array[$value['value']] = $value['label'];
        }
    }
    // put both arrays together
    $array = array_merge($default_theme_fonts, $font_array);
    return $array;
}