]> git.lyx.org Git - lyx.git/blob - src/tex2lyx/lyxfont.C
* support/qstring_helpers.h: erase ucs4_to_qstring() method.
[lyx.git] / src / tex2lyx / lyxfont.C
1 /**
2  * \file tex2lyx/lyxfont.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Angus Leeming
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "lyxfont.h"
14 #include "lyxlex.h"
15 #include "support/lstrings.h"
16
17
18 namespace lyx {
19
20 using lyx::support::ascii_lowercase;
21
22 using std::string;
23
24
25 LyXFont & LyXFont::lyxRead(LyXLex & lex)
26 {
27         bool error = false;
28         bool finished = false;
29         while (!finished && lex.isOK() && !error) {
30                 lex.next();
31                 string const tok = ascii_lowercase(lex.getString());
32
33                 if (tok.empty()) {
34                         continue;
35                 } else if (tok == "endfont") {
36                         finished = true;
37                 } else if (tok == "family") {
38                         lex.next();
39                 } else if (tok == "series") {
40                         lex.next();
41                 } else if (tok == "shape") {
42                         lex.next();
43                 } else if (tok == "size") {
44                         lex.next();
45                 } else if (tok == "misc") {
46                         lex.next();
47                 } else if (tok == "color") {
48                         lex.next();
49                 } else {
50                         lex.printError("Unknown tag `$$Token'");
51                         error = true;
52                 }
53         }
54         return *this;
55 }
56
57
58 } // namespace lyx