10 Replies Latest reply on Oct 8, 2009 3:00 AM by Jacob Bugge

    combining two shapes

    chubbyp

      hi there.  I'm creating an svg drawing using illustrator cs4.  within my drawing / graphic, i have a rectangle that has a label on it.  my user is requesting that when they click on the rectangle, they would like to see the rectangle grow / zoom so they can read the label clearly.

      i found some sample SVG animations that use the <animate width...> tag which i can use to make the shape "grow".  the only problem is that the text on the rectangle doesn't grow withit.  is there any way to combine the rectangle & text so that it's just one shape instead of two?  (ideally, it'll remain a rectangle).

      I tried grouping them and adding the animation on the group but that didn't work for me.  I also tried adding the animation on both the text and the rectangle but that didn't work either.  i'm just a newbie but my guess is that you can only do this on shapes that natively have a width property.  i guess text doesn't.  Can you tell me if thereis a way to combine these shapes and still be able to treat it as a rectangle?  is this the best approach to use?  the drawing will have a lot of shapes on it and the user wants to be able to either hover over a sape or click it to have it zoom in .

       

      thanks.

        • 1. Re: combining two shapes
          Jacob Bugge MVP & Adobe Community Professional

          chubbyp,

           

          You may try this:

           

          0) If the rectangle has a stroke, copy it to the front (Ctrl/Cmd+C+F), remove the fill from the copy and the stroke from the original;

          1) Copy the rectangle to the back (Ctrl/Cmd+C+B);

          2) Change the colour of the copy to that of the type;

          3) Select the type and the original rectangle and Pathfinder>Minus Front (Subtract from Shape Area in older versions).

           

          This will give you two (or three) rectangular shapes, the one in front being a compound path. If the rectangle has and keeps a stroke, you will regret it when you see 3).

          • 2. Re: combining two shapes
            chubbyp Level 1

            Thank you for your response.  i gave that a try but it doesn't seem to work.  it only works when you're dealing with two rectangles... or circles.  but not with text for some reason.

            is there any other way to "combine" text on a rectangle and end up with one path or one shape?

            • 3. Re: combining two shapes
              Wade_Zimmerman Level 6

              Outline the text. You probably do not need the text live and if you do then make a copy of the text on another layer and make it invisible for future use.

              • 4. Re: combining two shapes
                chubbyp Level 1

                sorry, i'm a newbie at illustrator / graphic design. can you expand on what you mean / how to "outline the text" ?

                thank you!

                • 5. Re: combining two shapes
                  Wade_Zimmerman Level 6

                  Select the text with either the selection tool (black arrow) or the direct select tool (white arrow) and then go to Type>Create Outlines

                   

                  that will turn your text to a path or if you wish a shape.

                  • 6. Re: combining two shapes
                    Jacob Bugge MVP & Adobe Community Professional

                    chubbyp,

                     

                    ... i gave that a try but it doesn't seem to work.  it only works when you're dealing with two rectangles... or circles.  but not with text for some reason.

                     

                    The instructions in the first post should lead to the creation of two/three rectangular shapes, no live type; the outer shape of the live type is what is removed from the rectangle, which is in effect a reversed outlining.

                     

                    What do you end up with instead of two/three rectangular shapes (the thrid one being the stroke if made separately)?

                    • 7. Re: combining two shapes
                      chubbyp Level 1

                      i just tried it again at home (running cs3 here as opposed to cs4 at the

                      office.

                      so i :

                      1.  created a red rectangle

                      2.  added black text to rectangle.

                      (layers shows 2 shapes one path, one text element)

                      3.  i copy the red rectangle, send to back, and change the color to black.

                      4.  i select the red rectangle and the text and i tried PathFinder...

                      Subtract ( i don't have minus front option in cs3).

                      I now have 3 elements in the layers window - 2 rectangles and one element

                      that has the last letter in my text in black.  eg) I used "Test" as my

                      text.  and now, all i have is "t" in black.  The rest of the letters are

                      there but transparent.

                       

                      ? am i missing something?

                      thanks.

                      • 8. Re: combining two shapes
                        Jacob Bugge MVP & Adobe Community Professional

                        chubbyp,

                         

                        i just tried it again at home (running cs3 here as opposed to cs4 at the

                        office.

                        so i :

                        1.  created a red rectangle

                        2.  added black text to rectangle.

                        (layers shows 2 shapes one path, one text element)

                        3.  i copy the red rectangle, send to back, and change the color to black.

                        4.  i select the red rectangle and the text and i tried PathFinder...

                        Subtract ( i don't have minus front option in cs3).

                        I now have 3 elements in the layers window - 2 rectangles and one element

                        that has the last letter in my text in black.  eg) I used "Test" as my

                        text.  and now, all i have is "t" in black.  The rest of the letters are

                        there but transparent.

                         

                        ? am i missing something?

                        thanks.

                         

                        Presuming 2) is (Point) Type (not linked to the rectangle in which case the red should diappear as soon as you click to create Area Type), it should work; it does in 10, whether the Type is live or outlined.

                         

                        You  may try switching 2) and 3), but it should not make any difference.

                         

                        There are some bugs in CS3, some of which have been corrected in CS4. Could you try doing it in CS4 and in an earlier version?

                        • 9. Re: combining two shapes
                          chubbyp Level 1

                          i'm not sure i know what you mean when you say the type is Live or Outlined?

                           

                          sorry, but i'm a newbie.

                          I've selected the "Type Tool, as opposed to the "Area Type Tool". `Does that

                          sound right

                          • 10. Re: combining two shapes
                            Jacob Bugge MVP & Adobe Community Professional

                            chubbyp,

                             

                            i'm not sure i know what you mean when you say the type is Live or Outlined?
                            Live Type is what you create with the Type Tool; it is editable. Type>Create Outlines turns it into paths with the same shape (with a ceratin limitation at a small size), but you cannot edit it: you have to remake for any changes.

                            I've selected the "Type Tool, as opposed to the "Area Type Tool". `Does that

                            sound right

                            It does.