开发者

PHP Image Generation With Super / Sub Scripts

I'm looking to generate PHP images on the fly. So far I'm using this script and its doing well:

<?php

header("Content-type: image/png");
$strin开发者_StackOverflowg = $_GET['text'];
$im     = imagecreatefrompng("images/button1.png");
$orange = imagecolorallocate($im, 220, 210, 60);
$px     = (imagesx($im) - 7.5 * strlen($string)) / 2;
imagestring($im, 3, $px, 9, $string, $orange);
imagepng($im);
imagedestroy($im);

?>

However I want to use super/subscripts in the string input. I've tried using the HTML equivilent of and but to no avail.

Any pointers?


Write in a smaller font size and a higher/lower vertical position relative to the other text. That's all super/sub scripts are... different parameters for imagestring. There's no need for there to be a separate way to write that text from other text in a 2D drawing lib.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