- if (!isMainText())
- applyOuterFont(f);
- if (layout->labeltype == LABEL_MANUAL && pos < body_pos)
- return f.realize(layout->reslabelfont);
- else
- return f.realize(layout->resfont);
+ if (!isMainText(buffer))
+ applyOuterFont(buffer, f);
+ 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);