IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
In this example, the entire text should fill, or try to fill, the entire textbox. For some reason it is smaller instead. Not sure why but for other text thats longer it overflows the text box. any help is greatly appreciated. Using version 6.8.9-9
<?php
$tempdir = "/home/jlahowetz2/DnD/DnD5/cardsets/ImageMagik_Generation/temp/";
$spcarddir = "/home/jlahowetz2/DnD/DnD5/cardsets/ImageMagik_Generation/base/spellcards/";
$pokerDescWidth = 161;
$pokerDescHeight = 170;
$spellname = str_replace(" ", "_", "Bane");
$description = "Casting Time: 1 action\nRange: 30 feet\nComponents: V, S, M\nDuration: Concentration up to 1 minute\n(a drop of blood) Up to three creatures of your choice that you can see within range must make Charisma saving throws. Whener a target that fails this saving throw makes an attack roll or a saving throw before the spell ends, the target must roll a d4 and subtract the number rolled from the attack roll or saving throw. At Higher Levels. When you cast this spell using a spell slot of 2nd level or higher, you can target one aditional creature for each slot level above 1st.";
$desctxt = new \Imagick();
$desctxt->setBackgroundColor("white");
$desctxt->newPseudoImage($pokerDescWidth, $pokerDescHeight, "Caption: ".$description);
$desctxt->writeImage($tempdir.$spellname.".png");
?>
$description = "Casting Time: 1 action\nRange: 30 feet\nComponents: V, S, M\nDuration: Concentration up to 1 minute\n(a drop of blood) Up to three creatures of your choice that you can see within range must make Charisma saving throws. Whener a target that fails this saving throw makes an attack roll or a saving throw before the spell ends, the targe";