Op 26-6-2012 0:46, Uwe Stöhr schreef:
The branch, master, has been updated.

- Log -----------------------------------------------------------------

commit 2e8ed3b3b5b8edefc0dc2a888ac0fa314f87618e
Author: Uwe Stöhr <[email protected]>
Date:   Tue Jun 26 00:46:02 2012 +0200

     tex2lyx: support fontspec scale option

@@ -1186,16 +1187,30 @@ void Preamble::parse(Parser & p, string
+               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 fontopts is "Mapping=tex-text,Scale=0.75", then i < pos, which is probably 
not what you want.

Vincent



Reply via email to