tbender Posted July 21, 2015 Share Posted July 21, 2015 I am having an issue with one of my fonts. The spacing between characters is to tight with certain combos, specifically, "L." The period almost merges into the L. First I spaced out the font but that looked bad. I was able to use the ReplaceSubstring command to replace with "L space ." This is to much space. What I would like to figure out is if I am using say a 8 point font to add a narrow space such as a 2pt space. Is there any way I can specify the amount of space on this? Let me know if this is not clear, I am pretty new at using advanced rules. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted July 21, 2015 Share Posted July 21, 2015 First, do you have kerning enabled? In the Text Editor, select the paragraph in question, then click the Paragraph button. If the Kerning box is checked, try unchecking it, or vice-versa. Second, you could try a different font, at least for the period/dot character. Third, you could try using an entity such as or for a smaller space. Quote Link to comment Share on other sites More sharing options...
David Miller Posted July 21, 2015 Share Posted July 21, 2015 Forth, you might try adding the Tracking Tag to your Replace Substring command and remove the space between the "L" and "Period". <tracking newsize=[color="Red"]150[/color]>L.</tracking> Adjust the value in red accordingly. The tracking value is written as a percentage of the typeface's default value. Quote Link to comment Share on other sites More sharing options...
tbender Posted July 21, 2015 Author Share Posted July 21, 2015 The kerning off and on does not fix my issue. I have not done rules to replace fonts or use special characters, do you have an example of how the rule would be written? Basically I need to replace L. and E. with either a narrow space between the letter and period or change the font for the period. I think the narrow space would probably be better. Thanks for the help, I appreciate it. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted July 21, 2015 Share Posted July 21, 2015 I have not done rules to replace fonts or use special characters, do you have an example of how the rule would be written? Basically I need to replace L. and E. with either a narrow space between the letter and period or change the font for the period. I think the narrow space would probably be better. Something like this: var text = TaggedTextFromRaw(Field("Your Field Name")); text = ReplaceSubstring(text, "L.", "L ."); text = ReplaceSubstring(text, "E.", "E ."); return text; Or, using Regular Expressions: return TaggedTextFromRaw(Field("Your Field Name")).replace(/([LE])(\.)/g, "$1 $2"); Make sure to check the "Treat returned strings as tagged text" box. Quote Link to comment Share on other sites More sharing options...
tbender Posted July 21, 2015 Author Share Posted July 21, 2015 The thinspace is not working, I tired to put the tracking into the replacesubstring command, but I am not doing this right, can you let me know how I would combine these? I appreciate all the help. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted July 21, 2015 Share Posted July 21, 2015 The thinspace is not working, I tired to put the tracking into the replacesubstring command, but I am not doing this right, can you let me know how I would combine these? I appreciate all the help. Exactly how is it not working? You may need to send the template, along with the font, to Support for analysis. Please do not post the font on this public forum, though. Quote Link to comment Share on other sites More sharing options...
tbender Posted July 21, 2015 Author Share Posted July 21, 2015 Sorry for being vague, it does work but the space is still to big. I was going to try to use the tracking tag as David suggested but could not figure out how to combine that with the replacesubstring command. Let me know if this is possible, thanks again! Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted July 21, 2015 Share Posted July 21, 2015 Sorry for being vague, it does work but the space is still to big. I was going to try to use the tracking tag as David suggested but could not figure out how to combine that with the replacesubstring command. Let me know if this is possible, thanks again! var text = TaggedTextFromRaw(Field("Your Field Name")); text = ReplaceSubstring(text, "L.", <tracking newsize=150>L.</tracking>"); text = ReplaceSubstring(text, "E.", "<tracking newsize=150>E.</tracking>"); return text; Quote Link to comment Share on other sites More sharing options...
David Miller Posted July 21, 2015 Share Posted July 21, 2015 var text = TaggedTextFromRaw(Field("Your Field Name")); text = ReplaceSubstring(text, "L.", [color="Red"]"[/color]<tracking newsize=[color="red"]20[/color]>L.</tracking>"); text = ReplaceSubstring(text, "E.", "<tracking newsize=[color="red"]20[/color]>E.</tracking>"); return text; You'll need to add the quote in red above and adjust the tracking values also in red. Quote Link to comment Share on other sites More sharing options...
tbender Posted July 21, 2015 Author Share Posted July 21, 2015 Ok, this is doing what I need 99%. The tracking tag is adding space between the L and period, but also after the period as well. Is there a way around this? Quote Link to comment Share on other sites More sharing options...
David Miller Posted July 21, 2015 Share Posted July 21, 2015 (edited) Ok, this is doing what I need 99%. The tracking tag is adding space between the L and period, but also after the period as well. Is there a way around this? If tracking is affected after the period, try closing the tracking tag before the period. var text = TaggedTextFromRaw(Field("Your Field Name")); text = ReplaceSubstring(text, "L.", "<tracking newsize=[color="Red"]20[/color]>L</tracking>."); text = ReplaceSubstring(text, "E.", "<tracking newsize=[color="red"]20[/color]>E</tracking>."); return text; Edited July 21, 2015 by David Miller Quote Link to comment Share on other sites More sharing options...
tbender Posted July 22, 2015 Author Share Posted July 22, 2015 This works perfectly, thank you all for the help! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.