is now part of CreativePro.com!

Making a Custom Shape for Highlighting or Boxing Text

7

T.J. wrote:

Just wondering if it’s possible to get a rounded corner frame behind some text using Paragraph Rules? No, I don’t want to have half circle on both ends, and I don’t want to use paragraph rules from another paragraph above or underneath; nor a one cell table…

T.J. is referring to some solutions I wrote up in this article about Setting Reversed Out Headline Text (White on a Black Bar), and this one one on Putting Headings in Rounded Rectangle Background Frames. The question is how can you put text “inside” some non-rectangular shape, while only using text and text formatting in a story.

Of course, it’s easy to put text in a rounded corner text frame (or a frame of any shape, really), and you can anchor that frame inside another frame:

anchored text frame

But this is technically two frames, and TJ wanted a single text story — something that he could flow more or less automatically and format with just text formatting.

So here’s one solution, which takes a little bit of time to set up, but once it’s done, can be applied very quickly: Use a custom font.

In the old days, making a custom font was a hassle and required specialized font software. But since Jongware and Indiscripts teamed up to create IndyFont, we can do it all in InDesign!

The free version of IndyFont can only make one-character fonts, but I’m using IndyFont Pro, which can create multiple glyphs. I won’t go into all the details about how I did this (Scott Citron has a terrific review of IndyFont coming out in the next issue of InDesign Magazine.) But the quick version is:

I used IndyFont to make a font template for me, then created some various shapes for characters. Here’s what I made for the characters four and five (4 and 5):

indyfont rectangles

A couple things to notice here: First, I set the right side bearing guide to the zero point (that’s the green guide you see). This makes the character zero-width — that is, it prints, but all subsequent characters print on top of it! Second, I made these shapes with InDesign’s Corner Options feature. However, it appears that the current version of IndyFont doesn’t support that feature, so I solved the problem by converting the corners to real bezier path points (you can do that by selecting the object and choosing Object > Paths > Close Paths).

Then I used IndyFont to export the font (I exported it directly into the Fonts folder in the InDesign application folder, so InDesign could use it immediately). And I applied it to some text. For example, here is some text in a text frame:

Boxtext1

I’m going to apply my new font to that little extra “5” before the yellow text, and I get:

Boxtext4

In the above image, you can see the text frame with various type treatments, and the “real” text shown in the Story Editor window. The first line uses a 5, and the next is a 4. The third line is handled differently. In this case, I made new shapes for the 1 and 2 characters of my font:

Boxtext3

Then I typed a 1 at the beginning of the line and a 2 at the end, and gave the paragraph a Rule Above that overlapped the text itself. The Rule Above has sharp corners, of course, but the 1 and the 2 in my font stick out beyond the rule, making it a rounded corner.

As I said, it takes some work to set up the font and so on, but once you have it working you can apply the formatting very quickly with paragraph styles mixed with nested or grep styles.

And the great thing is that you don’t have to use rounded corner rectangles… you can use any shape you want! If you can make a frame in the shape of it in InDesign, you can make it a font, and if you can make it a font, you can apply it like this.

David Blatner is the co-founder of the Creative Publishing Network, InDesign Magazine, CreativePro Magazine, and the author or co-author of 15 books, including Real World InDesign. His InDesign videos at LinkedIn Learning (Lynda.com) are among the most watched InDesign training in the world.
You can find more about David at 63p.com

Follow on LinkedIn here
  • Haeme Ulrich says:

    Great David :))

  • TJ says:

    You are the legend! Thanks heaps, David!

    In order to get the rounded corner effect that I am after, your third example has actually inspired me. I could just put “O” in Impact font before and after the “X for” together with a paragraph rule to achieve that.

    Cheers
    TJ

  • Tigershoot says:

    I got a similar effect of having rounded corners by using underline – with a large weight and negative offset and using Japanese Dots as the line type to get the rounded corners. Then I use a space either side of the words I want to highlight.

  • F van detvGeest says:

    Right, I use underline, Japanrse dots, fill gap color the same color as line, add two fixed spaces before/after. Same effect, simple and can be made as character style…

    • @Tigershoot and @F van detvGeest : Right, I wrote about that in the earlier article (see the first link at the top of this page). However, that gives you half-circles on each side. That is very different than a rounded corner rectangle, which is what TJ was looking for.

      But I was also trying to point out that you can use the font technique for any other shape; for example, maybe you want a “diamond” shape at each end, or a “rough scribble” look. Those would all be possible.

  • hugli says:

    I am predominantly using custom fonts to replace repeating elements in long documents to cut down PDF file size.

    I try to avoid to use them in stories with “meaningful contents” because they semantically don’t belong there. It’s like using spaces for tab & tab stops or newlines for gap after the paragraph.

    The need for hacks like these shows that InDesign paragraph/character/object styles model hit the ceiling with what it can do. Since the days of InDesign 2.0 Adobe is grafting on ad hoc “solutions”, which may work, but have no unifying concept (I quite like GREP styles though).

    I think external CSS like stylesheets would be more flexible.

  • >