]> git.lyx.org Git - lyx.git/blob - src/tex2lyx/Font.cpp
Get rid of the boost::shared_ptr's in TextClass.{h,cpp}. It's not clear what these...
[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 using namespace std;
18
19 namespace lyx {
20
21 using lyx::support::ascii_lowercase;
22
23 /// Sane font.
24 FontInfo const sane_font;
25 /// All inherit font.
26 FontInfo const inherit_font;
27 /// All ignore font.
28 FontInfo const ignore_font;
29
30 FontInfo lyxRead(Lexer & lex, FontInfo const &)
31 {
32         bool error = false;
33         bool finished = false;
34         while (!finished && lex.isOK() && !error) {
35                 lex.next();
36                 string const tok = ascii_lowercase(lex.getString());
37
38                 if (tok.empty()) {
39                         continue;
40                 } else if (tok == "endfont") {
41                         finished = true;
42                 } else if (tok == "family") {
43                         lex.next();
44                 } else if (tok == "series") {
45                         lex.next();
46                 } else if (tok == "shape") {
47                         lex.next();
48                 } else if (tok == "size") {
49                         lex.next();
50                 } else if (tok == "misc") {
51                         lex.next();
52                 } else if (tok == "color") {
53                         lex.next();
54                 } else {
55                         lex.printError("Unknown tag `$$Token'");
56                         error = true;
57                 }
58         }
59         return FontInfo();
60 }
61
62
63 } // namespace lyx