Jump to content

I have a problem with spacing number in a font


marcusm

Recommended Posts

Hi!

 

Im working on templates with the font "Folio". The font as standard has very large space between the number 1 and other numbers. See my screenshot.

 

http://forumbilder.se/show.aspx?iid=3f3200943533P5375

 

I can in Indesign set the tracking for the number but in Fusion Pro is this not possible because its a variable. I can only set for the whole variable and paragraph?

 

Is there any way to adjust tracking so I can reduce the space between number 1 and 0 zero in the case in the screenshot.

Link to comment
Share on other sites

FusionPro supports kerning and tracking although without JavaScript, you're limited to an all or nothing choice for static text in your variable text editor.

 

Assuming you want to adjust kerning specifically between 0 and 1 in your variable data, you could set up a JavaScript rule to search your variable strings for "01" and "10" occurrences, then return a tagged string with custom kerning set for those pairs.

 

I don't have the time today to work on a solution (although I may try later just as a learning experience). If you're lucky, Dan Korn may wander by and take up the challenge. :)

Link to comment
Share on other sites

Would the tracking setting in the Variable Text Editor Paragraph settings work for what you are trying to do? Or, are you trying to reduce the space between the 1 and the 0 specifically?

 

If so I think you're looking for kerning. Unless there has been a recently added feature for this, I don't think it can be done with FP. Perhaps it could be done with a JavaScript/tracking tag workaround. Or if you really want to put in some effort, you could try to find a font editor and build custom spacing into the font.

Link to comment
Share on other sites

Im working on templates with the font "Folio". The font as standard has very large space between the number 1 and other numbers. See my screenshot.

 

http://forumbilder.se/show.aspx?iid=3f3200943533P5375

Well, it would be easier to visualize with a bit of context, that is, to be able to see how much space there is between other combinations of numbers (besides just "10") by way of comparison. But I think that it's probably a monospaced font, so, by definition, each character takes up a certain width, with no kerning. Even in fonts that aren't otherwise monospaced, often the digits still are, so that tables of numbers always line up. You can see this here in the forum in the default Verdana font:

 

1234567890 - monospaced

6789012345 - monospaced

0001110000 - monospaced

aaawwwiiiaaa - NOT monospaced

FusionPro supports kerning and tracking although without JavaScript, you're limited to an all or nothing choice for static text in your variable text editor.

Yes, the problem isn't that InDesign has some capability that FusionPro is lacking; it's that you're using variable data, so you can't simply do everything in the WYSIWYG editor.

Assuming you want to adjust kerning specifically between 0 and 1 in your variable data, you could set up a JavaScript rule to search your variable strings for "01" and "10" occurrences, then return a tagged string with custom kerning set for those pairs.

You should be able to do something like this:

return NormalizeEntities(Field("YourFieldName")).replace(/(1\d|\d1)/g, "<tracking newsize=-10>$1</tracking>");

Link to comment
Share on other sites

Hi!

 

I have tried to apply the code in a new rule. The problem is that im only getting the text "<tracking newsize=-10">18</tracking> back and not anything that happens to the text, no tracking is done with the rule? :confused: This is when I place the rule in the text editor and replaces the old variable which don't have any rule connected to it.

 

The Validation of the rules gives me <tracking newsize=-10>18</tracking>. Isn't it supposte to do the tracking then print the number set in the FLAT FILE DATA?

 

In this example are 18 the data from the Flat File data.

 

Is there a special way to apply the rule? I have replaced in the code below to the exact right field name for my template.

 

return NormalizeEntities(Field("Pris (KR)")).replace(/(1\d|\d1)/g, "<tracking newsize=-10>$1</tracking>");

Link to comment
Share on other sites

Hi again!

 

Its working with the tracking now. But there's a problem. The space between the next numbers and the 8 in 18 (for an example) is too tight. Even if I change value of the tracking. It seems to do the tracking on both nr 1 and 8? Is there any code to just set the tracking for 1 and X and not the space between 8 and next character? :confused:

Link to comment
Share on other sites

I'm no Dan (i.e. I never would have come up with a 1-liner solution on my own), but what happens if you replace

return NormalizeEntities(Field("Pris (KR)")).replace(/(1\d|\d1)/g, "<tracking newsize=-10>$1</tracking>");

with

return NormalizeEntities(Field("Pris (KR)")).replace(/(1|\d1)/g, "<tracking newsize=-10>$1</tracking>");

The second snippet changes the search for any occurrence of "1" or "#1" and applies tracking to each occurrence. Previously the tracking was also being applied to the number following the "1".

 

If the second version doesn't work, perhaps reducing the search to just any instance of a "1" would be correct, thus

return NormalizeEntities(Field("Pris (KR)")).replace(/(1)/g, "<tracking newsize=-10>$1</tracking>");

Link to comment
Share on other sites

The first code you had as an option made it look like this:

 

 

I think its to much space between 1 and 8 in the first two numbers? The problem is that if I put more tracking to it the second number 1 will be to tight to the 8 in this case.

 

http://forumbilder.se/show.aspx?iid=754200941004P7ae5

 

In the second one I tried with value -20 of the tracking. But the second number 1 is not in the right place. See screenshot below.

 

http://forumbilder.se/show.aspx?iid=494200941151P79c3

 

There's also a problem about the variable after the first numbervariable. The second is included in the tracking and will go into the first numbervariable because of the tracking. I can space it away, but it wont get in the exact spot that I want.

 

Any ideas?

Link to comment
Share on other sites

Based on your examples, it would seem like Dan's original code would yield the correct result EXCEPT that the leading tags overlap for the "18" combination and the "81" combination. You seem to need the code to find a kerning pair, but then test the following digit to determine if it is also a "1" in which case it is added to the original set (i.e. code finds the "18", then tests the third digit which is a "1" so changes the return tagged string from "18" to "181"). A TRUE result would further require the next digit to be checked (unless you never have more than a three digit number to worry about). I suspect Dan will need less than 10 extra characters in his code to solve that problem. ;)

 

As for the smaller numbers being affected, would it be an option to set up a separate variable text block for those with the large numbers right-justified and the smaller numbers left-justified? For smaller numbers with a "1" in the data, a duplicate rule would be applied separately to that block so that kerning did not occur between dollars and cents (or Euro or Krona as the case may be...)

Link to comment
Share on other sites

There seems to be a link missing after your first sentence, "The first code you had as an option made it look like this:"

 

It would also be helpful to see what result you're actually trying to get, based on specific input data. Anyway, this is why is said earlier that it would be helpful to have more context, to show more examples about how you want the output to appear for combinations other than just "10".

 

That said, I'm not sure I can do much else to help you tweak things to get the output to come out exactly the way you want it without having your fonts and your data.

 

And frankly, we're getting into very strict requirements here about moving things around by a few points, which is pushing the bounds of what can be done on this forum. Your fellow forum members and I can't completely reproduce your output without your job and all of your fonts, and even if we could, it's not reasonable to expect someone on the forum to spend a lot of time going back and forth with you tweaking every little thing.

 

If your tolerances are really that tight, you might consider some paid consulting to help make everything come out everything just so. You may ultimately find it easier to try invaricconsulting's suggestion of modifying the font in a font editor to tweak the kerning pairs instead of trying to make it do things it's not designed to do with tagging in FusionPro.

Link to comment
Share on other sites

I hope Dan maybe can come to a solution.

 

About putting the small numbers in a new textblock...

 

How do I get one textblock to be depending on another textblock? I mean If i put three numbers in the first textblock, the text will go right through the smallnumbersvariable?

 

Im going to check tomorrow if we have any font editors available, this problem is getting bigger and bigger :/

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...