diff --git a/src/insets/InsetERT.cpp b/src/insets/InsetERT.cpp index c762062005..fa689751d7 100644 --- a/src/insets/InsetERT.cpp +++ b/src/insets/InsetERT.cpp @@ -398,7 +398,8 @@ bool InsetERT::insetAllowed(Inset::Code /* code */) const bool InsetERT::metrics(MetricsInfo & mi, Dimension & dim) const { Font tmpfont = mi.base.font; - getDrawFont(mi.base.font); + getDrawFont(mi.base.font, + mi.base.bv->buffer()->params().getFont()); mi.base.font.realize(tmpfont); InsetCollapsable::metrics(mi, dim); mi.base.font = tmpfont; @@ -411,7 +412,8 @@ bool InsetERT::metrics(MetricsInfo & mi, Dimension & dim) const void InsetERT::draw(PainterInfo & pi, int x, int y) const { Font tmpfont = pi.base.font; - getDrawFont(pi.base.font); + getDrawFont(pi.base.font, + pi.base.bv->buffer()->params().getFont()); pi.base.font.realize(tmpfont); InsetCollapsable::draw(pi, x, y); pi.base.font = tmpfont; @@ -425,11 +427,14 @@ bool InsetERT::showInsetDialog(BufferView * bv) const } -void InsetERT::getDrawFont(Font & font) const +void InsetERT::getDrawFont(Font & font, Font bfont) const { font = Font(Font::ALL_INHERIT, latex_language); font.setFamily(Font::TYPEWRITER_FAMILY); font.setColor(Color::latex); + // use sensible size (e.g. in headings) + if (status() != InsetCollapsable::Inlined) + font.setSize(bfont.size()); } diff --git a/src/insets/InsetERT.h b/src/insets/InsetERT.h index ba448b9aa8..3456b577cf 100644 --- a/src/insets/InsetERT.h +++ b/src/insets/InsetERT.h @@ -71,7 +71,7 @@ public: /// bool showInsetDialog(BufferView *) const; /// - void getDrawFont(Font &) const; + void getDrawFont(Font &, Font) const; /// bool forceDefaultParagraphs(idx_type) const { return true; } /// should paragraph indendation be ommitted in any case? diff --git a/src/insets/InsetNote.cpp b/src/insets/InsetNote.cpp index 6e2fa37eb3..bd24d246f4 100644 --- a/src/insets/InsetNote.cpp +++ b/src/insets/InsetNote.cpp @@ -15,6 +15,7 @@ #include "InsetNote.h" #include "Buffer.h" +#include "BufferParams.h" #include "BufferView.h" #include "Cursor.h" #include "debug.h" @@ -160,6 +161,18 @@ Inset::DisplayType InsetNote::display() const } +bool InsetNote::metrics(MetricsInfo & mi, Dimension & dim) const +{ + Font tmpfont = mi.base.font; + mi.base.font = mi.base.bv->buffer()->params().getFont(); + InsetCollapsable::metrics(mi, dim); + mi.base.font = tmpfont; + bool const changed = dim_ != dim; + dim_ = dim; + return changed; +} + + void InsetNote::write(Buffer const & buf, ostream & os) const { params_.write(os); diff --git a/src/insets/InsetNote.h b/src/insets/InsetNote.h index 2839ed7a75..d5105d7657 100644 --- a/src/insets/InsetNote.h +++ b/src/insets/InsetNote.h @@ -56,6 +56,8 @@ public: /// framed and shaded notes are displayed virtual DisplayType display() const; /// + bool metrics(MetricsInfo &, Dimension &) const; + /// void write(Buffer const &, std::ostream &) const; /// void read(Buffer const & buf, Lexer & lex); diff --git a/status.15x b/status.15x index 491cd497f6..9fd871e29e 100644 --- a/status.15x +++ b/status.15x @@ -78,6 +78,8 @@ What's new - Fix crash related to the outline pane with some documents (bug 4857). +- Fix input of numeric values in non-english locales (bug 4951). + - Fix display of filters such as "LaTeX (plain)" in the file dialog. - Fix 7 years-old bug with functions whose state can be toggled. @@ -86,7 +88,8 @@ What's new - Allow the use of eqrefs in mathed (bug 4623). -- Fix input of numeric values in non-english locales (bug 4951). +- Use appropriate font in notes and ERT insets in section headings + (bug 2477). * DOCUMENTATION AND LOCALIZATION