]> git.lyx.org Git - features.git/commitdiff
iffont
authorDekel Tsur <dekelts@tau.ac.il>
Mon, 14 Oct 2002 20:19:32 +0000 (20:19 +0000)
committerDekel Tsur <dekelts@tau.ac.il>
Mon, 14 Oct 2002 20:19:32 +0000 (20:19 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5398 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/ChangeLog
src/mathed/math_factory.C

index 4a5066ccacc7831499e1bffd5eede73034574401..aa6cd637e49640546caaa4acd9d8c4e077b2ef19 100644 (file)
@@ -1,3 +1,6 @@
+2002-10-14  Dekel Tsur  <dekelts@tau.ac.il>
+
+       * math_factory.C (initSymbols): iffont.
 
 2002-10-14  André Pönitz <poenitz@gmx.net>
 
index ed156a2be477fb58ecbd1fe0fe332ee68a844c5a..b20512e2fc942d895fd0c31ae10f79622d3639d7 100644 (file)
@@ -94,13 +94,27 @@ void initSymbols()
 
        std::ifstream fs(filename.c_str());
        string line;
+       bool skip = false;
        while (std::getline(fs, line)) {
                int charid     = 0;
                int fallbackid = 0;
-               latexkeys tmp;
                if (line.size() > 0 && line[0] == '#')
                        continue;
 
+               // special case of \iffont / \fi
+               if (line.size() >= 7 && line.substr(0, 6) == "iffont") {
+                       istringstream is(line);
+                       string tmp;
+                       is >> tmp;
+                       is >> tmp;
+                       skip = !math_font_available(tmp);
+                       continue;
+               } else if (line.size() >= 3 && line.substr(0, 3) == "end") {
+                       skip = false;
+                       continue;
+               } else if (skip)
+                       continue;
+
                // special case of pre-defined macros
                if (line.size() > 8 && line.substr(0, 5) == "\\def\\") {
                        //lyxerr << "defining: '" << line << "'\n";
@@ -110,6 +124,7 @@ void initSymbols()
                }
 
                istringstream is(line);
+               latexkeys tmp;
                is >> tmp.name >> tmp.inset;
                if (isFontName(tmp.inset)) 
                        is >> charid >> fallbackid >> tmp.extra >> tmp.xmlname;