14 Replies Latest reply on Jan 22, 2015 5:44 AM by Peter Spier

    Breaking words

    raghugada Level 1

      Very Serious Issue With Indesign

      Hi,

       

      I noticed there is a serious issue with indesign, the words are breaking across two lines, i have attached the indesign file and snapshot of page no 4, highlighted the text where its breaking.

      I am using Indesign CS6, Scripting is in Hindi Language.

      This script works perfectly in pagemaker, with the same font, but with Indesign its causing very serious Issue

      Download Breaking Words.rar from Sendspace.com - send big files the easy way

      Regards,

      Raghu

        • 1. Re: Breaking words
          Ellis home Level 4

          Setting the kerning to Optical (instead of Metrics) seems to fix the issue. But you'll have to check for other unintended modifications to the script (I don't know Hindi). Also set the language to Hindi. When I open the document is set to English UK.

          • 2. Re: Breaking words
            Peter Spier Most Valuable Participant (Moderator)

            Some was English UK, some US, but changing to Hindi alone didn't change anything for me. I didn't try the kerning. Setting the language to No Language would probably prevent any words from breaking (except possibly those with the hyphens).

            • 3. Re: Breaking words
              raghugada Level 1

              Hi,

              Setting the kerning to optical, the character spacing decreases a lot and it looks very odd., By setting the tracking to 1 or 2 points it solves the problem, but i need to look for every line wheather its breaking, or when i change the settings like increasing the font size or decreasing it. then once again i need to look over this issue.

              Is there any alternate way where i can set the default values and it works perfectly ?

              I am expecting there should be some way of doing it, Because this works perfectly in pagemaker and other text editors, there should be some way ?

              • 4. Re: Breaking words
                Peter Spier Most Valuable Participant (Moderator)

                I think there is something odd going on here, but I don't know what it is. Applying No Language didn't prevent the break either, nor did optical kerning if applied to just the word that shouldn't break, which makes me think it was purely a coincidence that it works if applied to the entire paragraph (a combination of reduced character spacing throughout and the column width). No Language would keep words from breaking with a hyphen, I guess, but there is no hyphen being inserted where your words are breaking, so it's almost as if there is a non-joiner or discretionary line break character that has been added, but I don't see one.

                • 5. Re: Breaking words
                  Peter Spier Most Valuable Participant (Moderator)

                  I think maybe the problem is the font itself, which looks like it is not really Unicode compliant. The character where the break is occurring is mapped to the underline Low Line, or underscore character, which would explain a lot. I think we've actually seen this problem reported previously with these particular fonts, and you should try a new font that is really Unicode, but simply changing the font may not be enough, if the text was keyed using the mapping for this font.

                   

                  Joel Cherney has posted about this a few times, and maybe he'll drop in here as well. I'll ping him.

                  • 6. Re: Breaking words
                    Peter Spier Most Valuable Participant (Moderator)

                    Another thought I've just had is this might be easily fixed with a GREP style added to the paragraph styles. I don't know anything at all about setting Hindi, but I get the sense that words should never break.

                     

                    One possibility would be to create a No Break character style, and apply it as a GREP style to \S which means anything except white space. This would, however, prevent breaks at hyphens and dashes entered into  the text as well. This might not be a problem since one of your examples of an unwanted break actually is occurring on a character mapped to the hyphen.

                     

                    The other possibility would be to apply the No Break character style to just the character mapped to  the Low Line or to a class containing just the problem characters that you don't want to have triggering breaks.

                    • 7. Re: Breaking words
                      [Jongware] Most Valuable Participant

                      Peter Spier wrote:

                       

                      I think maybe the problem is the font itself, which looks like it is not really Unicode compliant. The character where the break is occurring is mapped to the underline Low Line, or underscore character, which would explain a lot.

                       

                      InDesign's formatting, line breaking, and word breaking algorithms all assume the font is properly encoded. If that is not the case, you get a situation where, say, the hyphen character is "drawn" as an "A". This works as long as you type "-" where you want an "A" but as soon as InDesign needs to break a word, you'd see it unexpectedly break "on" the A. (And other hyphenated words suddenly end with an A.)

                       

                      The very best thing to do is ditch this font. It's a dead end; no current or newer software will be able to work with it. Joel is one of the strongest advocates for that (I come running right behind him).

                       

                      The solution is to import your text, then use Find/Change for every single character code to the proper one. All of them! (It helps if you can find a predefined mapping for your font. It even helps more if you know how to write scripts )

                       

                      Earlier discussions (I feel I might have missed some):

                      Urgent! "Unwanted characters break" in InDesign

                      Need to change a regional typeface

                      in InDesign Line Break at only "Space" not to word

                      • 8. Re: Breaking words
                        Peter Spier Most Valuable Participant (Moderator)

                        For the record, I agree with Jongware here, and I think he's captured what Joel would suggest (but I also think Joel might already have the required script -- he's had to do a lot of this). My Grep style suggestion is strictly a work-around to get this project out the door.

                        • 9. Re: Breaking words
                          raghugada Level 1

                          Hi,

                           

                          I have tested even setting it to no language is not working for me,

                           

                          I see the work around is grep style, but this need to be defined for the every new font and new settings (such as font size, justification etc).

                          A line should break only at a space not at any character, in the indesign file i have sent its breaking the line at

                          particular character which is having the GID number 65 and Unicode; 005F

                           

                          This would help you to resolve the issue.

                           

                          One more thing i know the scripting, give me few examples to predefine font mappings

                           

                          Regards,

                          Raghu

                          • 10. Re: Breaking words
                            Peter Spier Most Valuable Participant (Moderator)

                            A GREP style is part of a paragraph style definition. It is not dependent on the font size or justification defined in that style (but you do need to define paragraph styles]. If you change the fonts in this document without remapping ALL of the characters to the correct unicode values you will almost certainly wind up with gibberish.

                             

                            Unicode 005F is the _ character position, and applying a No Break character style to _ does solve the problem for that character. Your screen captures show a break also at the hyphen, however, and I don't know if that is really a problem.

                            • 11. Re: Breaking words
                              raghugada Level 1

                              Hi,

                               

                              How to remapp all of the characters to correct unicode values ?

                               

                              Can u please explain in details ? And are there any scripts to do this ?

                              • 12. Re: Re: Breaking words
                                [Jongware] Most Valuable Participant

                                raghugada wrote:

                                 

                                One more thing i know the scripting, give me few examples to predefine font mappings

                                 

                                Hmmm ... "few" examples I don't know about -- it depends on the font. An example is ftp://ftp.unicode.org/%2FPublic/MAPPINGS/VENDORS/ADOBE/symbol.txt; this lists the correct Unicode code point and the code inside a certain font (in this case, "Symbol"). A script can use such a list to translate every character for that particular font only (I cannot stress that enough!) to the correct characters.

                                 

                                So first you must find out what font mapping your font(s) use. If you are lucky, someone else already did that for you and you can find it on the Internet. If not, you will have to make it yourself.

                                • 13. Re: Breaking words
                                  raghugada Level 1

                                  Hi,

                                   

                                  If u can guide me or give some sample code i can do it?

                                  If there is any library or documentation on that i can do it?

                                   

                                  it will be very helpful if there are any thing related to that ?

                                  • 14. Re: Breaking words
                                    Peter Spier Most Valuable Participant (Moderator)

                                    Create a character style that has no formatting other than checking the No Break box:

                                    No Break Char Style.png

                                     

                                    In your paragraph styles add a GREP style using _ and set the style to No Break:

                                    No Break to _.png

                                    Add this GREP style to EVERY paragraph style in your document.