• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to draw a box around characters

Community Beginner ,
Apr 15, 2019 Apr 15, 2019

Copy link to clipboard

Copied

Hello,

I'm trying to figure out a way to draw a box around characters to indicate certain keyboard actions. For example, I'd like to draw a box around CR to indicate Carriage return and LF for line feed. I need to include these this kind of thing a number of times throughout the document. I was trying to use a table (which might work) or text frame but thus far, I couldn't get it the way I wanted. Plus, I was hoping that there might be an easier way to do it.

Here is an example of what I am trying to do. Any help is greatly appreciated.

Views

1.7K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Apr 16, 2019 Apr 16, 2019

*I noticed my first screen capture didn't show the character designer settings. I've updated to include the settings I used in the example.

Here's an example, using Winfried Reng​'s suggestion of using a character tag to control the "box" and the color of the text. Note that because LF has both a leading and trailing space, Smart Spaces needs to be turned off in Format > Document > Text Options, or you need to place the LF and character tag in a variable.

While this doesn't have a box around the c

...

Votes

Translate

Translate
Community Expert ,
Apr 15, 2019 Apr 15, 2019

Copy link to clipboard

Copied

There are two options.

  1. Create individual graphics and insert them inline using the File > Import > Image function. You can probably find free graphics images of the different keyboard keycaps.
  2. Find a keycap font and use a character tag to alter regular letters to a keycap image. There's one at the ShareFonts site. I've never used the site or the font, though, so I can't really comment on how well either would suit your needs.

Both of these will probably require some fiddling with the spacing between lines to prevent overlap, but Frame does a fair job of handling that if you make sure that the paragraph tag does NOT have Fixed line spacing selected.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 15, 2019 Apr 15, 2019

Copy link to clipboard

Copied

Thank you for the help. I'm going to try your first suggestion and see how works.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 15, 2019 Apr 15, 2019

Copy link to clipboard

Copied

Hmmm. Looking at the preview for keycaps, it doesn't appear to have anything like CR or LF as a character. So it looks as if your option is to create a graphic that can be inserted using the image insert. Sorry about that.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 15, 2019 Apr 15, 2019

Copy link to clipboard

Copied

What's the semantic context here?

I haven't seen a keyboard with a LineFeed cap since the ASR 33 teletype, and don't ever recall seeing one that had a Return/Enter key actually labeled "CR" or "CarriageReturn". The only key usually seen nowadays is "Enter↵" (and even that will vary by localization).

When I've had this requirement, I usually rely on a keycap-style font, or use a custom embedded vector graphic enclosing actual text (Frame graphics or SVG).

In a Unicode future that may not be near us, and a suitably populated font, the literal enclosed CR and LFs might be implemented with:
U+240D SYMBOL FOR CARRIAGE RETURN
U+240A SYMBOL FOR LINE FEED
U+20E3 COMBINING ENCLOSING KEYCAP

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 16, 2019 Apr 16, 2019

Copy link to clipboard

Copied

Hi,

You might also create a character style and set a background.

This would also highlight your characters.

Best regards

Winfried

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 16, 2019 Apr 16, 2019

Copy link to clipboard

Copied

Thanks Winfried.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 16, 2019 Apr 16, 2019

Copy link to clipboard

Copied

Thanks for the reply Bob. I will have to take a look and see the reasons for requiring carriage return etc. I'd rather use something a bit more up to date if I can.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 16, 2019 Apr 16, 2019

Copy link to clipboard

Copied

*I noticed my first screen capture didn't show the character designer settings. I've updated to include the settings I used in the example.

Here's an example, using Winfried Reng​'s suggestion of using a character tag to control the "box" and the color of the text. Note that because LF has both a leading and trailing space, Smart Spaces needs to be turned off in Format > Document > Text Options, or you need to place the LF and character tag in a variable.

While this doesn't have a box around the characters like your example, the text and background color can be whatever you want.

Placing the text and character tag in a variable would also give you an easy way to quickly and consistently insert the codes you need.

Capture3.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 16, 2019 Apr 16, 2019

Copy link to clipboard

Copied

Thank you Matt. I've never used this feature before. I'll give it a try.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 17, 2019 Apr 17, 2019

Copy link to clipboard

Copied

did you get something usable?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 17, 2019 Apr 17, 2019

Copy link to clipboard

Copied

LATEST

Yes. I ended up going with a dark colored background and white text and it seems to serve the purpose. My LF box did not have spaces before and after the letters so I did not need to turn off Smart Spaces. The only small issue with this method is that when the boxes were side by side, I had to leave space between them so that it looks like they are separate.

That being said, it certainly does the trick for my purposes.

Thanks for checking up.

Bob

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines