>>>>> "Asger" == Asger Alstrup Nielsen <[EMAIL PROTECTED]> writes:

Asger> Shouldn't be too difficult to fix.  Have a look at lyxfont.C
Asger> and the "latexFontStart" (or something) method.  In that,
Asger> compare the given font with the running font, and if the only
Asger> LaTeX font mode has changed, ignore the request to change font:
Asger> We already have the correct font.  Do the same for the
Asger> "latexFontEnd" method.

A follow up on my previous message. 

OK, I see what the problem is now. I think the solution is to add a
LyXFont::equalExceptLatex(LyXFont const &) method that compares font
without Latex setting. I'll do that.

IMO this is yet another reason why LaTeX mode should be kept out of
font settings. They really don't belong there and should be kept as
paragraph properties.

BTW, it would be nice to have more intelligent font switching when
several fonts are involved, like in
  \textsf{bla bla \emph{foo} bar}
which currently gives
  \textsf{bla bla} \textsf{\emph{foo}} \textsf{bar}

This would fix some problems with italic correction, which is broken
in some cases.

However, this does not seem very easy to obtain, since we would need
to maintain a stack of font changes, and probably analyse the whole
paragraph font switches first to determine a good font order. Although
we will maybe not do it soon, it should be kept in mind for the design
of the Latex writer...

JMarc

Reply via email to