#include "support/convert.h"
#include "support/debug.h"
+#include "support/docstream.h"
#include "support/FileName.h"
#include "support/filetools.h"
#include "support/gettext.h"
os << altFont(osffont_).getLaTeXCode(dryrun, ot1, complete, sc, osf, nomath, scale);
if (!preamble_.empty())
- os << preamble_;
+ os << to_utf8(preamble_);
return os.str();
}
+bool LaTeXFont::hasFontenc(string const & name) const
+{
+ for (auto const & fe : fontenc_) {
+ if (fe == name)
+ return true;
+ }
+ return false;
+}
+
+
bool LaTeXFont::readFont(Lexer & lex)
{
enum LaTeXFontTags {
LF_COMPLETE_FONT,
LF_END,
LF_FAMILY,
+ LF_FONTENC,
LF_GUINAME,
LF_NOMATHFONT,
LF_OSFDEFAULT,
{ "completefont", LF_COMPLETE_FONT },
{ "endfont", LF_END },
{ "family", LF_FAMILY },
+ { "fontencoding", LF_FONTENC },
{ "guiname", LF_GUINAME },
{ "nomathfont", LF_NOMATHFONT },
{ "osfdefault", LF_OSFDEFAULT },
error = true;
continue;
- default:
+ default:
break;
}
switch (static_cast<LaTeXFontTags>(le)) {
case LF_GUINAME:
lex >> guiname_;
break;
+ case LF_FONTENC: {
+ lex.eatLine();
+ string fe = lex.getString();
+ fontenc_ = getVectorFromString(fe);
+ break;
+ }
case LF_NOMATHFONT:
lex >> nomathfont_;
break;
lex >> packageoption_;
break;
case LF_PREAMBLE:
- preamble_ = lex.getLongString("EndPreamble");
+ preamble_ = lex.getLongString(from_ascii("EndPreamble"));
break;
case LF_PROVIDES: {
lex.eatLine();
return false;
}
+ if (fontenc_.empty())
+ fontenc_.push_back("T1");
+
return true;
}