From: Enrico Forestieri Date: Fri, 11 Jul 2014 14:12:08 +0000 (+0200) Subject: Fix scale parameter for fonts. X-Git-Tag: 2.2.0alpha1~1774 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=6a5aa1ca;p=features.git 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). --- diff --git a/src/LaTeXFonts.cpp b/src/LaTeXFonts.cpp index 676179f5a5..9010615fcb 100644 --- a/src/LaTeXFonts.cpp +++ b/src/LaTeXFonts.cpp @@ -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(float(scale) / 100)); + ostringstream value; + value << float(scale) / 100; + os << subst(to_ascii(scaleoption_), "$$val", value.str()); } return os.str(); }