/[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.19.2.16, Thu May 14 03:56:38 2009 UTC revision 1.19.2.17, Thu May 14 12:36:47 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: textimage.module,v 1.19.2.15 2009/05/12 23:49:30 deciphered Exp $  // $Id: textimage.module,v 1.19.2.16 2009/05/14 03:56:38 deciphered Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 338  function textimage_image_from_preset($pr Line 338  function textimage_image_from_preset($pr
338        }        }
339      }      }
340    }    }
341      $text_fixed_width = isset($text_fixed_width) ? $text_fixed_width : 0;
342    
343    // Set font path    // Set font path
344    $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 686  function textimage_text_to_image($text, Line 687  function textimage_text_to_image($text,
687    $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]);
688    
689    // Calculate dimensions of image.    // Calculate dimensions of image.
690    $image_width = ($fixed_width)    $image_width = ($fixed_width && $maximum_width > 0)
691      ? ($maximum_width - 1) * $cos + $text_height * $sin      ? ($maximum_width - 1) * $cos + $text_height * $sin
692      : $box_width;      : $box_width;
693    $image_height = ($fixed_width)    $image_height = ($fixed_width && $maximum_width > 0)
694      ? ($maximum_width - 1) * $sin + $text_height * $cos      ? ($maximum_width - 1) * $sin + $text_height * $cos
695      : $box_height;      : $box_height;
696    
# Line 702  function textimage_text_to_image($text, Line 703  function textimage_text_to_image($text,
703    $x = -$bbox[0];    $x = -$bbox[0];
704    $y = $box_height - $bbox[3];    $y = $box_height - $bbox[3];
705    
706    if ($fixed_width && $align !== ALIGN_LEFT) {    if (($fixed_width && $maximum_width > 0) && $align !== ALIGN_LEFT) {
707      switch ($align) {      switch ($align) {
708    
709        // Set text alignment center        // Set text alignment center

Legend:
Removed from v.1.19.2.16  
changed lines
  Added in v.1.19.2.17

  ViewVC Help
Powered by ViewVC 1.1.2