Skip to main content
bocdesigninc
Participant
July 23, 2023
Question

How to increase space before registration symbol in every instance

  • July 23, 2023
  • 4 replies
  • 365 views

I have a paragraph style set up with a grep for registration symbols so they automatically are superscripted but sometimes the symbol is too close to the letter before it and manually adjusting the kerning would take too long because of how many there are. Is there another grep to add to increase the space before the symbol automatically.

This topic has been closed for replies.

4 replies

rob day
Community Expert
Community Expert
July 24, 2023

manually adjusting the kerning would take too long because of how many there are

 

Hi @bocdesigninc , If you want to actually kern the insertion point before the registration mark, rather than add a white space before and track, I think you would need a script in order to get all the insertion points. Something like this would find the registration marks and set the kerning of the proceeding insertion point to 50—change 50 in the first line to whatever value you need:

 

 

 

//kerning amount
var k = 50

var res = getTextSearch("®")
for (var i = 0; i < res.length; i++){
    res[i].parentStory.insertionPoints[res[i].index].kerningValue = k;
};   

/**
* Gets results of a text search as an array 
* @ param text to search for 
* @ return result array 
*/
function getTextSearch(fp){
    app.findTextPreferences = app.changeTextPreferences = app.findChangeTextOptions = null;
    app.findChangeTextOptions.properties = {includeHiddenLayers:true, includeLockedLayersForFind:true, includeLockedStoriesForFind:true, includeMasterPages:true} 
    app.findTextPreferences.findWhat = fp;
    return app.activeDocument.findText()
}

 

 

 

 

 

James Gifford—NitroPress
Legend
July 24, 2023

My approach is to use a selected whitespace instead of kerning, not a combination. Both approaches have their merits but combining them is, IMHO, unnecessary churn.

rob day
Community Expert
Community Expert
July 24, 2023

Hi James, the script doesn’t combine tracking and kerning, or add a white space—it uses a find function to get at the index of the insertion point in front of the reg mark—no white space character is being added.

 

I don’t think there is a way to use the Find/Change dialog to search for, or apply a Character Style, to an insertion point. If there is you do not need the script. I was taking @bocdesigninc’s question literally—they want to kern not track.

James Gifford—NitroPress
Legend
July 23, 2023

Find/Change all instances from [reg mark] to [hair space][reg mark]. This remains consistent across font sizes and styles, and easy to modify/undo. Even if you apply a character style for the other method, the spacing can vary with font and size. (If a hair space isn't enough, try a 1/6 space.)

 

This can be used for almost all superscript characters — TM, R, asterisks, footnote numbers, etc.

Peter Spier
Community Expert
Community Expert
July 23, 2023

I like that better than tracking.

Only problem I can see is if the space would interfere with some other operation that requires the mark to be part of the preceding word.

Robert at ID-Tasker
Legend
July 23, 2023

NoBreak option? 

 

Peter Spier
Community Expert
Community Expert
July 23, 2023

One approach would be to find the last character followed by the registration mark (which should be in a positive lookahead) and add a positive tracking value.

Not knowing the symbol, or all the possible preceeding characters I can't say whether you would want to use the dot (.),  \w or [\l\u] as your wildcard.

Robert at ID-Tasker
Legend
July 23, 2023

Instead of using GREP in your ParaStyle definition - which will unnecessarily slow you down - it's simply a one / constant character that doesn't need to by styled dynamically - assign CharStyle globally.