View Full Version : Monogram Text on products
kyao888
12-17-2008, 09:10 PM
I have been looking for a script that I can type in a text, choose the font and color then display it on top of an image.
Something like this: http://www.liquidpixels.com/irce/#ballpointPen
Any ideas will be appreciated.
I think that this should work for you:
http://www.dynamicdrive.com/forums/showpost.php?p=161611&postcount=7
kyao888
12-18-2008, 04:35 PM
That's very cool. How can you implement font type and size selection?
Do you want that optional(the user's decision) or do you want it to be like that in the first place.
For someone else to do this themselves that havn't seen this code before it could be hard to customize the text. But if you want I can do it for you and hope it works. If you want it optional than it would be hard to code. Now if you want it to be like that in the first place then you would have to edit render.php.
To edit the font you would have to download a font or take one from your computer and place it in the same directory as the other one. To change it upload the font and change the following:
$amount = 5; //How many lines allowed?
$imageSRC = "bg.gif"; //Image, gif
$imageFont = "Maian.TTF";
header("Content-type: image/gif"); //Header: gif
$image = imagecreatefromgif($imageSRC); //create from gif
Also, if you wanted to change it to one line like that pen website then you would have to change three pages. You'd have to change the "makeIt.php":
$imageExt = "?colorData1=".$_POST['lineCA']."&textData1=".$_POST['lineTA'];
$imageExt .= "&colorData2=".$_POST['lineCB']."&textData2=".$_POST['lineTB'];
$imageExt .= "&colorData3=".$_POST['lineCC']."&textData3=".$_POST['lineTC'];
$imageExt .= "&colorData4=".$_POST['lineCD']."&textData4=".$_POST['lineTD'];
$imageExt .= "&colorData5=".$_POST['lineCE']."&textData5=".$_POST['lineTE'];
echo "render.php".$imageExt;
And delete the selected.
You'd have to change the picPreview.php page:
<table border="0" id="tableA">
<tr><td style="border-bottom: 2px solid grey;"><span>Text</span></td><td style="border-bottom: 2px solid grey;"> </td><td style="border-bottom: 2px solid grey;"><span>Hex #</span></td></tr>
<tr><td><label for="lineA">Line 1:</label></td><td><input type="text" id="lineA" name="lineTA" onkeyup="makePicture();" /></td><td><input type="text" id="lineCA" name="lineCA" onkeyup="makePicture();" /></td></tr>
<tr><td><label for="lineB">Line 2:</label></td><td><input type="text" id="lineB" name="lineTB" onkeyup="makePicture();" /></td><td><input type="text" id="lineCB" name="lineCB" onkeyup="makePicture();" /></td></tr>
<tr><td><label for="lineC">Line 3:</label></td><td><input type="text" id="lineC" name="lineTC" onkeyup="makePicture();" /></td><td><input type="text" id="lineCC" name="lineCC" onkeyup="makePicture();" /></td></tr>
<tr><td><label for="lineD">Line 4:</label></td><td><input type="text" id="lineD" name="lineTD" onkeyup="makePicture();" /></td><td><input type="text" id="lineCD" name="lineCD" onkeyup="makePicture();" /></td></tr>
<tr><td><label for="lineE">Line 5:</label></td><td><input type="text" id="lineE" name="lineTE" onkeyup="makePicture();" /></td><td><input type="text" id="lineCE" name="lineCE" onkeyup="makePicture();" /></td></tr>
</table>
And delete the selected. And you would also have to change the render.php page.
$amount = 5; //How many lines allowed?
$imageSRC = "bg.gif"; //Image, gif
$imageFont = "Maian.TTF";
header("Content-type: image/gif"); //Header: gif
$image = imagecreatefromgif($imageSRC); //create from gif
And switch the highlighted to 1.
The font size should be on line 23 in render.php:
if(!empty($getData_text[$i])){
$a += 15;
imagettftext($image, 12, 0, 75, $a, hex2rgb($getData_color[$i]), $imageFont, $getData_text[$i]);
}
I hope this helps you,
Nile
kyao888
12-19-2008, 02:10 PM
wow! Thanks you so much for your advise. I believe that I want to implement a text box where users can type in their initials (1-5 letters) then I will have a drop down to select the font, size and color. I will then need to show a preview of the selections. If there is a possibility that I can even let them upload images then that will be great but totally optional.
ex: http://www.liquidpixels.com/irce/#crystalOctagon
Is this something that you can help me write and I can pay for your time?
Thanks.
Kevin
Sure I'll do it for you. Send over the image you want and also send an example of what it should look like and I'll hopefully find time to do it for you.
Terminology note: a 'monogram' is usually a design formed of characters combined into a single glyph (mono: one; gram: character). Uncombined, they would properly be a 'cypher'.
kyao888
12-22-2008, 03:37 PM
Sure I'll do it for you. Send over the image you want and also send an example of what it should look like and I'll hopefully find time to do it for you.
Can you email me your contact email address? mine is kyao888@gmail.com - We should talk a bit more about this project privately. Maybe I can hire you to fully develop this application.
Thanks,
Kevin
jeremyfifty9@gmail.com
I would've sent a PM but you disabled it.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.