File indexing completed on 2024-04-28 15:14:04

0001 /***************************************************************************
0002     File                 : TeXRenderer.h
0003     Project              : LabPlot
0004     Description          : TeX renderer class
0005     --------------------------------------------------------------------
0006     Copyright            : (C) 2008-2016 by Alexander Semke (alexander.semke@web.de)
0007 
0008  ***************************************************************************/
0009 
0010 /***************************************************************************
0011  *                                                                         *
0012  *  This program is free software; you can redistribute it and/or modify   *
0013  *  it under the terms of the GNU General Public License as published by   *
0014  *  the Free Software Foundation; either version 2 of the License, or      *
0015  *  (at your option) any later version.                                    *
0016  *                                                                         *
0017  *  This program is distributed in the hope that it will be useful,        *
0018  *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
0019  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
0020  *  GNU General Public License for more details.                           *
0021  *                                                                         *
0022  *   You should have received a copy of the GNU General Public License     *
0023  *   along with this program; if not, write to the Free Software           *
0024  *   Foundation, Inc., 51 Franklin Street, Fifth Floor,                    *
0025  *   Boston, MA  02110-1301  USA                                           *
0026  *                                                                         *
0027  ***************************************************************************/
0028 #ifndef TEXRENDERER_H
0029 #define TEXRENDERER_H
0030 
0031 #include <QColor>
0032 
0033 class QString;
0034 class QImage;
0035 class QTemporaryFile;
0036 
0037 class TeXRenderer {
0038 public:
0039     struct Formatting {
0040         QColor fontColor;
0041         QColor backgroundColor;
0042         int fontSize;
0043         QString fontFamily;
0044         int dpi;
0045     };
0046 
0047     static QImage renderImageLaTeX(const QString&, bool* success, const TeXRenderer::Formatting&);
0048     static QImage imageFromPDF(const QTemporaryFile&, const int dpi, const QString& engine, bool* success);
0049     static QImage imageFromDVI(const QTemporaryFile&, const int dpi, bool* success);
0050     static bool enabled();
0051     static bool executableExists(const QString&);
0052 };
0053 
0054 #endif