Require textquotedbl def with second language that has internal fontenc

Since these switch locally to encodings that do not define \textquotedbl
themselves.
This commit is contained in:
Juergen Spitzmueller 2017-08-10 11:47:52 +02:00
parent 584ce50533
commit b2841e9570
3 changed files with 9 additions and 5 deletions

View File

@ -1505,7 +1505,8 @@ void Paragraph::Private::validate(LaTeXFeatures & features) const
if (c == 0x0022) {
if (features.runparams().isFullUnicode() && bp.useNonTeXFonts)
features.require("textquotedblp");
else if (bp.main_font_encoding() != "T1")
else if (bp.main_font_encoding() != "T1"
|| ((&owner_->getFontSettings(bp, i))->language()->internalFontEncoding()))
features.require("textquotedbl");
}
BufferEncodings::validate(c, features);

View File

@ -603,7 +603,7 @@ docstring const InsetQuotesParams::getShortGuiLabel(docstring const string)
InsetQuotes::InsetQuotes(Buffer * buf, string const & str)
: Inset(buf),
style_(InsetQuotesParams::EnglishQuotes), side_(InsetQuotesParams::OpeningQuote),
pass_thru_(false)
pass_thru_(false), internal_fontenc_(false)
{
if (buf) {
global_style_ = buf->masterBuffer()->params().quotes_style;
@ -620,7 +620,7 @@ InsetQuotes::InsetQuotes(Buffer * buf, string const & str)
InsetQuotes::InsetQuotes(Buffer * buf, char_type c, InsetQuotesParams::QuoteLevel level,
string const & side, string const & style)
: Inset(buf), level_(level), pass_thru_(false), fontspec_(false)
: Inset(buf), level_(level), pass_thru_(false), fontspec_(false), internal_fontenc_(false)
{
bool dynamic = false;
if (buf) {
@ -976,6 +976,7 @@ void InsetQuotes::updateBuffer(ParIterator const & it, UpdateType /* utype*/)
BufferParams const & bp = buffer().masterBuffer()->params();
pass_thru_ = it.paragraph().isPassThru();
context_lang_ = it.paragraph().getFontSettings(bp, it.pos()).language()->code();
internal_fontenc_ = it.paragraph().getFontSettings(bp, it.pos()).language()->internalFontEncoding();
fontenc_ = bp.main_font_encoding();
global_style_ = bp.quotes_style;
fontspec_ = bp.useNonTeXFonts;
@ -1032,7 +1033,7 @@ void InsetQuotes::validate(LaTeXFeatures & features) const
case 0x0022: {
if (features.runparams().isFullUnicode() && fontspec_)
features.require("textquotedblp");
else if (fontenc_ != "T1")
else if (fontenc_ != "T1" || internal_fontenc_)
features.require("textquotedbl");
break;
}

View File

@ -191,7 +191,7 @@ private:
InsetQuotesParams::QuoteLevel level_;
///
InsetQuotesParams::QuoteStyle global_style_;
///
/// Current font encoding
std::string fontenc_;
/// Code of the contextual language
std::string context_lang_;
@ -199,6 +199,8 @@ private:
bool pass_thru_;
/// Do we use fontspec?
bool fontspec_;
/// Do we have an internal font encoding?
bool internal_fontenc_;
///
friend class InsetQuotesParams;