font script.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • sarah

    font script.

    hi all.

    first time poster so please forgive and maybe direct me to correct
    group if this is wrong place. tia.

    i'm after constructing a PHP script to fit within my nuke modules to
    do this..

    I would like users to enter my cross stitch site and be able to type
    in text and have it formatted into a cross stitch font.

    I know from other sites that it can be achieved using a perl script
    but not sure how it's done as i have no perl knowledge whatsoever.

    here is an example from a fellow cross stitch site..


    any ideas where i should start?

    thanx for any help.

    Sarah.
  • Chung Leong

    #2
    Re: font script.

    Uzytkownik "sarah" <owner@brontela nd.com> napisal w wiadomosci
    news:a3d350b.04 03231425.5e53e0 9c@posting.goog le.com...[color=blue]
    > hi all.
    >
    > first time poster so please forgive and maybe direct me to correct
    > group if this is wrong place. tia.[/color]

    You're at the right place :)
    [color=blue]
    > i'm after constructing a PHP script to fit within my nuke modules to
    > do this..
    >
    > I would like users to enter my cross stitch site and be able to type
    > in text and have it formatted into a cross stitch font.
    >
    > I know from other sites that it can be achieved using a perl script
    > but not sure how it's done as i have no perl knowledge whatsoever.[/color]

    Looks like it's a matter of stitching a few images together. The easiest way
    is to keep each letter of the alphabet in a separate image, then generate
    img tags base on what the user type in:

    $letters = preg_split('//', $input, -1, PREG_SPLIT_NO_E MPTY);
    echo "<nobr>";
    foreach($letter s as $letter) {
    echo "<img src=\"img/letters/$letter.gif\">" ;
    }
    echo "</nobr>";

    If you want a single image, you can use the GD function to joint the images
    together.


    Comment

    • sarah

      #3
      Re: font script.

      thankyou Chung for your help, but i have to say that this looks a
      little too advanced for my skills at the present time :(

      I understand from this that i will need to create a simple form, and
      have images in the specified folder that i have made, but apart from
      the "echo" command i don't really understand much more of your code.

      It probably looks easy to some of you but i haven't acquired enough
      skills yet to implement this.

      I shall continue to "hang around " in this group and go back to the
      PHP manual and learn. :)

      thanx again.. Sarah.
      [color=blue]
      >
      > Looks like it's a matter of stitching a few images together. The easiest way
      > is to keep each letter of the alphabet in a separate image, then generate
      > img tags base on what the user type in:
      >
      > $letters = preg_split('//', $input, -1, PREG_SPLIT_NO_E MPTY);
      > echo "<nobr>";
      > foreach($letter s as $letter) {
      > echo "<img src=\"img/letters/$letter.gif\">" ;
      > }
      > echo "</nobr>";
      >
      > If you want a single image, you can use the GD function to joint the images
      > together.[/color]

      Comment

      • Geoff Berrow

        #4
        Re: font script.

        I noticed that Message-ID:
        <a3d350b.040328 0854.435a954a@p osting.google.c om> from sarah contained
        the following:
        [color=blue]
        >I understand from this that i will need to create a simple form, and
        >have images in the specified folder that i have made, but apart from
        >the "echo" command i don't really understand much more of your code.
        >
        >It probably looks easy to some of you but i haven't acquired enough
        >skills yet to implement this.[/color]

        The script pretty much works as is.

        I have six images of the numbers 1 to 6 named 1.jpg, 2.jpg and so on
        Obviously for an alphabet you need many more.



        Here is the code.

        <HTML>
        <HEAD>
        <TITLE>number images</TITLE> <META HTTP-EQUIV="Content-Type"
        CONTENT="text/html; charset=iso-8859-1">
        </HEAD>

        <BODY BGCOLOR="#FFFFF F" TEXT="#000000">
        <FORM NAME="form1" METHOD="post" ACTION="">enter numbers between 1 and 6
        <BR>e.g
        123432<BR> <INPUT TYPE="text" NAME="inputbox" ><INPUT TYPE="submit"
        NAME="Submit" VALUE="Submit"> </FORM>
        <?php
        $input=$_POST["inputbox"];
        $letters = preg_split('//', $input, -1, PREG_SPLIT_NO_E MPTY);
        echo "<nobr>";
        foreach($letter s as $letter) {
        echo "<img src=\"$letter.j pg\">";
        }
        echo "</nobr>";
        ?>
        </BODY>
        </HTML>
        --
        Geoff Berrow (put thecat out to email)
        It's only Usenet, no one dies.
        My opinions, not the committee's, mine.
        Simple RFDs http://www.ckdog.co.uk/rfdmaker/

        Comment

        Working...