]> git.lyx.org Git - lyx.git/blob - src/tex2lyx/Font.cpp
rename LyXFont to Font except in tex2lyx
[lyx.git] / src / tex2lyx / Font.cpp
1 /**
2  * \file tex2lyx/Font.cpp
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 "Font.h"
14 #include "Lexer.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 Font & Font::lyxRead(Lexer & 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