You are here

function local_fonts_add_form in @font-your-face 7

Same name and namespace in other branches
  1. 7.2 modules/local_fonts/local_fonts.module \local_fonts_add_form()

Form for submitting a local font.

1 string reference to 'local_fonts_add_form'
local_fonts_menu in modules/local_fonts/local_fonts.module
Implements hook_menu().

File

modules/local_fonts/local_fonts.module, line 86

Code

function local_fonts_add_form($form, $form_state) {
  $form = array();
  $form['local_fonts']['information'] = array(
    '#type' => 'fieldset',
    '#title' => t('Font Information'),
    '#collapsible' => FALSE,
  );
  $form['local_fonts']['information']['css_family'] = array(
    '#type' => 'textfield',
    '#title' => t('CSS Font Family'),
    '#required' => TRUE,
  );
  $form['local_fonts']['information']['css_style'] = array(
    '#type' => 'select',
    '#title' => t('CSS Font Style'),
    '#options' => array(
      'normal' => t('Normal'),
      'italic' => t('Italic'),
      'oblique' => t('Oblique'),
    ),
    '#required' => TRUE,
  );
  $form['local_fonts']['information']['css_weight'] = array(
    '#type' => 'select',
    '#title' => t('CSS Font Weight'),
    '#options' => array(
      'normal' => t('Normal'),
      'bold' => t('Bold'),
      'bolder' => t('Bolder'),
      'lighter' => t('Lighter'),
      '100' => t('100'),
      '200' => t('200'),
      '300' => t('300'),
      '400' => t('400'),
      '500' => t('500'),
      '600' => t('600'),
      '700' => t('700'),
      '800' => t('800'),
      '900' => t('900'),
    ),
    '#required' => TRUE,
  );
  $form['local_fonts']['upload']['eot'] = array(
    '#type' => 'file',
    '#title' => t('EOT font file'),
    '#description' => t('Embedded Open Type. This format is supported by IE 5-8.'),
  );
  $form['local_fonts']['upload']['ttf'] = array(
    '#type' => 'file',
    '#title' => t('TTF font file'),
    '#description' => t('Raw TrueType file, designed to look good on-screen. This format is supported by Webkit/Safari 3.1+, Safari Mobile iOS 4.2+, Opera 10+, Mozilla/Firefox 3.5+, and Chrome 4+'),
  );
  $form['local_fonts']['upload']['woff'] = array(
    '#type' => 'file',
    '#title' => t('WOFF font file'),
    '#description' => t('Web-only font format that uses gzip compression. This format is supported by IE9+, FF3.6+, Chrome 5+.'),
  );
  $form['local_fonts']['upload']['svg'] = array(
    '#type' => 'file',
    '#title' => t('SVG font file'),
    '#description' => t('An XML format required by iOS devices before version 4.2. Currently supported by iOS 4.1 and below, and Opera 10+.'),
  );
  $form = confirm_form($form, t('Import Local Font'), 'admin/config/fontyourface', '');
  $form['#attributes'] = array(
    'enctype' => 'multipart/form-data',
  );
  return $form;
}