They were output in the wrong order and thus produced wrong result.
/// Output consecutive unicode chars, belonging to the same script as
/// specified by the latex macro \p ltx, to \p os starting from \p i.
/// \return the number of characters written.
/// Output consecutive unicode chars, belonging to the same script as
/// specified by the latex macro \p ltx, to \p os starting from \p i.
/// \return the number of characters written.
- int writeScriptChars(otexstream & os, docstring const & ltx,
+ int writeScriptChars(OutputParams const &, otexstream & os,
+ docstring const & ltx,
Change const &, Encoding const &,
std::string const, pos_type & i);
Change const &, Encoding const &,
std::string const, pos_type & i);
-int Paragraph::Private::writeScriptChars(otexstream & os,
+int Paragraph::Private::writeScriptChars(OutputParams const & runparams,
+ otexstream & os,
docstring const & ltx,
Change const & runningChange,
Encoding const & encoding,
docstring const & ltx,
Change const & runningChange,
Encoding const & encoding,
// Stop here if there is a font attribute or encoding change.
if (found && cit != end && prev_font != cit->font())
break;
// Stop here if there is a font attribute or encoding change.
if (found && cit != end && prev_font != cit->font())
break;
+
+ // Check whether we have a combining pair
+ char_type next_next = '\0';
+ if (i + 2 < size) {
+ next_next = text_[i + 2];
+ if (Encodings::isCombiningChar(next_next)) {
+ length += latexSurrogatePair(os, next, next_next, runparams) - 1;
+ i += 2;
+ continue;
+ }
+ }
+
docstring const latex = encoding.latexChar(next).first;
docstring::size_type const b1 =
latex.find_first_of(from_ascii("{"));
docstring const latex = encoding.latexChar(next).first;
docstring::size_type const b1 =
latex.find_first_of(from_ascii("{"));
fontenc = running_font.language()->fontenc();
if (Encodings::isKnownScriptChar(c, script)
&& prefixIs(latex.first, from_ascii("\\" + script)))
fontenc = running_font.language()->fontenc();
if (Encodings::isKnownScriptChar(c, script)
&& prefixIs(latex.first, from_ascii("\\" + script)))
- column += writeScriptChars(os, latex.first,
+ column += writeScriptChars(runparams, os, latex.first,
running_change, encoding,
fontenc, i) - 1;
else if (latex.second
running_change, encoding,
fontenc, i) - 1;
else if (latex.second