mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 21:49:51 +00:00
Handle combining characters in writeScriptChars
They were output in the wrong order and thus produced wrong result.
This commit is contained in:
parent
a6c6bffbed
commit
d77c0707e0
@ -330,7 +330,8 @@ public:
|
|||||||
/// Output consecutive unicode chars, belonging to the same script as
|
/// Output consecutive unicode chars, belonging to the same script as
|
||||||
/// specified by the latex macro \p ltx, to \p os starting from \p i.
|
/// specified by the latex macro \p ltx, to \p os starting from \p i.
|
||||||
/// \return the number of characters written.
|
/// \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 &,
|
Change const &, Encoding const &,
|
||||||
std::string const, pos_type & i);
|
std::string const, pos_type & i);
|
||||||
|
|
||||||
@ -965,7 +966,8 @@ bool Paragraph::Private::simpleTeXBlanks(OutputParams const & runparams,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int Paragraph::Private::writeScriptChars(otexstream & os,
|
int Paragraph::Private::writeScriptChars(OutputParams const & runparams,
|
||||||
|
otexstream & os,
|
||||||
docstring const & ltx,
|
docstring const & ltx,
|
||||||
Change const & runningChange,
|
Change const & runningChange,
|
||||||
Encoding const & encoding,
|
Encoding const & encoding,
|
||||||
@ -1022,6 +1024,18 @@ int Paragraph::Private::writeScriptChars(otexstream & os,
|
|||||||
// Stop here if there is a font attribute or encoding change.
|
// Stop here if there is a font attribute or encoding change.
|
||||||
if (found && cit != end && prev_font != cit->font())
|
if (found && cit != end && prev_font != cit->font())
|
||||||
break;
|
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 const latex = encoding.latexChar(next).first;
|
||||||
docstring::size_type const b1 =
|
docstring::size_type const b1 =
|
||||||
latex.find_first_of(from_ascii("{"));
|
latex.find_first_of(from_ascii("{"));
|
||||||
@ -1364,7 +1378,7 @@ void Paragraph::Private::latexSpecialChar(otexstream & os,
|
|||||||
fontenc = running_font.language()->fontenc();
|
fontenc = running_font.language()->fontenc();
|
||||||
if (Encodings::isKnownScriptChar(c, script)
|
if (Encodings::isKnownScriptChar(c, script)
|
||||||
&& prefixIs(latex.first, from_ascii("\\" + script)))
|
&& prefixIs(latex.first, from_ascii("\\" + script)))
|
||||||
column += writeScriptChars(os, latex.first,
|
column += writeScriptChars(runparams, os, latex.first,
|
||||||
running_change, encoding,
|
running_change, encoding,
|
||||||
fontenc, i) - 1;
|
fontenc, i) - 1;
|
||||||
else if (latex.second
|
else if (latex.second
|
||||||
|
Loading…
Reference in New Issue
Block a user