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

How to shade characters but not spaces

Community Expert ,
Dec 13, 2021 Dec 13, 2021

I'd like to create a paragraph style or even character style, if appropriate, where the text characters have a background color, but the spaces are unformatted space. Something like this effect:

 

2021-12-13_17-50-02.pngexpand image

 

I can't figure out how to shade only the non-space characters. I have a GREP style in play that can detect and modify the character style, but I can't figure out how to shade only the non white spaces.

 

Any help is appreciated!

 

TOPICS
How to , Type
991
Translate
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 , Dec 13, 2021 Dec 13, 2021

For example

\S+

character style underlined, thickness > font height with a negative offset

Translate
Community Expert ,
Dec 13, 2021 Dec 13, 2021

For example

\S+

character style underlined, thickness > font height with a negative offset

Translate
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 ,
Dec 13, 2021 Dec 13, 2021
quote

For example

\S+

character style underlined, thickness > font height with a negative offset


By pixxxelschubser

 

OK, with this, I think I'm on the right track! I knew there had to be a trick to the shading, I didn't think of ultra thick underlines! and with a little extra GREP tweaking, I can pick up a single space before and after the characters so there's a bit of a border.

 

Thanks!

Translate
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 ,
Dec 13, 2021 Dec 13, 2021

I think the GREP style is your only option. I don't think ID has any option to exclude style from whitespace. Interesting notion for an option but I think the need is so slight (except for certain types of art/display type) it's not likely to happen.

Translate
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
Engaged ,
Dec 13, 2021 Dec 13, 2021

Create a character style with a custom underline. Apply that character style to any letter in the paragraph style.

Translate
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 ,
Dec 13, 2021 Dec 13, 2021

Hi @davecourtemanche 

a good start. But for any grep style, it's useful to test it with a few examples. Try your own grep on a simple sample text like "my first $100,000.00".

 

What happens?

And what with \S+

Translate
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
Engaged ,
Dec 13, 2021 Dec 13, 2021

But he's doing chord charts. I mean, even jazz doesn't have any million dollar chords. 😄

Translate
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 ,
Dec 13, 2021 Dec 13, 2021

@davecourtemanche 

Too bad. I'm afraid I don't get the joke. English is not my native language. And even worse, my English is not the best.

Translate
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 ,
Dec 13, 2021 Dec 13, 2021

I've got it sorted, thanks to @pixxxelschubser 's suggestion. My regular expression is working just fine, the trick for me was to use the underline as the background. Thanks everyone for your help!!

!

Translate
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 ,
Dec 13, 2021 Dec 13, 2021

Glad to hear that.

Just out of curiosity - what's your grep?

In my opinion, there are only two efficient notations for your requirements:

\S+

or

[^\s]+

Both Grep means the same.

Translate
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 ,
Dec 14, 2021 Dec 14, 2021

Right now I'm using simply \w which matches all the "word characters" (letters, digits and underscore, but omits punctuation). This is working well. 

I considered \s\w+\s to pick up the spaces surrounding the word characters, but I think that underlining a white space doesn't create a visible underline (have to try that but I believe it will not highlight the white space). 

Translate
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
New Here ,
Mar 22, 2022 Mar 22, 2022

spaces between sentences
Like

 

Translate
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 ,
Mar 22, 2022 Mar 22, 2022
LATEST
quote

spaces between sentences
Like

 


By janö58856049

 

???

Translate
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