You are here

function fontawesome_get_metadata_filepath in Font Awesome Icons 7.3

Loads the Font Awesome metadata file.

Return value

string The filepath of the metadata file.

1 call to fontawesome_get_metadata_filepath()
fontawesome_extract_icons in ./fontawesome.module
Provides a list of all available Font Awesome icons from metadata.

File

./fontawesome.module, line 578
Drupal integration with Font Awesome 5.

Code

function fontawesome_get_metadata_filepath() {

  // Load the library so we can get the path.
  $library = libraries_load(FONTAWESOME_LIBRARY . '_svg');

  // Attempt to load the icons from the local library's metadata if possible.
  $metadataFile = drupal_realpath($library['library path'] . '/metadata/icons.json');

  // If we can't load the local file, use the included module icons file.
  if (!file_exists($metadataFile)) {
    $metadataFile = drupal_get_path('module', 'fontawesome') . '/metadata/icons.json';
  }
  return $metadataFile;
}