- the first patch bformats math's infoize messages (fixes bug #1908)
- the second one add tex2lyx support for all libertine font variants

OK for LyX 2.1.3?

regards Uwe
 src/mathed/InsetMathBox.cpp        | 6 +++++-
 src/mathed/InsetMathColor.cpp      | 6 +++++-
 src/mathed/InsetMathDecoration.cpp | 6 +++++-
 src/mathed/InsetMathEnv.cpp        | 6 +++++-
 src/mathed/InsetMathFont.cpp       | 6 +++++-
 src/mathed/InsetMathFontOld.cpp    | 6 +++++-
 src/mathed/InsetMathHull.cpp       | 2 +-
 src/mathed/InsetMathSize.cpp       | 5 ++++-
 src/mathed/MathMacro.cpp           | 7 ++++---
 src/mathed/MathMacroTemplate.cpp   | 2 +-
 10 files changed, 40 insertions(+), 12 deletions(-)

diff --git a/src/mathed/InsetMathBox.cpp b/src/mathed/InsetMathBox.cpp
index 8b3cb2b..509977b 100644
--- a/src/mathed/InsetMathBox.cpp
+++ b/src/mathed/InsetMathBox.cpp
@@ -19,10 +19,14 @@
 #include "MathSupport.h"
 #include "MetricsInfo.h"
 
+#include "support/gettext.h"
+#include "support/lstrings.h"
+
 #include "frontends/Painter.h"
 
 #include <ostream>
 
