OK, progress. The attached patch seems to fix the bug.
Here's how to trigger it prior to the patch. Create a footnote. Type
"this footnote". Now put the cursor after the "s", type a space, type
Ctrl-E (emph), and now type some text. Check View>Source. You'll see this:
\footnote{this \textcolor{foreground}{\emph{\small this}} footnote}
The patch fixes it, and perhaps some other bugs, too. Probably something
similar needs to be done on the other branch here, but I don't
understand this very well.
rh
Index: src/Text2.cpp
===================================================================
--- src/Text2.cpp (revision 26146)
+++ src/Text2.cpp (working copy)
@@ -46,6 +46,8 @@
#include "TextMetrics.h"
#include "VSpace.h"
+#include "insets/InsetCollapsable.h"
+
#include "mathed/InsetMathHull.h"
#include "support/lassert.h"
@@ -81,6 +83,9 @@
// In case the default family has been customized
if (layout.font.family() == INHERIT_FAMILY)
lf.setFamily(buffer.params().getFont().fontInfo().family());
+ InsetCollapsable const * icp = pars_[pit].inInset()->asInsetCollapsable();
+ if (icp)
+ lf.update(icp->getLayout().font(), false);
return lf;
}
@@ -102,6 +107,9 @@
// In case the default family has been customized
if (layout.labelfont.family() == INHERIT_FAMILY)
lf.setFamily(buffer.params().getFont().fontInfo().family());
+ InsetCollapsable const * icp = par.inInset()->asInsetCollapsable();
+ if (icp)
+ lf.update(icp->getLayout().labelfont(), false);
return lf;
}