2003-07-26 00:17:21 +00:00
|
|
|
/**
|
2003-10-08 11:31:51 +00:00
|
|
|
* \file tex2lyx/lyxfont.C
|
2003-08-19 10:04:35 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2003-07-26 00:17:21 +00:00
|
|
|
*
|
2003-08-19 10:04:35 +00:00
|
|
|
* \author Angus Leeming
|
2003-07-26 00:17:21 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2003-07-26 00:17:21 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#include "lyxfont.h"
|
|
|
|
#include "lyxlex.h"
|
|
|
|
#include "support/lstrings.h"
|
|
|
|
|
2003-09-09 22:13:45 +00:00
|
|
|
using lyx::support::ascii_lowercase;
|
2003-07-26 00:17:21 +00:00
|
|
|
|
2003-10-06 15:43:21 +00:00
|
|
|
using std::string;
|
|
|
|
|
2003-07-26 00:17:21 +00:00
|
|
|
|
|
|
|
LyXFont & LyXFont::lyxRead(LyXLex & lex)
|
|
|
|
{
|
|
|
|
bool error = false;
|
|
|
|
bool finished = false;
|
|
|
|
while (!finished && lex.isOK() && !error) {
|
|
|
|
lex.next();
|
|
|
|
string const tok = ascii_lowercase(lex.getString());
|
|
|
|
|
|
|
|
if (tok.empty()) {
|
|
|
|
continue;
|
|
|
|
} else if (tok == "endfont") {
|
|
|
|
finished = true;
|
|
|
|
} else if (tok == "family") {
|
|
|
|
lex.next();
|
|
|
|
} else if (tok == "series") {
|
|
|
|
lex.next();
|
|
|
|
} else if (tok == "shape") {
|
|
|
|
lex.next();
|
|
|
|
} else if (tok == "size") {
|
|
|
|
lex.next();
|
|
|
|
} else if (tok == "misc") {
|
|
|
|
lex.next();
|
|
|
|
} else if (tok == "color") {
|
|
|
|
lex.next();
|
|
|
|
} else {
|
|
|
|
lex.printError("Unknown tag `$$Token'");
|
|
|
|
error = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return *this;
|
|
|
|
}
|