You are here

function fontsquirrel_preprocess_page in @font-your-face 7

Same name and namespace in other branches
  1. 6.2 modules/fontsquirrel/fontsquirrel.module \fontsquirrel_preprocess_page()
  2. 6 modules/fontsquirrel/fontsquirrel.module \fontsquirrel_preprocess_page()

Implements template_preprocess_page().

File

modules/fontsquirrel/fontsquirrel.module, line 44

Code

function fontsquirrel_preprocess_page(&$vars) {
  if (!empty($vars['fontyourface'])) {
    $paths = array();
    foreach ($vars['fontyourface'] as $used_font) {
      if ($used_font->provider == 'fontsquirrel') {
        $metadata = unserialize($used_font->metadata);
        $paths[] = $metadata['path'];
      }

      // if
    }

    // foreach
    if (count($paths) > 0) {
      foreach ($paths as $path) {
        fontyourface_add_css_in_preprocess($vars, 'fontyourface/fontsquirrel/' . $path . '-fontfacekit/stylesheet.css');
      }

      // foreach
    }

    // if
  }

  // if
}