X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FFont.cpp;h=9124f0ab05c94f3e848c898966379939594bd87a;hb=2de30c62f8d671a8c8d4d52a6a7310e2c5ca84de;hp=a155ec557ae24212d703d1d07c8515ab616091aa;hpb=969f49c2c5b55b428852f0b2c1c6e78c770608f3;p=lyx.git diff --git a/src/Font.cpp b/src/Font.cpp index a155ec557a..9124f0ab05 100644 --- a/src/Font.cpp +++ b/src/Font.cpp @@ -25,6 +25,7 @@ #include "LyXRC.h" #include "output_latex.h" #include "OutputParams.h" +#include "texstream.h" #include "support/lassert.h" #include "support/convert.h" @@ -286,6 +287,7 @@ int Font::latexWriteStartChanges(odocstream & os, BufferParams const & bparams, tmp += "{"; os << from_ascii(tmp); count += tmp.length(); + pushPolyglossiaLang(language()->polyglossia(), true); } else if (language()->encoding()->package() != Encoding::CJK) { os << '{'; count += 1; @@ -341,10 +343,11 @@ int Font::latexWriteStartChanges(odocstream & os, BufferParams const & bparams, // the numbers are written Left-to-Right. ArabTeX package // reorders the number automatically but the packages used // for Hebrew and Farsi (Arabi) do not. - if (bits_.number() == FONT_ON && prev.fontInfo().number() != FONT_ON - && (language()->lang() == "hebrew" - || language()->lang() == "farsi" - || language()->lang() == "arabic_arabi")) { + if (!runparams.pass_thru && bits_.number() == FONT_ON + && prev.fontInfo().number() != FONT_ON + && (language()->lang() == "hebrew" + || language()->lang() == "farsi" + || language()->lang() == "arabic_arabi")) { os << "{\\beginL "; count += 9; } @@ -418,22 +421,22 @@ int Font::latexWriteStartChanges(odocstream & os, BufferParams const & bparams, if (f.underbar() == FONT_ON) { os << "\\uline{"; count += 10; - runparams.inulemcmd = true; + ++runparams.inulemcmd; } if (f.strikeout() == FONT_ON) { os << "\\sout{"; count += 9; - runparams.inulemcmd = true; + ++runparams.inulemcmd; } if (f.uuline() == FONT_ON) { os << "\\uuline{"; count += 11; - runparams.inulemcmd = true; + ++runparams.inulemcmd; } if (f.uwave() == FONT_ON) { os << "\\uwave{"; count += 10; - runparams.inulemcmd = true; + ++runparams.inulemcmd; } return count; } @@ -497,32 +500,33 @@ int Font::latexWriteEndChanges(otexstream & os, BufferParams const & bparams, if (f.underbar() == FONT_ON) { os << '}'; ++count; - runparams.inulemcmd = false; + --runparams.inulemcmd; } if (f.strikeout() == FONT_ON) { os << '}'; ++count; - runparams.inulemcmd = false; + --runparams.inulemcmd; } if (f.uuline() == FONT_ON) { os << '}'; ++count; - runparams.inulemcmd = false; + --runparams.inulemcmd; } if (f.uwave() == FONT_ON) { os << '}'; ++count; - runparams.inulemcmd = false; + --runparams.inulemcmd; } // If the current language is Hebrew, Arabic, or Farsi // the numbers are written Left-to-Right. ArabTeX package // reorders the number automatically but the packages used // for Hebrew and Farsi (Arabi) do not. - if (bits_.number() == FONT_ON && next.fontInfo().number() != FONT_ON - && (language()->lang() == "hebrew" - || language()->lang() == "farsi" - || language()->lang() == "arabic_arabi")) { + if (!runparams.pass_thru && bits_.number() == FONT_ON + && next.fontInfo().number() != FONT_ON + && (language()->lang() == "hebrew" + || language()->lang() == "farsi" + || language()->lang() == "arabic_arabi")) { os << "\\endL}"; count += 6; } @@ -544,6 +548,8 @@ int Font::latexWriteEndChanges(otexstream & os, BufferParams const & bparams, && language()->encoding()->package() != Encoding::CJK) { os << '}'; ++count; + if (runparams.use_polyglossia) + popPolyglossiaLang(); } return count; @@ -695,6 +701,19 @@ void Font::validate(LaTeXFeatures & features) const case Color_latex: case Color_notelabel: break; + case Color_brown: + case Color_darkgray: + case Color_gray: + case Color_lightgray: + case Color_lime: + case Color_olive: + case Color_orange: + case Color_pink: + case Color_purple: + case Color_teal: + case Color_violet: + features.require("xcolor"); + break; default: features.require("color"); LYXERR(Debug::LATEX, "Color enabled. Font: " << to_utf8(stateText(0)));