]> git.lyx.org Git - features.git/blobdiff - src/frontends/qt4/GuiLog.cpp
Some comments wrt log file encoding (#10728)
[features.git] / src / frontends / qt4 / GuiLog.cpp
index dec7c25c7e38378ded520686de7b083697fdf90e..1f4bb459378dd82d5268fa8f39719489d06e9967 100644 (file)
@@ -23,6 +23,7 @@
 #include "support/docstring.h"
 #include "support/FileName.h"
 #include "support/gettext.h"
+#include "support/lstrings.h"
 
 #include <QDesktopServices>
 #include <QTextBrowser>
@@ -133,10 +134,7 @@ GuiLog::GuiLog(GuiView & lv)
        highlighter = new LogHighlighter(logTB->document());
 
        logTB->setReadOnly(true);
-       QFont font(guiApp->typewriterFontName());
-       font.setFixedPitch(true);
-       font.setStyleHint(QFont::TypeWriter);
-       logTB->setFont(font);
+       logTB->setFont(guiApp->typewriterSystemFont());
 }
 
 
@@ -239,16 +237,20 @@ bool GuiLog::initialiseParams(string const & data)
 
        logTypeCO->setEnabled(logtype == "latex");
        logTypeCO->clear();
-       
+
        FileName log(logfile);
-       
+
        if (logtype == "latex") {
                type_ = LatexLog;
                logTypeCO->addItem(qt_("LaTeX"), toqstr(logtype));
                FileName tmp = log;
                tmp.changeExtension("blg");
-               if (tmp.exists())
-                       logTypeCO->addItem(qt_("BibTeX"), QString("bibtex"));
+               if (tmp.exists()) {
+                       if (support::contains(tmp.fileContents("UTF-8"), from_ascii("This is Biber")))
+                               logTypeCO->addItem(qt_("Biber"), QString("bibtex"));
+                       else
+                               logTypeCO->addItem(qt_("BibTeX"), QString("bibtex"));
+               }
                tmp.changeExtension("ilg");
                if (tmp.exists())
                        logTypeCO->addItem(qt_("Index"), QString("index"));
@@ -305,6 +307,8 @@ void GuiLog::getContents(ostream & ss) const
        // FIXME UNICODE
        // Our caller interprets the file contents as UTF8, but is that
        // correct?
+       // spitz: No it isn't (generally). The log file encoding depends on the TeX
+       // _output_ encoding (T1 etc.). We should account for that. See #10728.
        if (in) {
                ss << in.rdbuf();
                success = ss.good();