char const * GUIFamilyNames[LyXFont::NUM_FAMILIES + 2 /* default & error */] =
{ N_("Roman"), N_("Sans serif"), N_("Typewriter"), N_("Symbol"),
- "cmr", "cmsy", "cmm", "cmex", "msa", "msb", "eufrak",
+ "cmr", "cmsy", "cmm", "cmex", "msa", "msb", "eufrak", "wasy",
N_("Inherit"), N_("Ignore") };
char const * GUISeriesNames[4] =
//
char const * LyXFamilyNames[LyXFont::NUM_FAMILIES + 2 /* default & error */] =
{ "roman", "sans", "typewriter", "symbol",
- "cmr", "cmsy", "cmm", "cmex", "msa", "msb", "eufrak",
+ "cmr", "cmsy", "cmm", "cmex", "msa", "msb", "eufrak", "wasy",
"default", "error" };
char const * LyXSeriesNames[4] =
IGNORE };
-bool LyXFont::FontBits::operator==(LyXFont::FontBits const & fb1) const
+bool operator==(LyXFont::FontBits const & lhs,
+ LyXFont::FontBits const & rhs)
{
- return fb1.family == family &&
- fb1.series == series &&
- fb1.shape == shape &&
- fb1.size == size &&
- fb1.color == color &&
- fb1.emph == emph &&
- fb1.underbar == underbar &&
- fb1.noun == noun &&
- fb1.number == number;
-}
-
-
-bool LyXFont::FontBits::operator!=(LyXFont::FontBits const & fb1) const
-{
- return !(fb1 == *this);
+ return lhs.family == rhs.family &&
+ lhs.series == rhs.series &&
+ lhs.shape == rhs.shape &&
+ lhs.size == rhs.size &&
+ lhs.color == rhs.color &&
+ lhs.emph == rhs.emph &&
+ lhs.underbar == rhs.underbar &&
+ lhs.noun == rhs.noun &&
+ lhs.number == rhs.number;
}
ost << _(" Number ") << _(GUIMiscNames[number()]);
string buf(ost.str().c_str());
- buf = strip(buf, ' ');
- buf = strip(buf, ',');
+ buf = rtrim(buf, ", ");
return buf;
}
// Set family according to lyx format string
LyXFont & LyXFont::setLyXFamily(string const & fam)
{
- string const s = lowercase(fam);
+ string const s = ascii_lowercase(fam);
int i = 0;
while (s != LyXFamilyNames[i] && LyXFamilyNames[i] != "error") ++i;
// Set series according to lyx format string
LyXFont & LyXFont::setLyXSeries(string const & ser)
{
- string const s = lowercase(ser);
+ string const s = ascii_lowercase(ser);
int i = 0;
while (s != LyXSeriesNames[i] && LyXSeriesNames[i] != "error") ++i;
// Set shape according to lyx format string
LyXFont & LyXFont::setLyXShape(string const & sha)
{
- string const s = lowercase(sha);
+ string const s = ascii_lowercase(sha);
int i = 0;
while (s != LyXShapeNames[i] && LyXShapeNames[i] != "error") ++i;
// Set size according to lyx format string
LyXFont & LyXFont::setLyXSize(string const & siz)
{
- string const s = lowercase(siz);
+ string const s = ascii_lowercase(siz);
int i = 0;
while (s != LyXSizeNames[i] && LyXSizeNames[i] != "error") ++i;
if (s == LyXSizeNames[i]) {
// Set size according to lyx format string
LyXFont::FONT_MISC_STATE LyXFont::setLyXMisc(string const & siz)
{
- string const s = lowercase(siz);
+ string const s = ascii_lowercase(siz);
int i = 0;
while (s != LyXMiscNames[i] && LyXMiscNames[i] != "error") ++i;
if (s == LyXMiscNames[i])
bool finished = false;
while (!finished && lex.isOK() && !error) {
lex.next();
- string const tok = lowercase(lex.getString());
+ string const tok = ascii_lowercase(lex.getString());
if (tok.empty()) {
continue;
setLyXSize(ttok);
} else if (tok == "misc") {
lex.next();
- string const ttok = lowercase(lex.getString());
+ string const ttok = ascii_lowercase(lex.getString());
if (ttok == "no_bar") {
setUnderbar(OFF);
int count = 0;
bool env = false;
- LyXFont f = *this; // why do you need this?
- f.reduce(base); // why isn't this just "reduce(base);" (Lgb)
- // Because this function is const. Everything breaks if this
- // method changes the font it represents. There is no speed penalty
- // by using the temporary. (Asger)
-
+ // reduce the current font to changes against the base
+ // font (of the layout). We use a temporary for this to
+ // avoid changing this font instance, as that would break
+ LyXFont f = *this;
+ f.reduce(base);
if (f.family() != INHERIT_FAMILY) {
os << '}';