}
+// Note that this is supposed to return a fully realized font.
FontInfo Text::layoutFont(Buffer const & buffer, pit_type const pit) const
{
Layout const & layout = pars_[pit].layout();
// 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;
+ // FIXME
+ // It ought to be possible here just to use Inset::getLayout() and skip
+ // the asInsetCollapsable() bit. Unfortunatley, that doesn't work right
+ // now, because Inset::getLayout() will return a default-constructed
+ // InsetLayout, and that e.g. sets the foreground color to red. So we
+ // need to do some work to make that possible.
+ InsetCollapsable const * icp = pars_[pit].inInset().asInsetCollapsable();
+ if (!icp)
+ return lf;
+ FontInfo icf = icp->getLayout().font();
+ icf.realize(lf);
+ return icf;
}
FontInfo font = layout.font;
}
+// Note that this is supposed to return a fully realized font.
FontInfo Text::labelFont(Buffer const & buffer, Paragraph const & par) const
{
Layout const & layout = par.layout();
// 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;
+ // FIXME As above....
+ InsetCollapsable const * icp = par.inInset().asInsetCollapsable();
+ if (!icp)
+ return lf;
+ FontInfo icf = icp->getLayout().labelfont();
+ icf.realize(lf);
+ return icf;
}
FontInfo font = layout.labelfont;