On Thu, Sep 19, 2002 at 11:18:29AM +0200, Andre Poenitz wrote:
> Just use LFUN_MATH_INSERT \mathbf here and drop the new LFUNs and I'd say
> it is ok until 1.4...
> 
> Andre'

Done. 

I did some extra clean-up in lyxfunc.C, as lines 634-663 appear to be
unnecessary now... math and non-math are handled identically for the LFUNs. 
Please confirm this is OK.

Another thing: I ran into a bug in math_fontinset. If you have two
fontinsets inside each other, only the outer one calls validate. 

This will lead e.g. to a LaTeX processing error if you place a mathfrak
fontinset inside a mathbf, because amssymb doesn't get required then. I
found out when setting up "noun" validation... somebody look into this
please.

Martin

BTW Where are lyxposspace, lyxnegspace getting defined? 


Index: lib/symbols
===================================================================
RCS file: /cvs/lyx/lyx-devel/lib/symbols,v
retrieving revision 1.27
diff -u -p -r1.27 symbols
--- lib/symbols 2002/08/30 08:42:59     1.27
+++ lib/symbols 2002/09/19 12:52:17
@@ -55,6 +55,7 @@ mathsf            font        mathmode
 mathtt            font        mathmode
 text              font        textmode
 textbf            font        textmode
+textsf            font        textmode
 textipa           font        textmode
 textit            font        textmode
 textmd            font        textmode
@@ -62,6 +63,8 @@ textrm            font        textmode
 textsl            font        textmode
 texttt            font        textmode
 textup            font        textmode
+emph              font        textmode
+noun              font        textmode
 
 # old-style font commands
 bf                oldfont     none
Index: src/lyxfunc.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/lyxfunc.C,v
retrieving revision 1.379
diff -u -p -r1.379 lyxfunc.C
--- src/lyxfunc.C       2002/09/16 12:52:57     1.379
+++ src/lyxfunc.C       2002/09/19 12:52:18
@@ -605,7 +605,9 @@ FuncStatus LyXFunc::getStatus(FuncReques
        }
 
        // the font related toggles
+#if 0
        if (!mathcursor) {
+#endif
                LyXFont const & font = TEXT(false)->real_current_font;
                switch (ev.action) {
                case LFUN_EMPH:
@@ -629,6 +631,7 @@ FuncStatus LyXFunc::getStatus(FuncReques
                default:
                        break;
                }
+#if 0
        } else {
                string tc = mathcursor->getLastCode();
                switch (ev.action) {
@@ -657,7 +660,8 @@ FuncStatus LyXFunc::getStatus(FuncReques
                        break;
                }
        }
-
+#endif
+       
        // this one is difficult to get right. As a half-baked
        // solution, we consider only the first action of the sequence
        if (ev.action == LFUN_SEQUENCE) {
Index: src/mathed/formulabase.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/mathed/formulabase.C,v
retrieving revision 1.211
diff -u -p -r1.211 formulabase.C
--- src/mathed/formulabase.C    2002/09/11 14:48:19     1.211
+++ src/mathed/formulabase.C    2002/09/19 12:52:18
@@ -585,12 +585,12 @@ Inset::RESULT InsetFormulaBase::localDis
        case LFUN_GREEK_TOGGLE: handleFont(bv, cmd.argument, "lyxgreek"); break;
        case LFUN_BOLD:         handleFont(bv, cmd.argument, "textbf"); break;
        case LFUN_SANS:         handleFont(bv, cmd.argument, "textsf"); break;
-       case LFUN_EMPH:         handleFont(bv, cmd.argument, "mathcal"); break;
+       case LFUN_EMPH:         handleFont(bv, cmd.argument, "emph"); break;
        case LFUN_ROMAN:        handleFont(bv, cmd.argument, "mathrm"); break;
        case LFUN_CODE:         handleFont(bv, cmd.argument, "texttt"); break;
        case LFUN_FRAK:         handleFont(bv, cmd.argument, "mathfrak"); break;
-       case LFUN_ITAL:         handleFont(bv, cmd.argument, "mathit"); break;
-       case LFUN_NOUN:         handleFont(bv, cmd.argument, "mathbb"); break;
+       case LFUN_ITAL:         handleFont(bv, cmd.argument, "textit"); break;
+       case LFUN_NOUN:         handleFont(bv, cmd.argument, "noun"); break;
        case LFUN_DEFAULT:      handleFont(bv, cmd.argument, "textnormal"); break;
        case LFUN_FREE:         handleFont(bv, cmd.argument, "textrm"); break;
 
Index: src/mathed/math_fontinset.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/mathed/math_fontinset.C,v
retrieving revision 1.15
diff -u -p -r1.15 math_fontinset.C
--- src/mathed/math_fontinset.C 2002/08/13 18:21:44     1.15
+++ src/mathed/math_fontinset.C 2002/09/19 12:52:19
@@ -76,6 +75,9 @@ void MathFontInset::validate(LaTeXFeatur
        // Fraktur used:
        if (key_->name == "mathfrak" || key_->name == "mathbb")
                features.require("amssymb");
+       // MV BUG: this fails if embedded in other (font-)inset. Why?
+       //if (key_->name == "noun") features.require("noun");
+       features.require("noun");
 }
 
 
Index: src/frontends/xforms/FormMathsStyle.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/frontends/xforms/FormMathsStyle.C,v
retrieving revision 1.12
diff -u -p -r1.12 FormMathsStyle.C
--- src/frontends/xforms/FormMathsStyle.C       2002/09/05 15:14:22     1.12
+++ src/frontends/xforms/FormMathsStyle.C       2002/09/19 12:52:19
@@ -33,17 +33,22 @@ char const * latex_mathstyle[] = {
        "displaystyle", "textstyle", "scriptstyle", "scriptscriptstyle"
 };
 
+#if 0
 kb_action latex_mathfontcmds[] = {
        LFUN_BOLD, LFUN_SANS, LFUN_ROMAN, LFUN_ITAL, LFUN_CODE,
        LFUN_NOUN, LFUN_FRAK, LFUN_EMPH, LFUN_FREE, LFUN_DEFAULT
 };
+#endif
 
-
+char const * latex_mathfonts[] = {
+       "mathbf", "mathsf", "mathrm", "mathit", "mathtt", 
+       "mathbb", "mathfrak", "mathcal", "textrm", "mathnormal"
+};
 
 FormMathsStyle::FormMathsStyle(LyXView & lv, Dialogs & d,
                               FormMathsPanel const & p)
        : FormMathsSub(lv, d, p, _("Maths Styles & Fonts"), false),
-         style_(-1)
+       style_(-1)
 {}
 
 
@@ -88,7 +93,7 @@ void FormMathsStyle::apply()
        if ((style_ >= 0) && (style_ < 4))
                parent_.insertSymbol(latex_mathstyle[style_]);
        else if ((style_ >= 4) && (style_ < 14))
-               parent_.dispatchFunc(latex_mathfontcmds[style_ - 4]);
+               parent_.insertSymbol(latex_mathfonts[style_ - 4]);
 }
 
 

Attachment: msg44969/pgp00000.pgp
Description: PGP signature

Reply via email to