h1

Word: Add padding to a character style

May 29, 2017

My client wanted the button text in the user manual I was writing to look similar to the buttons in the app. For this app, blue, green, and orange background colours were used for the buttons, with white text.

Easy enough to do — just set up three Word character styles, one for each colour, have different coloured shading for each, and bold white text for the font. Make it simple for both writing and future updating by assigning keyboard shortcuts for each style. Done.

But, while my client liked what I’d done, he was concerned that the first and last letter of the button text butted up against the edge of the coloured shading (see image below), and wanted to know if we could add some padding.

I was pretty sure I could do that to a character style using borders the same colour, but then I ran into an issue I’d never seen before. When I applied a border of any weight or colour, I lost the background shading for the text. In the example below, you can see that the area inside the blue border has white space inside it, not blue shading with white text as I expected.

No matter what I did, I couldn’t get it to work. I explained the situation to my client. Fortunately, he’s a programmer and knows a bug when he sees one :-) He did a little bit of experimenting and came up with the solution, which was to reapply the background shading to the character style AFTER adding the border.

It worked, and here’s the end result (it has a 1.5 pt border, just enough to add a bit of padding to both ends of the text, but not too much that the top and bottom padding adds too much gap between lines in a paragraph):

3 comments

  1. Rhonda, try putting a no-break space at each end of the word. That should fix the extra padding. Worked for me with just a border in my work.


  2. That would work for a couple, John, but this software manual has hundreds. As far as I know, you can’t add a non-breaking space to a style, whether paragraph or character. Anyhow, we’ve solved it to the client’s satisfaction, and I learned something, which is why I wrote the blog post.

    Thanks for the suggestion.
    –Rhonda


  3. Interesting that the sequence in which the style’s properties were added to the style’s definition made a difference. I’ll have remember that when dealing with my own style bugs.



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: