/[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.23.4.14, Thu May 14 03:55:13 2009 UTC revision 1.23.4.15, Thu May 14 12:34:24 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: textimage.module,v 1.23.4.13 2009/05/12 23:47:14 deciphered Exp $  // $Id: textimage.module,v 1.23.4.14 2009/05/14 03:55:13 deciphered Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 363  function textimage_image_from_preset($pr Line 363  function textimage_image_from_preset($pr
363        }        }
364      }      }
365    }    }
366      $text_fixed_width = isset($text_fixed_width) ? $text_fixed_width : 0;
367    
368    // Set font path    // Set font path
369    $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 713  function textimage_text_to_image($text, Line 714  function textimage_text_to_image($text,
714    $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]);
715    
716    // Calculate dimensions of image.    // Calculate dimensions of image.
717    $image_width = ($fixed_width)    $image_width = ($fixed_width && $maximum_width > 0)
718      ? ($maximum_width - 1) * $cos + $text_height * $sin      ? ($maximum_width - 1) * $cos + $text_height * $sin
719      : $box_width;      : $box_width;
720    $image_height = ($fixed_width)    $image_height = ($fixed_width && $maximum_width > 0)
721      ? ($maximum_width - 1) * $sin + $text_height * $cos      ? ($maximum_width - 1) * $sin + $text_height * $cos
722      : $box_height;      : $box_height;
723    
# Line 729  function textimage_text_to_image($text, Line 730  function textimage_text_to_image($text,
730    $x = -$bbox[0];    $x = -$bbox[0];
731    $y = $box_height - $bbox[3];    $y = $box_height - $bbox[3];
732    
733    if ($fixed_width && $align !== ALIGN_LEFT) {    if (($fixed_width && $maximum_width > 0) && $align !== ALIGN_LEFT) {
734      switch ($align) {      switch ($align) {
735    
736        // Set text alignment center        // Set text alignment center
# Line 846  function theme_textimage_formatter($elem Line 847  function theme_textimage_formatter($elem
847    if (isset($element['#item']['email'])) {    if (isset($element['#item']['email'])) {
848      $alt = $title = '';      $alt = $title = '';
849    }    }
850    
851    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);
852  }  }
853    

Legend:
Removed from v.1.23.4.14  
changed lines
  Added in v.1.23.4.15

  ViewVC Help
Powered by ViewVC 1.1.2