You are here

function fontyourface_font_css in @font-your-face 6.2

Same name and namespace in other branches
  1. 8.3 fontyourface.module \fontyourface_font_css()
  2. 7.2 fontyourface.module \fontyourface_font_css()
  3. 7 fontyourface.module \fontyourface_font_css()

Creates CSS with any properties set on font.

12 calls to fontyourface_font_css()
common_fonts_fontyourface_preview in modules/common_fonts/common_fonts.module
Implements hook_fontyourface_preview().
common_fonts_fontyourface_view in modules/common_fonts/common_fonts.module
Implements hook_fontyourface_view().
fontdeck_fontyourface_preview in modules/fontdeck/fontdeck.module
Implements hook_fontyourface_preview().
fonts_com_fontyourface_preview in modules/fonts_com/fonts_com.module
Implements hook_fontyourface_preview().
fonts_com_fontyourface_view in modules/fonts_com/fonts_com.module
Implements hook_fontyourface_view().

... See full list

File

./fontyourface.module, line 1047

Code

function fontyourface_font_css($font) {
  $css = array();
  if ($font->css_family) {
    $css[] = 'font-family: ' . $font->css_family . ';';
  }

  // if
  if ($font->css_style) {
    $css[] = 'font-style: ' . $font->css_style . ';';
  }

  // if
  if ($font->css_weight) {
    $css[] = 'font-weight: ' . $font->css_weight . ';';
  }

  // if
  return implode(' ', $css);
}