当前位置: 首页>>代码示例>>PHP>>正文


PHP ui::recognized_google_webfonts_families方法代码示例

本文整理汇总了PHP中ui::recognized_google_webfonts_families方法的典型用法代码示例。如果您正苦于以下问题:PHP ui::recognized_google_webfonts_families方法的具体用法?PHP ui::recognized_google_webfonts_families怎么用?PHP ui::recognized_google_webfonts_families使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ui的用法示例。


在下文中一共展示了ui::recognized_google_webfonts_families方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: fonts_families_preview

 /**
  * Generates CSS to preview Typography Fonts families
  *
  * @return void
  */
 public static function fonts_families_preview()
 {
     if (!option::is_on('framework_fonts_preview')) {
         return;
     }
     $css = '';
     $fonts = '';
     $font_families = ui::recognized_font_families();
     $google_font_families = ui::recognized_google_webfonts_families();
     foreach ($font_families as $slug => $font) {
         $css .= '.selectBox-dropdown-menu a[rel=' . $slug . ']{font-family:' . $font . ';}';
     }
     foreach ($google_font_families as $font) {
         if (isset($font['separator'])) {
             continue;
         }
         $slug = str_replace(' ', '-', strtolower($font['name']));
         $css .= '.selectBox-dropdown-menu a[rel=' . $slug . ']{font-family:' . $font['name'] . ';}';
         $fonts .= $font['name'] . '|';
     }
     $fonts = str_replace(" ", "+", $fonts);
     $google_css = '@import url("http' . (is_ssl() ? 's' : '') . '://fonts.googleapis.com/css?family=' . $fonts . "\");\n";
     $google_css = str_replace('|"', '"', $google_css);
     echo '<style type="text/css">';
     echo $google_css;
     echo $css;
     echo '</style>';
 }
开发者ID:MBerguer,项目名称:wp-demo,代码行数:33,代码来源:settings-page.php

示例2: typography

 public function typography($args)
 {
     extract($args);
     $selected_value = is_array(option::get($id)) ? option::get($id) : array();
     $out .= '<div class="zoom-typography">';
     $out .= "<label>{$name}</label>";
     /* fonts */
     $font_families = ui::recognized_font_families($id);
     $google_font_families = ui::recognized_google_webfonts_families($id);
     $font_family = isset($selected_value['font-family']) ? $selected_value['font-family'] : '';
     $out .= '<select name="' . $id . '[font-family]" id="' . $id . '-family" class="zoom-typography-family">';
     $out .= '<optgroup label="Web Safe Fonts">';
     $out .= '<option value="">font-family</option>';
     foreach ($font_families as $key => $value) {
         $out .= '<option value="' . esc_attr($key) . '" ' . selected($font_family, $key, false) . '>' . esc_attr($value) . '</option>';
     }
     $out .= '</optgroup>';
     $out .= '<optgroup label="Google Web Fonts">';
     foreach ($google_font_families as $value) {
         if (isset($value['separator'])) {
             $out .= '<option value="" disabled="disabled">' . $value['separator'] . '</option>';
             continue;
         }
         $key = str_replace(' ', '-', strtolower($value['name']));
         $out .= '<option value="' . esc_attr($key) . '" ' . selected($font_family, $key, false) . '>' . esc_attr($value['name']) . '</option>';
     }
     $out .= '</optgroup>';
     $out .= '</select>';
     /* style */
     $font_styles = ui::recognized_font_styles($id);
     $font_style = isset($selected_value['font-style']) ? $selected_value['font-style'] : '';
     $out .= '<select name="' . $id . '[font-style]" id="' . $id . '-style" class="zoom-typography-style">';
     $out .= '<option value="">font-style</option>';
     foreach ($font_styles as $key => $value) {
         $out .= '<option value="' . esc_attr($key) . '" ' . selected($font_style, $key, false) . '>' . esc_attr($value) . '</option>';
     }
     $out .= '</select>';
     /* sizing */
     $font_size = isset($selected_value['font-size']) ? $selected_value['font-size'] : '';
     $out .= '<select name="' . $id . '[font-size]" id="' . $id . '-size" class="zoom-typography-size">';
     $out .= '<option value="">size</option>';
     for ($i = 8; $i <= 72; $i++) {
         $size = $i . 'px';
         $out .= '<option value="' . esc_attr($size) . '" ' . selected($font_size, $size, false) . '>' . esc_attr($size) . '</option>';
     }
     $out .= '</select>';
     /* color */
     $font_color = isset($selected_value['font-color']) ? $selected_value['font-color'] : '';
     $out .= '<div class="colorSelector"><div></div></div><input name="' . $id . '[font-color]" id="' . $id . '-color" class="txt input-text input-colourpicker zoom-typography-color" type="text" value="' . $font_color . '"></input>';
     $out .= "<p>{$desc}</p>";
     $out .= '</div><!-- /div.zoom-typography -->';
     return $out;
 }
开发者ID:Bobcatou,项目名称:thenewreaganvision,代码行数:53,代码来源:settings-fields.php

示例3: dynamic_typography_css

 /**
  * Generates CSS for typography options from ZOOM Admin
  *
  * @param  array $option
  * @return string The CSS
  */
 public static function dynamic_typography_css($option)
 {
     $value = option::get($option['id']);
     if (!is_array($value)) {
         return '';
     }
     $font = array();
     if (isset($value['font-color']) && trim($value['font-color'])) {
         $font[] = "color: " . $value['font-color'] . ";";
     }
     if (isset($value['font-family']) && trim($value['font-family'])) {
         $font_families = ui::recognized_font_families($option['id']);
         $google_font_families = ui::recognized_google_webfonts_families($option['id']);
         if (array_key_exists($value['font-family'], $font_families)) {
             $font[] = "font-family: " . $font_families[$value['font-family']] . ";";
         }
         foreach ($google_font_families as $google_font_v) {
             if (isset($google_font_v['separator'])) {
                 continue;
             }
             $key = str_replace(' ', '-', strtolower($google_font_v['name']));
             if ($value['font-family'] == $key) {
                 $font[] = "font-family: '" . $google_font_v['name'] . "';";
                 self::dynamic_google_webfonts_register($google_font_v);
                 break;
             }
         }
     }
     if (isset($value['font-size']) && trim($value['font-size'])) {
         $font[] = "font-size: " . $value['font-size'] . ";";
     }
     if (isset($value['font-style']) && trim($value['font-style'])) {
         if ($value['font-style'] == 'bold-italic') {
             $font[] = "font-style: italic;";
             $font[] = "font-weight: bold;";
         } elseif ($value['font-style'] == 'bold') {
             $font[] = "font-weight: bold;";
         } else {
             $font[] = "font-style: " . $value['font-style'] . ";";
         }
     }
     if (empty($font)) {
         return '';
     }
     return $option['selector'] . '{' . implode('', $font) . '}';
 }
开发者ID:aaronfrey,项目名称:PepperLillie-FiveVirtues,代码行数:52,代码来源:theme.php


注:本文中的ui::recognized_google_webfonts_families方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。