Skip to main content
Inspiring
June 13, 2023
Answered

InDesign Grep Style for Composite Fonts

  • June 13, 2023
  • 1 reply
  • 5248 views

Hi,
Is it possible to use Grep Style to do composite fonts, the base is Chinese or Japanese and Latin and Number is DinPro? or

How to set a Grep Style if I type in latin letters A-Z or 1-10 and it automatic switch to DinPro font?

 

Thanks

This topic has been closed for replies.
Correct answer m1b

Mark has pretty much nailed this already, but i will point out that i usually achieve the same effects by using regular expressions syntax to specify Unicode ranges. For example, "every glyph past basic ASCII" would be

 

[/x{0100}-/x{FFFF}]+

You can make a GREP style that applies to e.g. only Thai Unicode ranges. It can get complicated, as in the case of parentheses in CJK text that are not fullwidth, but it works quite well to capture All the Glyphs in a given writing system. 


That's the sort of thing I was looking for Joel! Thanks. Also, I notice that Indesign grep can understand \p{Punctuation} which is great, but not other unicode blocks, eg.  \p{Han}.

 

@iampurple you can implement the grep with Joel's method by changing the grep to something like:

([\x{0020}-\x{024F}]+\s?)+

(By the way, see unicode blocks here.)

 

You may still have to go more sophisticated with the grep though, if you don't want to match some things, for example Korean seems to use some latin punctuation characters:

 

1 reply

m1b
Community Expert
June 13, 2023

Hi @iampurple, I don't have any experience with what you are asking, but in case it helps, here is a little test I just did, that might be worth playing with. I set up a paragraph of chinese text with a grep style that targets specific latin characters and draws them in DIN cyan color.

 

The grep I used is this:

 

([A-Za-z0-9,;\.\?\!]+\s?)+

 

which isn't great, because it only targets the explicitly included characters, so you will have to add any other characters you want to target, such as hyphen, dollarsign, em-dash, accented characters, eg. öà. (I tried targeting a unicode code block eg \p{Han} but couldn't get it working—maybe a grep expert will chime in on that.)

See attached demo document.

- Mark

 

Edit 2023-06-14: added Japanese and Korean examples to demo.indd.

Edit 2023-06-14: added a couple of extra unicode blocks to demo.indds. Thanks to @Joel Cherney for the idea.

Edit 2023-06-15: now I'm using this grep in my demo.indd:

[\x{0020}-\x{024F}\x{1E00}-\x{1EFF}\x{2100}-\x{214F}\x{0A}\x{2000}-\x{206F}]+

 

iampurpleAuthor
Inspiring
June 13, 2023

Thanks a lot Mark!! Yes, this is, but what if the document has multiple languages, Japanese, Korean, Thai...etc? 5 pages are Chinese, another 5 pages are Japanese? 

Do we set a paragraph style per languages that include the grep style? or we can do script? or?

 

Many thanks 

Aratype
Known Participant
December 22, 2023

Thanks a lot @m1b and @Joel Cherney!!! Very appreciated.

I'll test it out.


Dear all,

I am a novice in the GREP but I had the same idea as you!

I want to create "one" Paragraph Style that manage Arabic script and Latin script (English) in the same time.

All Arabic text should use a font (Adobe Nask Regular), I did a Character style for Arabic.

All Latin text should use another font (STIX Two Regular), I did a another Character style for Latin (English).

Numbers: (STIX Two Regular)

Special Characters: (STIX Two Regular)

I put the expression for Arabic script:

[\x{0600}-\x{06FF}\x{FB50}-\x{FDFF}\x{FE70}-\x{FEFF}\x{0750}-\x{077F}\x{08A0}-\x{08FF}\x{FB50}-\x{FDFF}\x{FE70}-\x{FEFF}]+

I put the expression for Latin script:

([\x{0020}-\x{024F}\x{1E00}-\x{1EFF}\x{2100}-\x{214F}]+\s?)+

 

But the Paragraph Style does not work. Do you have an idea please?

 

TIA