Hyphens doesn't word wrap nicely like spaces.
Hi, I'm using a small circular label (11 mm) and thus the font needs to be as large as possible.
I am using the "paragraph" text and I have one field which has the most characters and I would like it word wrapped nicely to maximise the font.
However, when the field has hyphens, it doesn't line feed like a spaces does. I have tried to use the Transform function to 1. Search for hyphen-minus (-) and Insert zero-width space (U+200B) after to force a line feed where appropriate and 2. Search for hyphen-minus and replace with soft hyphen (U+00AD). It didn't seem to work as shown below. Seems like Unicode isn't supported; I get an error regarding invalid characters when clicking Test.
I have also tried using the Character Template function; it always looks good for one entry but bad for the others. For example my template is ???????@-?\n% and any white space from the database no longer word wraps nicely especially if there are no hyphen-minus at all.
Does anyone have a good suggestion or workaround? I could use VBscript as well but I couldn't figure out the right code to get it to work. Basically I'm trying to get the hyphen-minus to behave like a keyboard space - to wrap nicely without breaking at inappropriate parts or by adding zero-width space which the search and replace Transform didn't support. I'm also avoiding having to add spaces manually to the database.
Anyway this is my database csv file:
-
Not exactly sure what you are trying to achieve as the Search - and Replace with <SPACE> seems to work alright with my copy. Have you tried the Search - and Replace with Control Code (arrow to the right of the entry box) HT / Horizontal Tab as an alternative?
0 -
Thanks for your reply.
I'd like to display hyphens there instead of spaces. If I do use hyphens the font becomes really small and doesn't line feed automatically like spaces. In most typewriter software like Microsoft word; hyphens always provide an opportunity for automatic line feed. When I googled this problem, I get many results where people do not want to line feed at hyphens and their solution was to use a non-break hyphen. But what I want to achieve here is the direct opposite, the hyphens that I used in this software refuses to line feed automatically.
0 -
Have you tried adjusting the Replace to add both the Line Feed or Carriage Return (from the Control Code option as above) and then add back the hyphen too, placing whichever one you want first ?
0 -
You could also use a non-breaking space or non-breaking hyphen instead of the regular ones. Use the insert symbol or special character dialog to insert the Unicode character by searching for its Unicode number. This is 00A0 for the NBSP and 2012 for the NBHY. Of course the text object in use will need to be using a Unicode font. Give it a whirl!
0
Please sign in to leave a comment.
Comments
4 comments