You are here

function websafe_fonts_test_page_attachments in @font-your-face 8.3

Implements hook_page_attachments().

File

tests/websafe_fonts_test/websafe_fonts_test.module, line 21
Websafe Fonts Test module file.

Code

function websafe_fonts_test_page_attachments(&$page) {
  $enabled_fonts =& drupal_static('fontyourface_fonts', []);
  foreach ($enabled_fonts as $font) {
    if ($font->pid->value == 'websafe_fonts_test') {
      $page['#attached']['html_head'][] = [
        [
          '#type' => 'html_tag',
          '#tag' => 'meta',
          '#attributes' => [
            'name' => 'Websafe Font',
            'content' => $font
              ->label(),
          ],
        ],
        'fontyourface-websafe-fonts-test-' . $font
          ->id(),
      ];
    }
  }
}