7 Replies Latest reply: Nov 14, 2012 10:57 PM by Art.Ball RSS

    Line breaks in Thai

    D.aniel

      Hi,

       

      I know Thai isn't officially supported in FM, but it is possible to do. The problem is that Thai doesn't have spaces between words (or any punctuation) so the text looks like one long word and runs from one line to the next. However, you're not supposed to break words across lines. Without spaces, I don't know where the words start and end.

       

      Has anyone found a way of automatically getting line breaks in the right place (without adding them manually)? Are they any plugins that handle this?

       

      I'm using FM 8 on XP.

       

      Thanks,

      Daniel

        • 1. Re: Line breaks in Thai
          David Crowe Community Member

          I’m on shaky ground here, and have no idea if this works, but …


          There is a Unicode character, zero-width space, U+200B. I found some in a FrameMaker document once that had come in probably via Word. More about this (but not in a FrameMaker context on Wikipedia, with a demonstration of how it works.


          The font I was using didn’t have a character for it, so it showed up as ?


          But presumably your Thai fonts will recognise it and handle it correctly.


          So you could try adding that character to the permissible line-breaks in the Text Options dialogue.

          • 2. Re: Line breaks in Thai
            Bob Niland (Error 7103) Community Member

            There is a Unicode character, zero-width space, U+200B.

             

            The Unicode ZWS approach is more elegant, if FM recognizes it as a space for EOL purposes (and I have no idea about that). In case it matters, it won't back-port to FM 7 or earlier.

             

            An ordinary space, redefined to zero-width, might also do.

             

            This seemed to work (for point size 12 Times):

            1. Create a Character format "Spread.Zero" which has:
              Font: As-Is
              Size: 4
              Spread: -40.0%
              Pair Kern: Off

              (all others As-Is)
            2. Create a Variable named: "Char.Space.Null" which is:
              <Spread.Zero> <Default ¶ Font>

             

            You might need to experiment with the -40%, depending on the font. The PtSz 4 might not be necessary.

             

            Negative Stretch, by the way, doesn't work (at least in FM7). It won't go below positive 10.0%.

             

            Using a Variable prevents inadvertently remaining in the Spread.Zero mode for subsequent text.

             

            Using a variable also allows you to easily make all these spaces highly visible during edit, then vanish them for rendering (I'd use a Variable for the Unicode ZWS approach as well, for that same reason).

            • 3. Re: Line breaks in Thai
              D.aniel Community Member

              Hi,

               

              Thank you both for your suggestions. The problem is that I already have the Thai text. What I need is a way to either add zero-length spaces automatically, or to add line breaks automatically. I can't read Thai so I don't know where to put them.

               

              I've talked to the localisation company about asking the translators to add them, but they are very reluctant. Apparently this is not standard and as the volume is quite high would be difficult (and therefore expensive).

               

              My source is XML so I could also parse that - does anyone know any tools, plug-ins etc. that will do the job?

               

              Thanks,

              Daniel

              • 4. Re: Line breaks in Thai
                Bob Niland (Error 7103) Community Member

                The problem is that I already have the Thai text.

                I can't read Thai so I don't know where to put  them.

                 

                You're probably going to need someone who does. One approach that might be worth a try is to paste the text into some WP or DTP that does support Thai and also provides control over inter-word spacing. Set the spacing really large, and use it as a guide for inserting ZWS in Frame.

                 

                I've talked to the localisation company about asking the translators to add them, but they are very reluctant.

                 

                They don't need to add spaces or EOLs; they only need to add some character that doesn't otherwise appear in the text, perhap an underscore ("_"). You can then insert one ZWS variable, copy it, and batch change all _ By Pasting.

                • 5. Re: Line breaks in Thai
                  Bob Niland (Error 7103) Community Member

                  My source is XML so I could also parse that ...

                   

                  If there is an XML tag for each word, there'd at least be something for a tool or script to chew on.

                   

                  However, I'm wondering why you need to use Frame for this job, unless the Frame hammer is the only tool at hand to set these Thai screws. It would be like using Illustrator to write a manual (even a small one). Yeah, you could do that, but ...

                   

                  Even if you get a Framemaker Flow A with ZWS-delimited words, this could be close to an unmaintainable document for the next person who has to work on it. It really needs a WP or DTP app that is Thai-aware (and I haven't any to recommend).

                  • 6. Re: Line breaks in Thai
                    D.aniel Community Member

                    Thanks for the suggestions. If anyone knows of a Thai-aware DTP app I'd be interested to hear.

                     

                    Thanks,

                    Daniel

                    • 7. Re: Line breaks in Thai
                      Art.Ball

                      Let's try InDesign CS5, 6 with World-Ready Composer. It can help you for thai line-breaking.