commit 8021c0b0dcf588527eeb183ca52e4900ffbf7527
Author: Günter Milde <[email protected]>
Date: Fri Nov 13 13:59:17 2015 +0100
Update comments after solving #9740.
diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index f2eae77..d24342c 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -1651,7 +1651,7 @@ bool Buffer::makeLaTeXFile(FileName const & fname,
OutputParams runparams = runparams_in;
// 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))
runparams.encoding = encodings.fromLyXName("ascii");
@@ -1738,12 +1738,12 @@ void Buffer::writeLaTeXSource(otexstream & os,
OutputParams runparams = runparams_in;
// XeTeX with TeX fonts is only safe with ASCII encoding,
- // See #9740 and FIXME 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.
+ // but the "flavor" is not known in BufferParams::encoding().
if (!params().useNonTeXFonts && (runparams.flavor ==
OutputParams::XETEX))
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
// child of some other buffer, let's cut the link here, so the
diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp
index fa2f97b..3af1427 100644
--- a/src/BufferParams.cpp
+++ b/src/BufferParams.cpp
@@ -3141,14 +3141,13 @@ string const BufferParams::loadFonts(LaTeXFeatures &
features) const
Encoding const & BufferParams::encoding() const
{
- // FIXME: For export with XeTeX and TeX fonts,
- // this function returns the wrong value.
- // The combination of XeTeX and TeX-fonts requires ASCII (see #9740).
- // However, the flavor is no buffer parameter but only known once
export started.
- // Currently, we set runparams.encoding to ASCII in
Buffer::makeLaTeXFile
- // (for export) and Buffer::writeLaTeXSource (for preview)
- // and prevent overwriting it with another encoding in
Paragraph::latex
- // and at four places in output_latex.cpp.
+ // Main encoding for LaTeX output.
+ //
+ // Exception: XeTeX with 8-bit TeX fonts requires ASCII (see #9740).
+ // As the "flavor" is only known once export started, this
+ // cannot be handled here. Instead, runparams.encoding is set
+ // to ASCII in Buffer::makeLaTeXFile (for export)
+ // and Buffer::writeLaTeXSource (for preview).
if (useNonTeXFonts)
return *(encodings.fromLyXName("utf8-plain"));
if (inputenc == "auto" || inputenc == "default")
diff --git a/src/BufferParams.h b/src/BufferParams.h
index 6b2bb47..a0e0d45 100644
--- a/src/BufferParams.h
+++ b/src/BufferParams.h
@@ -314,6 +314,8 @@ public:
std::string inputenc;
/// The main encoding used by this buffer for LaTeX output.
/// 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;
///
std::string origin;