- else if (t.cs() == "setsansfont") {
- // we don't care about the option
- p.hasOpt() ? p.getOpt() : string();
- h_font_sans = p.getArg('{', '}');
- }
-
- else if (t.cs() == "setmonofont") {
- // we don't care about the option
- p.hasOpt() ? p.getOpt() : string();
- h_font_typewriter = p.getArg('{', '}');
+ else if (t.cs() == "setsansfont" || t.cs() == "setmonofont") {
+ // LyX currently only supports the scale option
+ string scale;
+ if (p.hasOpt()) {
+ string fontopts = p.getArg('[', ']');
+ // check if the option contains a scaling, if yes, extract it
+ string::size_type pos = fontopts.find("Scale");
+ if (pos != string::npos) {
+ string::size_type i = fontopts.find(',');
+ if (i == string::npos)
+ scale = scale_as_percentage(fontopts.substr(pos + 1));
+ else
+ scale = scale_as_percentage(fontopts.substr(pos, i - pos));
+ }
+ }
+ if (t.cs() == "setsansfont") {
+ if (!scale.empty())
+ h_font_sf_scale = scale;
+ h_font_sans = p.getArg('{', '}');
+ } else {
+ if (!scale.empty())
+ h_font_tt_scale = scale;
+ h_font_typewriter = p.getArg('{', '}');
+ }