Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

GREP to change all digits to another font

Tagged: 

Return to Member Forum

  • Author
    Posts
    • #92553
      Tommy Larsen
      Member

      Hi all!

      I have a little issue, we have a system running, where a user can type in their own text like this

      Text 1 | Text 2

      where the font for Text 1 is ie. Adobe Garamond, and Text 2 is a Japanese font. We tag the documents and use InDesign Server, so basically it is “just” copy paste, and of course the pasted text will get the same font and all other attributes as Text 1 and Text 2.

      The problem here is that all numbers in the Japanese text should be in Adobe Garamond, and not the ones from the Japanese font. I tried using my normal approach with a GREP style, but since I can’t apply a paragraph style to the line or paragraph, due to the usage of more than one font, that does not work. So, does anyone out there have any ideas? I’m not particularly interested in scripts, since that would not fit into our automation with the InDesign Server ;)

      A document for testing can be found here, at least for the next 7 days!
      https://we.tl/f0FHyudjqs

      Kind regards,
      Tommy

    • #92555
      John Kelsall
      Member

      Can you not make a character style that uses the Adobe Garamond font.

      Then do this search and replace in GREP in InDesign:

      FIND
      (\d+)

      CHANGE TO
      The Adobe Garamond character style

    • #92556

      Hi Tommy,

      perfect post: Friendly hello and a example. Well done!

      Since your parts are tagged: Why not apply a paragraph style with Garamond to the whole paragraph and a character style for the Japanese font? The character style could then applied to the tag with the mapping feature and a grep-style like \D >> everything except digits.

      Kai

    • #92563
      Tommy Larsen
      Member

      Thank you both for suggestions!

      Kai, your suggestion works like a charm, didn’t know that I could apply styles to specific tags, I am more than happy right now :)

      Kind regards,
      Tommy

Viewing 3 reply threads
  • The forum ‘General InDesign Topics (CLOSED)’ is closed to new topics and replies.
Forum Ads