Le 02/11/2021 à 15:52, Jürgen Spitzmüller a écrit :
With inheritFont() == false, we end up in unnecessary font switches at
footnote start, e.g. \footnote{\normalsize text ...} in section
headings (see Scott's example), and I want to avoid that.
Agreed. However it seems that the code
1/ looks at the outside font, sees that it is \normalsize
2/ look at footnote font and sees that it is \footnotesize
3/ decides to override the font size to do as if a footnote should
plainly inherit the outside font.
There is _no_ reason in my opinion why the font outside the inset should
be considered at all when inheritFont() is false. It is however
difficult to follow the code in Paragraph::latex:
// 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;
I think I know at some time what local_font was, but I forgot. I see
that it is set in dozens of places in the code (which murmurs "fragile
code" in my ear), but I am not sure why. AFAICS, this is more a language
thing than a font thing (but I am even not sure of this).
OK, there is a comment about this variable:
/** the font at the point where the inset is
*/
Font const * local_font = nullptr;
If the comment is correct, then the code is wrong IMO.
JMarc
--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel