From 6a5aa1cab18fb5c7e71c798771e6230d539a509a Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Fri, 11 Jul 2014 16:12:08 +0200 Subject: [PATCH] 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). --- src/LaTeXFonts.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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(); } -- 2.39.2