You are here

function google_webfont_loader_api_get_font_list in Webfont Loader 7

Same name and namespace in other branches
  1. 8 google_webfont_loader_api.module \google_webfont_loader_api_get_font_list()
  2. 6 google_webfont_loader_api.module \google_webfont_loader_api_get_font_list()

Retrieve the list of available fonts.

3 calls to google_webfont_loader_api_get_font_list()
google_webfont_loader_api_init in ./google_webfont_loader_api.module
Implements hook_init().
google_webfont_loader_api_install in ./google_webfont_loader_api.install
Implements hook_install().
google_webfont_loader_api_site_settings in ./google_webfont_loader_api.admin.inc
Form to set what the google webfont loader api will load upon startup.

File

./google_webfont_loader_api.module, line 95
Google Webfont Loader API primary file The designer/developer creates a set of packages (will use .fontinfo files created in a similar manner to a module or theme .info file) from which the site admin can then choose for their site. The fonts can…

Code

function google_webfont_loader_api_get_font_list($reset = FALSE) {
  if ($reset) {
    $listings = drupal_system_listing('/\\.fontinfo$/', '');
    $font_list = array();
    foreach ($listings as $key => $listing) {
      $listing->info = drupal_parse_info_file($listing->uri);
    }
  }
  else {
    $listings = variable_get('google_webfont_loader_api_fontinfo_listing', array());
  }
  return $listings;
}