You are here

function override_css_local_font_list_preview in Override css 7

1 call to override_css_local_font_list_preview()
override_css_font_list_preview in ./override_css.module

File

./override_css.module, line 531

Code

function override_css_local_font_list_preview() {
  $output = '';
  $fonts = override_css_local_font_list();
  $blocks = array();
  foreach ($fonts as $font => $family) {
    $blocks[] = '<div>' . ucfirst($font) . '<div><span style=\'font-family: ' . $family . '; color: #000000; font-style: normal; font-weight: normal; font-size: 40px; line-height: 40px;\'>AaGg</span></div></div>';
  }

  //tabelrijen samenstellen
  $rows = array();
  $row = 0;
  $columns = 0;
  foreach ($blocks as $block) {
    $rows[$row][] = $block;
    $columns++;
    if ($columns == 4) {
      $row++;
      $columns = 0;
    }
  }

  // lege kolommen opvullen
  if ($columns > 0 && $columns < 4) {
    while ($columns < 4) {
      $rows[$row][] = '';
      $columns++;
    }
  }
  return '<strong>Preview lokale lettertypes</strong>' . theme('table', array(
    'rows' => $rows,
    'attributes' => array(
      'class' => 'views-view-grid',
    ),
  ));
}