Fix scale parameter for fonts.

When a font is scaled by a certain percentage in the document settings,
LyX was outputting a ridiculous parameter value. For example, if the
font is scaled 90%, the corresponding parameter was "scaled=0.899999976".
The patch avoids this and, in the previous case, one gets "scaled=0.9".
This is not only cosmetic, because in roundtrip conversions the parameter
would be continuosly changing.

This commit and b60b505f should be backported to the 2.1.x branch, where
reimporting with tex2lyx an exported document produces wrong results
(also in version 2.1.0).
This commit is contained in:
Enrico Forestieri 2014-07-11 16:12:08 +02:00
parent b60b505fd8
commit 6a5aa1cab1

View File

@ -259,8 +259,9 @@ string const LaTeXFont::getPackageOptions(bool ot1, bool complete, bool sc, bool
&& providesScale(ot1, complete, nomath)) {
if (!os.str().empty())
os << ',';
os << subst(to_ascii(scaleoption_), "$$val",
convert<std::string>(float(scale) / 100));
ostringstream value;
value << float(scale) / 100;
os << subst(to_ascii(scaleoption_), "$$val", value.str());
}
return os.str();
}