You are here

function textimage_help in Textimage 5

Same name and namespace in other branches
  1. 8.4 textimage.module \textimage_help()
  2. 8.3 textimage.module \textimage_help()
  3. 5.2 textimage.module \textimage_help()
  4. 6.2 textimage.module \textimage_help()
  5. 7.3 textimage.module \textimage_help()
  6. 7.2 textimage.module \textimage_help()

Implementation of hook_help().

File

./textimage.module, line 36

Code

function textimage_help($section) {
  $output = "";
  switch ($section) {
    case 'admin/help#textimage':
      $output .= '<h2 id="textimage-introduction">The dynamic text to image generator!</h2>';
      $output .= '<p>Text image is a module which allows you to create dynamic images using any font installed on the server.</p>';
      $output .= '<p>Creating images from text has several important advantages and disadvantages. The greatest advantage is it allows you to use any font you wish for headlines and titles without the user needing to install the font. Another advantage is the wide browser support for images and available accessibility features (alt and title tags for instance), so screen readers should be able to handle your images without problem. You might also prefer text images over the <a href="http://www.mikeindustries.com/sifr/">sIFR approach</a> because generated images are not disabled by many ad-blocking tools. However, an important limitation of Text Image module is wrapping of text, which it does not currently support and cannot compete with the dynamic abilities of a Flash based solution. If you need to create images with wrapped text, sIFR may be a better solution.</p>';
      $output .= '<h2>Installing Fonts</h2>';
      $output .= '<p>Text image is dependent on the GD2 library for text manipulations. You can check what version of GD you have on the <a href="!config">Text Image configuration page</a>. Before you can begin using Text Image you must upload at least one TrueType font to the server and tell Text Image where you uploaded it. All fonts must have the .tff extension to be seen by Text Image. If you do not have any TTF fonts to start using Text Image, you can download some free GNU fonts from the <a href="http://savannah.nongnu.org/projects/freefont/">Free UCS Outline Fonts Project</a>. Once the fonts are uploaded, enter the UNIX-style path the fonts on the <a href="!config">configuration page</a>. If you are using Text Image with the Captcha module, you\'ll also need to set a seperate directory on the <a href="!captcha">Text Image Captcha Settings</a> for fonts to be used at random.</p>';
      $output .= '<h2 id="textimage-configuration">Configuration</h2>';
      $output .= '<p>The basis of Text Image is made of configuration options called <em>presets</em>. A preset defines what font, size, color, etc. should be used in the generated image. You can create a new preset by clicking on the tab by the same name from the <a href="!config">configuration page</a>. Most options are pretty self explanatory, but background images can get pretty complicated if you begin to use other presets as backgrounds. Let\'s run through an example.';
      $output .= '<p>If you specified a backgrounds directory on the main configuration page, a list of backgrounds is automatically popuplated into the Background Image select list. Let\'s say there\'s a image called &quot;header.png&quot; in the image list that looks like this:<p>';
      $output .= '<p><img src="!example1" alt="example1" /></p>';
      $output .= '<p>Now we\'ll create a preset called &quot;preset1&quot;. In this preset, set the font to braggadacio.ttf (not included), 54px, #FFFFFF (white) color. Select header.png from the background list and position the text at x-offset 14 and y-offset 22 (in pixels). After the preset is saved, Text Image is now ready to automatically generate images based on text strings. You could directly visit the image at {files}/textimage/preset1/Hello.png (where {files} is your sites file directory) and get the following result:</p>';
      $output .= '<p><img src="!example2" alt="example2" /></p>';
      $output .= '<p>To get crazy now, create a new preset called &quot;preset2&quot;. In this preset, set the font to century.ttf (also not included), 20px, #000000 (black) color. Select <em>preset1</em> from the background list and position the text at x-offset 14 and y-offset 94. Save the preset then visit {files}/textimage/preset2/Hello/world!.png and get the following result:</p>';
      $output .= '<p><img src="!example3" alt="example3" /></p>';
      $output .= '<p>The entire preset1 is generated using the first argument <em>Hello</em>. Then preset2 is generated using the name of the file <em>world!.png</em>. You could continue chaining presets together over and over again, but be sure not to create a loop.</p>';
      $output .= '<h2>File Names and Storage</h2>';
      $output .= '<p>Text Image supports .png, .gif, and .jpg input and output files. You can change the output format of the image simply by changing the extension of the last file. In the above example we made PNG images. If we had appended it with .jpg, a JPG image would have been created. Only PNG and GIF files support transparent backgrounds.</p>';
      $output .= '<p>When directly calling URLs for text images, underscores (_) may be used in the place of spaces.</p>';
      $output = t($output, array(
        '!config' => url('admin/settings/textimage'),
        '!captcha' => url('admin/settings/textimage/captcha'),
        '!example1' => base_path() . drupal_get_path('module', 'textimage') . '/misc/example1.png',
        '!example2' => base_path() . drupal_get_path('module', 'textimage') . '/misc/example2.png',
        '!example3' => base_path() . drupal_get_path('module', 'textimage') . '/misc/example3.png',
      ));
      break;
    case 'admin/build/modules#description':
    case 'admin/build/modules/textimage':
    case 'admin/settings/textimage':
      $output = t('Provides text to image manipulations and image based captcha challenge (with Captcha module).');
      break;
  }
  return $output;
}