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