bug48555.phpt 858 B

1234567891011121314151617181920212223242526272829303132
  1. --TEST--
  2. Bug #48555 (ImageFTBBox() differs from previous versions for texts with new lines)
  3. --EXTENSIONS--
  4. gd
  5. --SKIPIF--
  6. <?php
  7. if(!function_exists('imageftbbox')) die('skip imageftbbox() not available');
  8. ?>
  9. --FILE--
  10. <?php
  11. $cwd = __DIR__;
  12. $font = "$cwd/Tuffy.ttf";
  13. $box = ImageFTBBox(14, 0, $font, "Text without line-break");
  14. //echo 'Top without line-break: ' . $box[7] . "\n";
  15. $without_line_break = $box[7];
  16. $box = ImageFTBBox(14, 0, $font, "Text with\nline-break\none more");
  17. //echo 'Top with line-break: ' . $box[7] . "\n";
  18. $with_line_break = $box[7];
  19. var_dump($without_line_break);
  20. var_dump($with_line_break);
  21. if ($with_line_break==$without_line_break) {
  22. echo "with line break == without line break".PHP_EOL;
  23. } else {
  24. echo "with line break != without line break".PHP_EOL;
  25. }
  26. ?>
  27. --EXPECTF--
  28. int(-%d)
  29. int(-%d)
  30. with line break == without line break