Take the 2-minute tour ×
Graphic Design Stack Exchange is a question and answer site for Graphic Design professionals, students, and enthusiasts. It's 100% free, no registration required.

I'm going to be making images that include hundreds of lines of text of varying lengths, each of which will have the same "background", with the exception of the length of the background, which will need to be relative to the length of the text. I want to not have to manually fit text to a box each time.

The second twist is that I want the background to be reduced opacity, but I want the text to be 100% opacity.

So the text will always be the same size and solid white, over a (say) 80% opacity orange background. The "padding" (inset?) on all four sides of the text the text will be constant relative to the text. All that will change is the overall width of the text string, consistent with the overall width of the "box".

I have reviewed these two answers

How to fit text box size to text?

and

Change Background Color of Text Box in Illustrator CS5

which would seem to address this but don't quite. I am using Illustrator CS6.

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

As for fitting text boxes to text.. see the script in your first question link. That's the only method I'm aware of.

The fill issue is MUCH easier to solve.

  • select the area text with the Selection Tool (black arrow)
  • Add a new fill via the Appearance Panel
  • set fill color and drag the fill below the Characters item in the Appearance Panel
  • With the fill highlighted in the Appearance Panel, choose Effect > Convert to Shape > Rectangle and enter values you want. Then click OK
  • Click the Opacity indicator under the fill in the Appearance Panel and enter the Opacity you wish the fill to have. This will not alter the text.

fill

Set this up once, then drag the whole thing to the Graphic Styles Panel. When you need to apply this same appearance, simply select the Area Text box and then click the style in the Graphic Style Panel.

Note, the background is relative to the Area Text box... if the box changes size, the background will as well.

Added after seeing what the script does to the appearance.

The script does kill the appearance. So here's what I would do...

Set up the Graphic Style and save it.
Have an Area text box set up and ready for the script.

Now create a new Action and start recording...
- Run the script
- click the Graphic Style
Stop recording.
Assign an F key to the action.

Now all you need do is select an Area Text Box and hit the assigned F key. If the text box needs resizing while working, just tap the F key.

Caveat....

Illustrator has, and has had, a bug where scripts in actions are concerned. The action will not retain the script step if you quit Illustrator. So each time you launch Illustrator you would need to set up the action again. It's annoying, time consuming and a pain. However, recreating the action each time it's needed may be much faster than manually manipulating text boxes and appearances.

share|improve this answer
    
This is very helpful! The script and this Appearance/style method don't play nice together, but it gives me a lot to work with. The script has to be reapplied each time I want to resize the box to the text. That would be tolerable, but it also molests the appearance set by your recommended method. –  Brian D Jan 29 '13 at 1:50
    
@BrianD ahh, I see it does. I've updated my answer above. –  Scott Jan 29 '13 at 2:05
    
Scott, this is really helpful. I've been playing with my graphics just using your Style approach -- even with having to resize the text box for each line, the Style is so helpful. Might not be much harder than reapplying every time an ai file gets reopened for use. I'll try both ways and see which is less of a headache. Thanks! –  Brian D Jan 29 '13 at 2:15
    
Glad I could help :) –  Scott Jan 29 '13 at 2:17
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.