Reply to comment

That indeed correct. A check

That indeed correct. A check should be performed. Above function should be.

<?php

/**
 * Themes an image from text
 */
function theme_your_module_formatter_text_as_image($element) {
  
//Validation
  
$string_to_obscure $element[0]['#item']['safe'];
  if (!
$string_to_obscure) {
    return;
  }

  
// Set up signwriter profile    
  
$profile->fontfile drupal_get_path('module''signwriter'). '/Arial.TTF';//See this issue why its like this (<a href="http://drupal.org/node/606670" title="http://drupal.org/node/606670">http://drupal.org/node/606670</a>)
  
$profile->fontsize 10;
  
$profile->foreground '000000';
  
$profile->background 'ffffff';
  
$profile->maxwidth 600;
  
$profile->transparent true;
  
$profile->imagetype 'png';
  
$profile->disable_span true
    
  
$textsignwriter_title_convert($string_to_obscure$profile);
  
//Some extra logic if it is an email    
  
$output preg_replace('/alt="[0-9a-zA-Z!@#\$%^&\*~\-\.\+\_\/=\?\|\{\}}]+"/','alt="Email Address"',$text);
    
  return 
$output;
}
?>

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd><img><p><b><i><table><th><tr><td><blockquote><br /><img /><tbody><span><strike>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <codes>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. The supported tag styles are: <foo>, [foo].
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.