Commit 61409390 authored by ivan.ilyin's avatar ivan.ilyin

Added new headers to cff import sources.

Improved rectangles and ellipses import (each element havs separate bounding box).
Added textArea and text tags import
parent 104c60d1
This diff is collapsed.
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef UBCFFSUBSETADAPTOR_H #ifndef UBCFFSUBSETADAPTOR_H
#define UBCFFSUBSETADAPTOR_H #define UBCFFSUBSETADAPTOR_H
...@@ -8,6 +23,8 @@ ...@@ -8,6 +23,8 @@
class UBDocumentProxy; class UBDocumentProxy;
class UBGraphicsScene; class UBGraphicsScene;
class QSvgGenerator; class QSvgGenerator;
class UBGraphicsSvgItem;
class QTransform;
class UBCFFSubsetAdaptor class UBCFFSubsetAdaptor
{ {
...@@ -42,8 +59,10 @@ private: ...@@ -42,8 +59,10 @@ private:
private: private:
QString mTempFilePath; QString mTempFilePath;
UBGraphicsScene *mCurrentScene; UBGraphicsScene *mCurrentScene;
QRectF mCurrentSceneRect;
QString mIndent; QString mIndent;
QRectF mViewBox; QRectF mViewBox;
QPointF mViewBoxCenter;
QSize mSize; QSize mSize;
//methods to store current xml parse state //methods to store current xml parse state
...@@ -63,6 +82,7 @@ private: ...@@ -63,6 +82,7 @@ private:
bool parseRect(); bool parseRect();
bool parseEllipse(); bool parseEllipse();
bool parseTextArea(); bool parseTextArea();
bool parseText();
bool parsePolygon(); bool parsePolygon();
bool parsePage(); bool parsePage();
bool parsePageSet(); bool parsePageSet();
...@@ -75,11 +95,16 @@ private: ...@@ -75,11 +95,16 @@ private:
int currentState; int currentState;
//helper methods //helper methods
bool getCurElementTransorm(QTransform &transform);
void repositionSvgItem(UBGraphicsSvgItem *item, qreal width, qreal height, qreal x, qreal y, bool useTransform, QTransform &transform);
QColor colorFromString(const QString& clrString); QColor colorFromString(const QString& clrString);
QTransform transformFromString(const QString trString); QTransform transformFromString(const QString trString);
bool getViewBoxDimenstions(const QString& viewBox); bool getViewBoxDimenstions(const QString& viewBox);
QSvgGenerator* createSvgGenerator(); QSvgGenerator* createSvgGenerator(qreal width, qreal height);
bool getTempFileName(); bool getTempFileName();
void parseTextAttributes(qreal &fontSize, QColor &fontColor,
QString &fontFamily, QString &fontStretch, bool &italic,
int &fontWeight, int &textAlign, QTransform &fontTransform);
}; };
}; };
......
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QDir> #include <QDir>
#include "UBImportCFF.h"
#include "document/UBDocumentProxy.h"
#include "core/UBApplication.h" #include "core/UBApplication.h"
#include "core/UBPersistenceManager.h" #include "core/UBPersistenceManager.h"
#include "core/UBDocumentManager.h" #include "core/UBDocumentManager.h"
#include "core/memcheck.h" #include "core/memcheck.h"
#include "core/UBPersistenceManager.h" #include "core/UBPersistenceManager.h"
#include "document/UBDocumentProxy.h"
#include "frameworks/UBFileSystemUtils.h"
#include "domain/UBGraphicsPDFItem.h" #include "domain/UBGraphicsPDFItem.h"
#include "frameworks/UBFileSystemUtils.h"
#include "pdf/PDFRenderer.h" #include "pdf/PDFRenderer.h"
#include "UBCFFSubsetAdaptor.h" #include "UBCFFSubsetAdaptor.h"
#include "UBImportCFF.h"
#include "quazip.h" #include "quazip.h"
#include "quazipfile.h" #include "quazipfile.h"
......
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef UBIMPORTCFF_H #ifndef UBIMPORTCFF_H
#define UBIMPORTCFF_H #define UBIMPORTCFF_H
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment