Skip to main content
Participating Frequently
March 1, 2023
Answered

Trying to alter font on entries within data merge

  • March 1, 2023
  • 1 reply
  • 851 views

So not sure if this is even a thing

 

Data merging a bunch of prices into printable ticket form.

However the output has to be formatted in a certain way.

 

I.e the first letter has to be a larger font with a -tve height to offset it 

While I have an off item font copy to eyedropper and manually correct each ticket

I'm wondering if there's a way of presetting rules so that the data merge can automatically be formatted in ways I want?

 

If I'm making no sense, sorry about that. 

This topic has been closed for replies.
Correct answer Peter Spier

I think this can be done with nested GREP styles in the paragraph style.

Define a character style with your increased size and appropriate baseline shift, then apply it using the following two GREP expressions as GREP styles in your paragraph style:

(?<=£)\d+     to mark the first case for pounds

\d+(?=p)       to mark pence only

1 reply

Peter Spier
Community Expert
Community Expert
March 1, 2023

You should be using a defined paragraph style to format the price entry. That style can include a nested, or several nested, character style(s) to doemat the numbers.

If you provide a screen shot of how you want the finished piece to look we can provide more information.

PlebiciteAuthor
Participating Frequently
March 1, 2023

 So the one on the left is how it imports from data merge, the right is the style it needs to have (larger font with a baseline shift. But only on numbers before the decimal. Or before the p in the case of entries with less than £1 value)

 

Though I'm assuming for it to know which letters in a random assortment of prices to adjust will require scripting

Peter Spier
Community Expert
Peter SpierCommunity ExpertCorrect answer
Community Expert
March 1, 2023

I think this can be done with nested GREP styles in the paragraph style.

Define a character style with your increased size and appropriate baseline shift, then apply it using the following two GREP expressions as GREP styles in your paragraph style:

(?<=£)\d+     to mark the first case for pounds

\d+(?=p)       to mark pence only