| 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 |
| 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; |
| 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 |
|
|
| 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 |
| 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 |
|
|