LyXFont f = par.getFontSettings(params, pos);
if (!isMainText())
applyOuterFont(f);
- if (layout->labeltype == LABEL_MANUAL && pos < body_pos)
- return f.realize(layout->reslabelfont);
- else
- return f.realize(layout->resfont);
+ LyXFont lf;
+ LyXFont rlf;
+ if (layout->labeltype == LABEL_MANUAL && pos < body_pos) {
+ lf = layout->labelfont;
+ rlf = layout->reslabelfont;
+ } else {
+ lf = layout->font;
+ rlf = layout->resfont;
+ }
+ // In case the default family has been customized
+ if (lf.family() == LyXFont::INHERIT_FAMILY)
+ rlf.setFamily(params.getFont().family());
+ return f.realize(rlf);
}
// The uncommon case need not be optimized as much
break;
}
// Realize against environment font information
- if (pit < pars_.size())
+ // NOTE: the cast to pit_type should be removed when pit_type
+ // changes to a unsigned integer.
+ if (pit < pit_type(pars_.size()))
font.realize(outerFont(pit, pars_));
// Realize with the fonts of lesser depth.
{
LyXLayout_ptr const & layout = pars_[pit].layout();
- if (!pars_[pit].getDepth())
- return layout->resfont;
+ if (!pars_[pit].getDepth()) {
+ LyXFont lf = layout->resfont;
+ // In case the default family has been customized
+ if (layout->font.family() == LyXFont::INHERIT_FAMILY)
+ lf.setFamily(bv()->buffer()->params().getFont().family());
+ return lf;
+ }
LyXFont font = layout->font;
// Realize with the fonts of lesser depth.
{
LyXLayout_ptr const & layout = par.layout();
- if (!par.getDepth())
- return layout->reslabelfont;
+ if (!par.getDepth()) {
+ LyXFont lf = layout->reslabelfont;
+ // In case the default family has been customized
+ if (layout->labelfont.family() == LyXFont::INHERIT_FAMILY)
+ lf.setFamily(bv()->buffer()->params().getFont().family());
+ return lf;
+ }
LyXFont font = layout->labelfont;
// Realize with the fonts of lesser depth.