On 2015-10-25, Georg Baum wrote:
> Guenter Milde wrote:

>> Actually, the patch does now what Georg expected the old patch to do:

>> set encoding to ASCII for every use of XETEX, also with non-TeX fonts.

>> This fails with characters without a LICR defined by "xunicode".

>> So the current best known version would be to admit the limit:

> IMO this points to a serious bug and needs to be investigated further: The 
> condition

> if (!params().useNonTeXFonts && runparams.flavor == OutputParams::XETEX)
>       runparams.encoding = encodings.fromLyXName("ascii");

> describes exactly what should happen. So if this sets the encoding to ascii 
> even if non-TeX fonts are used, then params().useNonTeXFonts must be wrong, 
> and this would be a serious problem. My guess would be that the code is 
> correct, but that the other occurence of this code in writeLaTeXSource() 
> does the wrong thing. If the if-condition in this one is adjusted as well, 
> then it will probably work.


The problem was part what you described and part use of a non-minimal test
file: doc/ru/Intro.lyx failed to compile with XeTeX (both, TeX fonts and
non-TeX fonts) for several reasons:

* wrong preamble code prevents use of non-TeX fonts (overwritten by loading 
  lmodern.sty)

* the file does not compile with "inputenc = ascii", because of a spurious
  \textcyr font encoding change between an accent and the base letter (see
  #9637) with both, pdflatex and xelatex.
  
The missing fix in writeLaTeXSource() suggested this were due to wrong input
encoding in both cases, but finally I sorted this out.

So, besides the FIXME (the re-setting to "ascii" should rather be in
BufferEncoding.cpp) and the doubling of code in Buffer.cpp, the fixed fix is
fine and with the second fix it works reasonable with both XeTeX and LuaTeX.

Thank you for the helpfull hints.

Günter
  

Reply via email to