Caption not Filling Textbox

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.
Post Reply
deadpickle
Posts: 5
Joined: 2013-09-15T21:19:49-07:00
Authentication code: 6789

Caption not Filling Textbox

Post by deadpickle »

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

Code: Select all

<?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");
?>
deadpickle
Posts: 5
Joined: 2013-09-15T21:19:49-07:00
Authentication code: 6789

Re: Caption not Filling Textbox

Post by deadpickle »

I tried to find the minimal amount of characters that are allowed before the text does not fill the vertical extent.

Code: Select all

$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";
Image

It seems that if you add a "t" to target you get:

Image
Post Reply