You are here

function textactions_text2canvas_validate_fontfile in ImageCache Actions 6

Check if the named font is available

1 string reference to 'textactions_text2canvas_validate_fontfile'
textactions_text2canvas_form in ./textactions.inc
Place text on top of the current canvas

File

./textactions.inc, line 155
Helper functions for imagecache_textactions

Code

function textactions_text2canvas_validate_fontfile(&$element, &$form_status) {
  if (!($fontfile = textactions_find_font($element['#value'], TRUE))) {

    // Just warn, don't prevent
    drupal_set_message(t("\n      Unable to confirm that the font '%fontfile' is available on your system. \n      This may fail, or your system may provide an appropriate fallback, \n      depending on your toolkit behaviour. \n      Ensure the path to the ttf file is correct, \n      and permissions allow the webserver to read the file and directory.", array(
      '%fontfile' => $element['#value'],
    )), 'warning');
  }
  else {
    drupal_set_message(t("Font was found OK at %fontfile", array(
      '%fontfile' => $fontfile,
    )), 'notice');
  }
}