Update comments after solving #9740.

This commit is contained in:
Günter Milde 2015-11-13 13:59:17 +01:00
parent 62190855bf
commit 8021c0b0dc
3 changed files with 14 additions and 13 deletions

View File

@ -1651,7 +1651,7 @@ bool Buffer::makeLaTeXFile(FileName const & fname,
OutputParams runparams = runparams_in; OutputParams runparams = runparams_in;
// XeTeX with TeX fonts is only safe with ASCII encoding, // XeTeX with TeX fonts is only safe with ASCII encoding,
// See #9740 and FIXME in BufferParams::encoding() // but the "flavor" is not known in BufferParams::encoding().
if (!params().useNonTeXFonts && (runparams.flavor == OutputParams::XETEX)) if (!params().useNonTeXFonts && (runparams.flavor == OutputParams::XETEX))
runparams.encoding = encodings.fromLyXName("ascii"); runparams.encoding = encodings.fromLyXName("ascii");
@ -1738,12 +1738,12 @@ void Buffer::writeLaTeXSource(otexstream & os,
OutputParams runparams = runparams_in; OutputParams runparams = runparams_in;
// XeTeX with TeX fonts is only safe with ASCII encoding, // XeTeX with TeX fonts is only safe with ASCII encoding,
// See #9740 and FIXME in BufferParams::encoding() // but the "flavor" is not known in BufferParams::encoding().
// FIXME: when only the current paragraph is shown, this is ignored and
// characters encodable in the current encoding are not converted
// to ASCII-representation.
if (!params().useNonTeXFonts && (runparams.flavor == OutputParams::XETEX)) if (!params().useNonTeXFonts && (runparams.flavor == OutputParams::XETEX))
runparams.encoding = encodings.fromLyXName("ascii"); runparams.encoding = encodings.fromLyXName("ascii");
// FIXME: when only the current paragraph is shown, this is ignored
// (or not reached) and characters encodable in the current
// encoding are not converted to ASCII-representation.
// If we are compiling a file standalone, even if this is the // If we are compiling a file standalone, even if this is the
// child of some other buffer, let's cut the link here, so the // child of some other buffer, let's cut the link here, so the

View File

@ -3141,14 +3141,13 @@ string const BufferParams::loadFonts(LaTeXFeatures & features) const
Encoding const & BufferParams::encoding() const Encoding const & BufferParams::encoding() const
{ {
// FIXME: For export with XeTeX and TeX fonts, // Main encoding for LaTeX output.
// this function returns the wrong value. //
// The combination of XeTeX and TeX-fonts requires ASCII (see #9740). // Exception: XeTeX with 8-bit TeX fonts requires ASCII (see #9740).
// However, the flavor is no buffer parameter but only known once export started. // As the "flavor" is only known once export started, this
// Currently, we set runparams.encoding to ASCII in Buffer::makeLaTeXFile // cannot be handled here. Instead, runparams.encoding is set
// (for export) and Buffer::writeLaTeXSource (for preview) // to ASCII in Buffer::makeLaTeXFile (for export)
// and prevent overwriting it with another encoding in Paragraph::latex // and Buffer::writeLaTeXSource (for preview).
// and at four places in output_latex.cpp.
if (useNonTeXFonts) if (useNonTeXFonts)
return *(encodings.fromLyXName("utf8-plain")); return *(encodings.fromLyXName("utf8-plain"));
if (inputenc == "auto" || inputenc == "default") if (inputenc == "auto" || inputenc == "default")

View File

@ -314,6 +314,8 @@ public:
std::string inputenc; std::string inputenc;
/// The main encoding used by this buffer for LaTeX output. /// The main encoding used by this buffer for LaTeX output.
/// Individual pieces of text can use different encodings. /// Individual pieces of text can use different encodings.
/// Output for XeTeX with 8-bit TeX fonts uses ASCII (set at runtime)
/// instead of the value returned by this function.
Encoding const & encoding() const; Encoding const & encoding() const;
/// ///
std::string origin; std::string origin;