]> git.lyx.org Git - lyx.git/blobdiff - src/Paragraph.cpp
again some things which cherry pick did not catch, sorry
[lyx.git] / src / Paragraph.cpp
index 37c078b9c5a9d057e9695a87026625d1570d3414..7a513aad64de8532564b28978a9599fae2a2cd60 100644 (file)
@@ -345,6 +345,12 @@ public:
                pos_type i,
                unsigned int & column);
        ///
+       bool latexSpecialT3(
+               char_type const c,
+               otexstream & os,
+               pos_type i,
+               unsigned int & column);
+       ///
        bool latexSpecialTypewriter(
                char_type const c,
                otexstream & os,
@@ -1169,17 +1175,21 @@ void Paragraph::Private::latexSpecialChar(otexstream & os,
                return;
        }
 
+       // TIPA uses its own T3 encoding
+       if (runparams.inIPA && latexSpecialT3(c, os, i, column))
+               return;
        // If T1 font encoding is used, use the special
        // characters it provides.
        // NOTE: some languages reset the font encoding
        // internally
-       if (!running_font.language()->internalFontEncoding()
+       if (!runparams.inIPA && !running_font.language()->internalFontEncoding()
            && lyxrc.fontenc == "T1" && latexSpecialT1(c, os, i, column))
                return;
 
        // \tt font needs special treatment
-       if (running_font.fontInfo().family() == TYPEWRITER_FAMILY
-               && latexSpecialTypewriter(c, os, i, column))
+       if (!runparams.inIPA
+            && running_font.fontInfo().family() == TYPEWRITER_FAMILY
+            && latexSpecialTypewriter(c, os, i, column))
                return;
 
        // Otherwise, we use what LaTeX provides us.
@@ -1279,7 +1289,8 @@ void Paragraph::Private::latexSpecialChar(otexstream & os,
                    && prefixIs(latex, from_ascii("\\" + script)))
                        column += writeScriptChars(os, latex,
                                        running_change, encoding, i) - 1;
-               else if (!prefixIs(nextlatex, from_ascii("\\"))
+               else if (Encodings::needsTermination(c)
+                        && !prefixIs(nextlatex, from_ascii("\\"))
                         && !prefixIs(nextlatex, from_ascii("{"))
                         && !prefixIs(nextlatex, from_ascii("}"))
                         && latex.length() > 1 && latex[latex.length() - 1] != '}'
@@ -1331,6 +1342,23 @@ bool Paragraph::Private::latexSpecialT1(char_type const c, otexstream & os,
 }
 
 
+bool Paragraph::Private::latexSpecialT3(char_type const c, otexstream & os,
+       pos_type /*i*/, unsigned int & /*column*/)
+{
+       switch (c) {
+       case '*':
+       case '[':
+       case ']':
+       case '|':
+       case '\"':
+               os.put(c);
+               return true;
+       default:
+               return false;
+       }
+}
+
+
 bool Paragraph::Private::latexSpecialTypewriter(char_type const c, otexstream & os,
        pos_type i, unsigned int & column)
 {