Results 1 to 9 of 9

Thread: Monogram Text on products

  1. #1
    Join Date
    Dec 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Monogram Text on products

    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.

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    I think that this should work for you:
    http://www.dynamicdrive.com/forums/s...11&postcount=7
    Jeremy | jfein.net

  3. #3
    Join Date
    Dec 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    That's very cool. How can you implement font type and size selection?

  4. #4
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    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:

    Code:
    $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":

    Code:
    $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:

    Code:
    <table border="0" id="tableA">
    	  <tr><td style="border-bottom: 2px solid grey;"><span>Text</span></td><td style="border-bottom: 2px solid grey;">&nbsp;</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.

    Code:
    $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:
    Code:
      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
    Jeremy | jfein.net

  5. #5
    Join Date
    Dec 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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

  6. #6
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    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.
    Jeremy | jfein.net

  7. #7
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    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'.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  8. #8
    Join Date
    Dec 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Nile View Post
    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

  9. #9
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    jeremyfifty9@gmail.com

    I would've sent a PM but you disabled it.
    Jeremy | jfein.net

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •