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

Grep expression to change font of Hebrew characters only

Engaged ,
Feb 19, 2019 Feb 19, 2019

Copy link to clipboard

Copied

Due to the discussion in the thread here: https://forums.adobe.com/thread/2596476

I was wondering if there is a Grep expression that could be used to apply a character style to Hebrew characters only (based on their position in the font map) to allow changing of the font of just those characters? I'm pretty good at find/replace but really don't know anything about using Grep. If Grep could do something like this it would save me a tremendous amount of time as I normally use English fonts that do not contain a Hebrew character set and need to apply a character style to each bit of Hebrew (which is interspersed within the English) to change it to a font with Hebrew characters.

I would think this might be possible with Grep. If anyone knows how, please let us know.

Views

3.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

Mentor , Feb 19, 2019 Feb 19, 2019

Like Chad, I don't know a single word (or even letter, for that matter) in Hebrew, but here's my exercise, just for fun. I went from the opposite: find all non-Latin text and punctuation/spaces after it. 3 regexes to include in para style:

[^A-Za-z\h[:punct:]]+

[^A-Za-z[:punct:]]\K\h

[^A-Za-z]\K[[:punct:]]\h

​Hebrew.gif

Votes

Translate

Translate
Engaged ,
Feb 20, 2019 Feb 20, 2019

Copy link to clipboard

Copied

Tá´€W  wrote

I haven't read the entire thread, but from my extensive experience typesetting predominantly English books with interspersed Hebrew, the best way to apply a character style to the Hebrew is to search for all text that has its language set to Hebrew!

...

Note, though, that for this to work you must first save an docx documents as the older .doc format in Word. The import filter in InDesign for .docx documents isn't as robust as the earlier .doc import filter, and only the older one imports language markings properly.

I just tested this and you are correct, with one additional point. Even a .docx file retains the Hebrew style, IF you place the document with the "remove styles and formatting" option (which is my preference for the files I get for these jobs). If you place a .docx file and preserve or map styles, then the Hebrew style is not retained.

This may be helpful in some situations, but when I have a .docx file and want to preserve or map styles, then winterm's method may be simpler as I don't need to go through the extra step of opening and resaving the Word file.

I am sure that there will be some times though that I will prefer to use your method.

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
People's Champ ,
Feb 20, 2019 Feb 20, 2019

Copy link to clipboard

Copied

I always import with styles and formatting, and strip everything out afterwards in InDesign (after freezing any wanted formatting with character styles).

The problem with a GREP search to find Hebrew strings is that it's impossible to sort out the issue of opening and closing punctuation, because only a human can know whether the opening or closing punctuation is meant to be Hebrew or not. So what happens in practice is that you have to go through each Hebrew phrase and check (or compare to original) which is a pain.

But if you rely on the language setting, most times (if the author was half competent at inputting the original text) the issue of punctuation etc. will be mostly okay...

In any case, I've never found a GREP expression that really worked for me.

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
Engaged ,
Feb 20, 2019 Feb 20, 2019

Copy link to clipboard

Copied

Tá´€W  wrote

I always import with styles and formatting, and strip everything out afterwards in InDesign (after freezing any wanted formatting with character styles).

The problem with a GREP search to find Hebrew strings is that it's impossible to sort out the issue of opening and closing punctuation, because only a human can know whether the opening or closing punctuation is meant to be Hebrew or not. So what happens in practice is that you have to go through each Hebrew phrase and check (or compare to original) which is a pain.

But if you rely on the language setting, most times (if the author was half competent at inputting the original text) the issue of punctuation etc. will be mostly okay...

In any case, I've never found a GREP expression that really worked for me.

Thanks for pointing that out. I will have to try it both ways and see what works. For a large block of Hebrew, your method is probably better for the reasons you've explained. However, much of what I get is just scattered Hebrew words within primarily English text, and for that the GREP formatting may be the fastest solution.

I appreciate your pointing that out.

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
Explorer ,
Feb 21, 2019 Feb 21, 2019

Copy link to clipboard

Copied

I use

‭[‬\x{05D0‭}-‬\x{05EA‭}‬\x{0591‭}-‬\x{05C4‭}‬\x{05A2‭}-‬\x{05C7‭}]+‬

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