]> git.lyx.org Git - lyx.git/blobdiff - src/LaTeXFonts.cpp
Fix scale parameter for fonts.
[lyx.git] / src / LaTeXFonts.cpp
index 169497542245ce890e98f7048b5f5c3bdb73b2e8..9010615fcb4c19bf0307ef12e5c2795b46e0202b 100644 (file)
@@ -110,6 +110,19 @@ bool LaTeXFont::providesSC(bool ot1, bool complete, bool nomath)
 }
 
 
+bool LaTeXFont::hasMonolithicExpertSet(bool ot1, bool complete, bool nomath)
+{
+       docstring const usedfont = getUsedFont(ot1, complete, nomath);
+
+       if (usedfont.empty())
+               return false;
+       else if (usedfont != name_)
+               return altFont(usedfont).hasMonolithicExpertSet(ot1, complete, nomath);
+       return (!osfoption_.empty() && !scoption_.empty() && osfoption_ == scoption_)
+               || (osfoption_.empty() && scoption_.empty() && !osfscoption_.empty());
+}
+
+
 bool LaTeXFont::providesScale(bool ot1, bool complete, bool nomath)
 {
        docstring const usedfont = getUsedFont(ot1, complete, nomath);
@@ -180,6 +193,15 @@ docstring const LaTeXFont::getUsedFont(bool ot1, bool complete, bool nomath)
 }
 
 
+docstring const LaTeXFont::getUsedPackage(bool ot1, bool complete, bool nomath)
+{
+       docstring const usedfont = getUsedFont(ot1, complete, nomath);
+       if (usedfont.empty())
+               return docstring();
+       return theLaTeXFonts().getLaTeXFont(usedfont).package();
+}
+
+
 string const LaTeXFont::getAvailablePackage(bool dryrun)
 {
        if (package_.empty())
@@ -237,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();
 }