+using namespace lyx::support;
 
 namespace lyx {
 
@@ -92,7 +96,7 @@ void InsetMathBox::draw(PainterInfo & pi, int x, int y) const
 
 void InsetMathBox::infoize(odocstream & os) const
 {      
-       os << "Box: " << name_;
+       os << bformat(_("Box: %1$s"), name_);
 }
 
 
diff --git a/src/mathed/InsetMathColor.cpp b/src/mathed/InsetMathColor.cpp
index 7d00562..9023b74 100644
--- a/src/mathed/InsetMathColor.cpp
+++ b/src/mathed/InsetMathColor.cpp
@@ -19,8 +19,12 @@
 #include "MathSupport.h"
 #include "MetricsInfo.h"
 
+#include "support/gettext.h"
+#include "support/lstrings.h"
+
 #include <ostream>
 
+using namespace lyx::support;
 
 namespace lyx {
 
@@ -95,7 +99,7 @@ void InsetMathColor::normalize(NormalStream & os) const
 
 void InsetMathColor::infoize(odocstream & os) const
 {
-       os << "Color: " << color_;
+       os << bformat(_("Color: %1$s"), color_);
 }
 
 
diff --git a/src/mathed/InsetMathDecoration.cpp 
b/src/mathed/InsetMathDecoration.cpp
index b9202f5..d3c23f6 100644
--- a/src/mathed/InsetMathDecoration.cpp
+++ b/src/mathed/InsetMathDecoration.cpp
@@ -23,10 +23,14 @@
 
 #include "support/debug.h"
 #include "support/docstring.h"
+#include "support/gettext.h"
 #include "support/lassert.h"
+#include "support/lstrings.h"
 
 #include <ostream>
 
+using namespace lyx::support;
+
 using namespace std;
 
 namespace lyx {
@@ -165,7 +169,7 @@ void InsetMathDecoration::normalize(NormalStream & os) const
 
 void InsetMathDecoration::infoize(odocstream & os) const
 {
-       os << "Deco: " << key_->name;
+       os << bformat(_("Decoration: %1$s"), key_->name);
 }
 
 
diff --git a/src/mathed/InsetMathEnv.cpp b/src/mathed/InsetMathEnv.cpp
index a7fb33c..cc613fd 100644
--- a/src/mathed/InsetMathEnv.cpp
+++ b/src/mathed/InsetMathEnv.cpp
@@ -16,8 +16,12 @@
 #include "MathStream.h"
 #include "MathStream.h"
 
+#include "support/gettext.h"
+#include "support/lstrings.h"
+
 #include <ostream>
 
+using namespace lyx::support;
 
 namespace lyx {
 
@@ -61,7 +65,7 @@ void InsetMathEnv::normalize(NormalStream & os) const
 
 void InsetMathEnv::infoize(odocstream & os) const
 {
-       os << "Env: " << name_;
+       os << bformat(_("Environment: %1$s"), name_);
 }
 
 
diff --git a/src/mathed/InsetMathFont.cpp b/src/mathed/InsetMathFont.cpp
index b2e7c1d..b499858 100644
--- a/src/mathed/InsetMathFont.cpp
+++ b/src/mathed/InsetMathFont.cpp
@@ -18,8 +18,12 @@
 #include "MathParser.h"
 #include "MetricsInfo.h"
 
+#include "support/gettext.h"
+#include "support/lstrings.h"
+
 #include <ostream>
 
+using namespace lyx::support;
 
 namespace lyx {
 
@@ -200,7 +204,7 @@ void InsetMathFont::mathmlize(MathStream & os) const
 
 void InsetMathFont::infoize(odocstream & os) const
 {
-       os << "Font: " << key_->name;
+       os << bformat(_("Font: %1$s"), key_->name);
 }
 
 
diff --git a/src/mathed/InsetMathFontOld.cpp b/src/mathed/InsetMathFontOld.cpp
index c14c4e3..013808d 100644
--- a/src/mathed/InsetMathFontOld.cpp
+++ b/src/mathed/InsetMathFontOld.cpp
@@ -18,8 +18,12 @@
 #include "MathSupport.h"
 #include "MetricsInfo.h"
 
+#include "support/gettext.h"
+#include "support/lstrings.h"
+
 #include <ostream>
 
+using namespace lyx::support;
 
 namespace lyx {
 
@@ -96,7 +100,7 @@ void InsetMathFontOld::normalize(NormalStream & os) const
 
 void InsetMathFontOld::infoize(odocstream & os) const
 {
-       os << "Font: " << key_->name;
+       os << bformat(_("Font: %1$s"), key_->name);
 }
 
 
diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp
index 20787e2..9bef7fe 100644
--- a/src/mathed/InsetMathHull.cpp
+++ b/src/mathed/InsetMathHull.cpp
@@ -1295,7 +1295,7 @@ void InsetMathHull::normalize(NormalStream & os) const
 
 void InsetMathHull::infoize(odocstream & os) const
 {
-       os << "Type: " << hullName(type_);
+       os << bformat(_("Type: %1$s"), hullName(type_));
 }
 
 
diff --git a/src/mathed/InsetMathSize.cpp b/src/mathed/InsetMathSize.cpp
index a638f43..dc79652 100644
--- a/src/mathed/InsetMathSize.cpp
+++ b/src/mathed/InsetMathSize.cpp
@@ -19,10 +19,13 @@
 #include "output_xhtml.h"
 
 #include "support/convert.h"
+#include "support/gettext.h"
+#include "support/lstrings.h"
 
 #include <string>
 #include <ostream>
 
+using namespace lyx::support;
 using namespace std;
 
 namespace lyx {
@@ -101,7 +104,7 @@ void InsetMathSize::normalize(NormalStream & os) const
 
 void InsetMathSize::infoize(odocstream & os) const
 {
-       os << "Size: " << key_->name;
+       os << bformat(_("Size: %1$s"), key_->name);
 }
 
 
diff --git a/src/mathed/MathMacro.cpp b/src/mathed/MathMacro.cpp
index 870f8f2..941e29a 100644
--- a/src/mathed/MathMacro.cpp
+++ b/src/mathed/MathMacro.cpp
@@ -36,11 +36,13 @@
 #include "support/debug.h"
 #include "support/gettext.h"
 #include "support/lassert.h"
+#include "support/lstrings.h"
 #include "support/textutils.h"
 
 #include <ostream>
 #include <vector>
 
+using namespace lyx::support;
 using namespace std;
 
 namespace lyx {
@@ -813,14 +815,13 @@ void MathMacro::octave(OctaveStream & os) const
 
 void MathMacro::infoize(odocstream & os) const
 {
-       os << "Macro: " << name();
+       os << bformat(_("Macro: %1$s"), name());
 }
 
 
 void MathMacro::infoize2(odocstream & os) const
 {
-       os << "Macro: " << name();
-
+       os << bformat(_("Macro: %1$s"), name());
 }
 
 
diff --git a/src/mathed/MathMacroTemplate.cpp b/src/mathed/MathMacroTemplate.cpp
index 53cec03..606ac2c 100644
--- a/src/mathed/MathMacroTemplate.cpp
+++ b/src/mathed/MathMacroTemplate.cpp
@@ -1361,7 +1361,7 @@ size_t MathMacroTemplate::numOptionals() const
 
 void MathMacroTemplate::infoize(odocstream & os) const
 {
-       os << "Math Macro: \\" << name();
+       os << bformat(_("Math Macro: \\%1$s"), name());
 }
 
 
 src/tex2lyx/Preamble.cpp | 19 ++++++++++++++-----
 src/tex2lyx/TODO.txt     |  7 -------
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp
index f138348..526940a 100644
--- a/src/tex2lyx/Preamble.cpp
+++ b/src/tex2lyx/Preamble.cpp
@@ -137,8 +137,8 @@ const char * const known_kurier_fonts[] = { "kurier", 
"kurierl",
 "kurier-condensed", "kurier-light-condensed", 0};
 
 const char * const known_typewriter_fonts[] = { "beramono", "cmtl", "cmtt",
-"courier", "lmtt", "luximono", "fourier", "lmodern", "mathpazo", "mathptmx",
-"newcent", "tgcursor", "txtt", 0};
+"courier", "lmtt", "luximono", "fourier", "libertineMono-type1", "lmodern",
+"mathpazo", "mathptmx", "newcent", "tgcursor", "txtt", 0};
 
 const char * const known_math_fonts[] = { "eulervm", "newtxmath", 0};
 
@@ -727,14 +727,19 @@ void Preamble::handle_package(Parser &p, string const & 
name,
        // sansserif fonts
        if (is_known(name, known_sans_fonts)) {
                h_font_sans = name;
-               if (options.size() == 1) {
+               if (options.size() >= 1) {
                        if (scale_as_percentage(opts, h_font_sf_scale))
                                options.clear();
                }
        }
 
-       if (name == "biolinum-type1")
+       if (name == "biolinum-type1") {
                h_font_sans = "biolinum";
+               // biolinum can have several options, e.g. [osf,scaled=0.97]
+               string::size_type pos = opts.find("osf");
+               if (pos != string::npos)
+                       h_font_osf = "true";
+       }
 
        // typewriter fonts
        if (is_known(name, known_typewriter_fonts)) {
@@ -742,13 +747,17 @@ void Preamble::handle_package(Parser &p, string const & 
name,
                // fourier as typewriter is handled in handling of \ttdefault
                if (name != "fourier") {
                        h_font_typewriter = name;
-                       if (options.size() == 1) {
+                       if (options.size() >= 1) {
                                if (scale_as_percentage(opts, h_font_tt_scale))
                                        options.clear();
                        }
                }
        }
 
+       if (name == "libertineMono-type1") {
+               h_font_typewriter = "libertine-mono";
+       }
+
        // font uses old-style figure
        if (name == "eco")
                h_font_osf = "true";
diff --git a/src/tex2lyx/TODO.txt b/src/tex2lyx/TODO.txt
index 974dcce..61df01b 100644
--- a/src/tex2lyx/TODO.txt
+++ b/src/tex2lyx/TODO.txt
@@ -80,13 +80,6 @@ Format LaTeX feature                        LyX feature
 459    beamer: \begin{frame},               \begin_layout Frame
        \begin{frame}[plain],                \begin_layout PlainFrame
        \begin{frame}[fragile]               \begin_layout FragileFrame
-462    New libertine LaTeX fonts:
-       \usepackage[scale|scaled|ttscale=$val]{libertineMono-type1}
-                                            \font_typewriter
-                                            \font_tt_scale
-       \usepackage[scale|scaled=$val]{biolinum-type1}
-                                            \font_sans
-                                            \font_sf_scale
 466   Powerdot updates:                     
       \pause[]                              layout Pause
       \onslide{}{}                          InsetFlex, InsetArgument

Reply via email to