Juergen Spitzmueller wrote:
> Now something different is needed to get the screen font changed. Replacing
> defaultfont() with params.getFont() does not change the screen font, even
> if everything else works.
>
> Ideas?

The following seems to work:

Index: src/text2.C
===================================================================
--- src/text2.C (Revision 14117)
+++ src/text2.C (Arbeitskopie)
@@ -173,10 +173,18 @@ LyXFont LyXText::getFont(Paragraph const
                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;
+               if (layout->labeltype == LABEL_MANUAL && pos < body_pos) {
+                       lf = layout->labelfont;
+                       f.realize(layout->reslabelfont);
+               } else {
+                       lf = layout->font;
+                       f.realize(layout->resfont);
+               }
+               // In case the default family has been customized
+               if (lf.family() == LyXFont::INHERIT_FAMILY)
+                       f.setFamily(params.getFont().family());
+               return f;
        }

        // The uncommon case need not be optimized as much
@@ -189,6 +197,10 @@ LyXFont LyXText::getFont(Paragraph const
        LyXFont font = par.getFontSettings(params, pos);
        font.realize(layoutfont);

+       // In case the default family has been customized
+       if (layoutfont.family() == LyXFont::INHERIT_FAMILY)
+               font.setFamily(params.getFont().family());
+
        if (!isMainText())
                applyOuterFont(font);

except for labels (emumerate, sections etc.).

Jürgen

Reply via email to