From aba8c81290a3c1f8faee7d9f6dbd214440dc523d Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sun, 2 Aug 2020 10:12:19 +0200 Subject: [PATCH] Next attempt at correctly setting fonts in insets depending on inheritFont() --- src/Paragraph.cpp | 7 ++++--- src/insets/InsetTabular.h | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index 3c5f690b45..f2d97fe7c9 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -2393,8 +2393,9 @@ void Paragraph::latex(BufferParams const & bparams, pos_type body_pos = beginOfBody(); unsigned int column = 0; - // If we are inside an inset, the real outerfont is local_font - Font const real_outerfont = (runparams.local_font != nullptr) + // If we are inside an non inheritFont() inset, the real outerfont is local_font + Font const real_outerfont = (!inInset().inheritFont() + && runparams.local_font != nullptr) ? Font(runparams.local_font->fontInfo()) : outerfont; if (body_pos > 0) { @@ -2558,7 +2559,7 @@ void Paragraph::latex(BufferParams const & bparams, ++column; // Fully instantiated font - Font const current_font = getFont(bparams, i, real_outerfont); + Font const current_font = getFont(bparams, i, outerfont); Font const last_font = running_font; bool const in_ct_deletion = (bparams.output_changes diff --git a/src/insets/InsetTabular.h b/src/insets/InsetTabular.h index de26070b7b..d917ab8370 100644 --- a/src/insets/InsetTabular.h +++ b/src/insets/InsetTabular.h @@ -80,6 +80,8 @@ public: UpdateType utype, TocBackend & backend) const; /// void metrics(MetricsInfo &, Dimension &) const; + /// Needs to be same as InsetTabular + bool inheritFont() const { return false; } private: /// unimplemented InsetTableCell();