/[drupal]/contributions/modules/textimage/textimage.module
ViewVC logotype

Diff of /contributions/modules/textimage/textimage.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.37, Thu May 14 03:53:24 2009 UTC revision 1.38, Thu May 14 12:32:20 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: textimage.module,v 1.36 2009/05/12 23:45:01 deciphered Exp $  // $Id: textimage.module,v 1.37 2009/05/14 03:53:24 deciphered Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 364  function textimage_image_from_preset($pr Line 364  function textimage_image_from_preset($pr
364        }        }
365      }      }
366    }    }
367      $text_fixed_width = isset($text_fixed_width) ? $text_fixed_width : 0;
368    
369    // Set font path    // Set font path
370    $font_file = variable_get('textimage_fonts_path', drupal_get_path('module', 'textimage') . '/fonts') . '/' . $font_file;    $font_file = variable_get('textimage_fonts_path', drupal_get_path('module', 'textimage') . '/fonts') . '/' . $font_file;
# Line 714  function textimage_text_to_image($text, Line 715  function textimage_text_to_image($text,
715    $box_height = max($bbox[1], $bbox[3], $bbox[5], $bbox[7]) - min($bbox[1], $bbox[3], $bbox[5], $bbox[7]);    $box_height = max($bbox[1], $bbox[3], $bbox[5], $bbox[7]) - min($bbox[1], $bbox[3], $bbox[5], $bbox[7]);
716    
717    // Calculate dimensions of image.    // Calculate dimensions of image.
718    $image_width = ($fixed_width)    $image_width = ($fixed_width && $maximum_width > 0)
719      ? ($maximum_width - 1) * $cos + $text_height * $sin      ? ($maximum_width - 1) * $cos + $text_height * $sin
720      : $box_width;      : $box_width;
721    $image_height = ($fixed_width)    $image_height = ($fixed_width && $maximum_width > 0)
722      ? ($maximum_width - 1) * $sin + $text_height * $cos      ? ($maximum_width - 1) * $sin + $text_height * $cos
723      : $box_height;      : $box_height;
724    
# Line 730  function textimage_text_to_image($text, Line 731  function textimage_text_to_image($text,
731    $x = -$bbox[0];    $x = -$bbox[0];
732    $y = $box_height - $bbox[3];    $y = $box_height - $bbox[3];
733    
734    if ($fixed_width && $align !== ALIGN_LEFT) {    if (($fixed_width && $maximum_width > 0) && $align !== ALIGN_LEFT) {
735      switch ($align) {      switch ($align) {
736    
737        // Set text alignment center        // Set text alignment center
# Line 847  function theme_textimage_formatter($elem Line 848  function theme_textimage_formatter($elem
848    if (isset($element['#item']['email'])) {    if (isset($element['#item']['email'])) {
849      $alt = $title = '';      $alt = $title = '';
850    }    }
851    
852    return theme('textimage_image', drupal_substr($element['#formatter'], 10), $element['#item']['safe'], array(), 'png', $alt, $title);    return theme('textimage_image', drupal_substr($element['#formatter'], 10), $element['#item']['safe'], array(), 'png', $alt, $title);
853  }  }
854    

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.38

  ViewVC Help
Powered by ViewVC 1.1.2