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

Create paragraph tag with coloured background

Community Expert ,
Oct 30, 2019 Oct 30, 2019

Copy link to clipboard

Copied

I want to create a paragraph tag with a colored background. Black background  - white text.

There is a font option allowing me to set a colored  background, and I can set a stroke above and below the text. But it seems I cannot totally avoid having a single, thin white line below the text.

Working in FM 2019. Is it really not possible to have colored background and extend the background color above and below the text?

 

TOPICS
Formatting and numbering

Views

362

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 ,
Oct 30, 2019 Oct 30, 2019

Copy link to clipboard

Copied

Frame doesn't have the ability to put background shading on a paragraph.

 

The usual workaround is to put the paragraph into a single-cell table with no borders and set the fill.

 

If you put your anchor into its own paragraph, define the paragraph tag with Space Below equal to the -font size (for example, -12pt), and define Space Above for the Table the same way (-12pt).

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 ,
Oct 30, 2019 Oct 30, 2019

Copy link to clipboard

Copied

Is the thin white line coming from the frame containing the line on the reference page? Can you post a screenshot of what the paragraph looks like?

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 ,
Oct 30, 2019 Oct 30, 2019

Copy link to clipboard

Copied

Yes, you can put a background color for the font, but that is limited to the characters. It's not really a background for the entire paragraph. It won't look like a box, in other words, it'll look like this at 100% zoom [which makes those white lines between each line of text disappear (and holy cow, what happened to the resolution?)]:

background font shading.png

If that's what you want, then try setting the line spacing to just a bit less than your font size. My font was set to 14 for the example; when I made the Line Spacing 12 pt, the gap between lines disappeared no matter what the zoom. It makes the text tight, though.

 

ETA: This is an example of a single-cell table formatted as I suggested above:

paragraph in table with shading.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 Expert ,
Oct 30, 2019 Oct 30, 2019

Copy link to clipboard

Copied

Ikke-navngivet-1.png

We can add a background colour to the paragraph, like the blue colour which is chosen here. It seems that the background colour is tied to the line height of the font in use. Ideally I would like to be able to stretch the background colour up and down.

I just wish it would be possible to have the Line above/Line below go all the way up to the fonts baseline, but I cannot make that work without leaving a thin  blank line.

 

The workaround with the table cell is ingenous though!

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 ,
Oct 30, 2019 Oct 30, 2019

Copy link to clipboard

Copied

Is anyone on the Adobe team monitoring this forum? You should look at how InDesign handles paragraph ruling and shading. It is really quite elegant and it would be great if FrameMaker could handle it the same way. The current features are quite primitive and could use improvement.

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 ,
Oct 30, 2019 Oct 30, 2019

Copy link to clipboard

Copied

If you want a demonstration, I will be glad to show you via a web meeting.

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 ,
Oct 30, 2019 Oct 30, 2019

Copy link to clipboard

Copied

Rick, I'm not positive but I believe this has been an "ask" for Frame for a lot of years. I think the problem is that Frame doesn't handle paragraphs as a unit. Instead, it handles each line in the paragraph as a separate unit, and the ParaLine can change depending on changes to formatting or content. I'm not a programmer, but I expect it would require a major restructuring to Frame to change 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 ,
Oct 30, 2019 Oct 30, 2019

Copy link to clipboard

Copied

Hi StudioSm: That is truly odd, and something I haven't run into before. I tried multiple combinations of spacing values but could not remove the white line. I do recommend report this is a bug or feature request—I'm not sure how to classify it—here: https://tracker.adobe.com/#/home. Let us know when you do, I'll be happy to vote for it. You can reference this thread.

 

Top: frame above and below; Bottom: frame above and a line break

Top: frame above and below; Bottom: frame above and a line breakTop: frame above and below; Bottom: frame above and a line break

For now, other than the single-cell table idea that was already offered, the only other idea I had is to remove the frame below pgf and add a line-break at the end of the paragraph. Far from ideal, but might work for now.

 

~Barb

 

 

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
Adobe Employee ,
Oct 31, 2019 Oct 31, 2019

Copy link to clipboard

Copied

Requesting you to log a bug with all the details so we can start looking into it.

 

Thanks

Amitoj Singh

 

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 ,
Oct 31, 2019 Oct 31, 2019

