You are here

function fontyourface_get_font_from_path in @font-your-face 6

Gets a font based on path parameters.

2 calls to fontyourface_get_font_from_path()
fontyourface_admin_add_form in ./fontyourface.module
Add form shows detail and enables a single font.
fontyourface_preprocess_page in ./fontyourface.module
Implements template_preprocess_page().

File

./fontyourface.module, line 585

Code

function fontyourface_get_font_from_path($module_path, $group_path, $font_path) {
  $font = FALSE;
  $available_fonts = fontyourface_available_fonts();
  $module_info = $available_fonts[$module_path];
  if ($module_info) {
    foreach ($module_info['fonts'] as $group_name => $group_info) {
      if ($group_info['path'] == $group_path) {
        foreach ($group_info['fonts'] as $font_name => $group_font) {
          if ($group_font['path'] == $font_path) {
            $font = array(
              'module' => $module_path,
              'provider' => $module_info['name'],
              'group' => $group_name,
              'group path' => $group_info['path'],
              'font name' => $font_name,
              'font' => $group_font,
            );
          }

          // if
        }

        // foreach
      }

      // if
    }

    // foreach
  }

  // if
  return $font;
}