Copy link to clipboard

Copied

Hi Amitoj

Thx -  I have created a bug report.

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 ,
Oct 31, 2019 Oct 31, 2019

Copy link to clipboard

Copied

Hi Barb

Thx -  I have created a bug report.

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 ,
Oct 31, 2019 Oct 31, 2019

Copy link to clipboard

Copied

Hmmm. Somehow I missed the bit about the "stroke above and below". Are you saying that you are using a frame above and below the paragraph and that the white space you want to eliminate is between the line contained in that frame and the paragraph?

 

Going back to my suggestion of using the table cell, you can add a top and bottom border and adjust the cell padding until it's where you want it.

 

table with upper lower border shading some padding.png

 

If you're set on using the frame above and below, I'm not sure what to suggest. You would definitely need to have the frame containing it on the reference page as tight to the line as you can get it because Frame uses the entire frame; it's not just the line, it's the space above, below, and to either side that appears in the Body. 

 

With some experimenting, I've managed to tighten things up so that there's no gap when used in Frame Above, but there's still a very small bit of a space between the text and Frame Below that I can't eliminate, even when I set the Runaround properties to Don't and the Gap to 0.

 

shaded paragraph with line in frame above and below.png

Personally, I don't like the above look because the right margin is going to be ragged unless you set the Alignment to Justified, and even that isn't foolproof because once you hit return, that's where the shading ends.

shaded justified paragraph with line in frame above and below.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 Expert ,
Oct 31, 2019 Oct 31, 2019

Copy link to clipboard

Copied

Lin:

 

Personally, I don't like the above look because the right margin is going to be ragged unless you set the Alignment to Justified, and even that isn't foolproof because once you hit return, that's where the shading ends.

I think you are using Paragrah Designer > Font > Background. StudioSM and I are using Advanced > Pgf Box, which doesn't care about the alignment. I think StudioSM's idea to use Frame Above Pgf and Below Pgf to pad the box is very clever—I just wish it worked as well below as it does above. 

 

Here is the link to StudioSM's bug report, if you want to vote it up: https://tracker.adobe.com/#/view/FRMAKER-7420.

 

~Barb

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 ,
Oct 31, 2019 Oct 31, 2019

Copy link to clipboard

Copied

--QUOTE by BarbBinder----------------------------------------------------------------------------------------------------------
I think you are using Paragrah Designer > Font > Background. StudioSM and I are using Advanced > Pgf Box, which doesn't care about the alignment.
--ENDQUOTE by BarbBinder----------------------------------------------------------------------------------------------------

 

No, he specifically said that he was using the Font Background color, so that's what I used. I'd actually forgotten about the Paragraph Box option, mostly because I've never worked anyplace that used colored backgrounds.  That's a pretty recent feature, isn't it? Gets around that ragged right edge quite neatly. I hope I remember it's there if I ever have to add a colored background.

 

ETA: Holy moly, the Pgf Box has been a feature since FM12! I should have noticed that before now, and thank you, Barb, for pointing it out to me. Sometimes I need a clue-by-four over the top of the head.

 

Well, that would certainly solve StudioSM's background color issue. Now all we have to do is figure out how to get that line to snug up. I fiddle with the graphics frame on the Reference page from time to time, but there's still a bit of a gap when it's used as Frame Below and I can't figure out why. If the frame is really short, it seems to work for Frame Above.

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 ,
Oct 31, 2019 Oct 31, 2019

Copy link to clipboard

Copied

Hi Lin. You are absolutely correct about StudioSM using Font > Background and not Advanced > Pfg Box. I was coming back from the bug report where I saw "set Advanced" and evidently skimmed the rest of that paragraph and drew my own erroneous conclusion.

 

I've been poking around and see that Arnis reported this as a bug in 2017. Votes help bring Adobe's attention to these issues, if you have an opportunity, please vote here: https://tracker.adobe.com/#/view/FRMAKER-7420. Votes are our best chance of getting this fixed. While I don't hold out high hopes for padding controls getting added anytime soon, surely removing the hairline space can't be that difficult.

 

~Barb

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 ,
Oct 31, 2019 Oct 31, 2019

Copy link to clipboard

Copied

LATEST

I voted for both!

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