Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
latex-text-renderer.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2#ifndef EXTENSION_INTERNAL_LATEX_TEXT_RENDERER_H_SEEN
3#define EXTENSION_INTERNAL_LATEX_TEXT_RENDERER_H_SEEN
4
8/*
9 * Authors:
10 * Johan Engelen <goejendaagh@zonnet.nl>
11 *
12 * Copyright (C) 2010 Authors
13 *
14 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
15 */
16
17#include "extension/extension.h"
18#include <2geom/affine.h>
19#include <stack>
20
21class SPItem;
22class SPRoot;
23class SPGroup;
24class SPUse;
25class SPText;
26class SPFlowtext;
27
28namespace Inkscape {
29namespace Extension {
30namespace Internal {
31
32bool latex_render_document_text_to_file(SPDocument *doc, gchar const *filename, bool pdflatex);
33
35public:
36 LaTeXTextRenderer(bool pdflatex);
37 virtual ~LaTeXTextRenderer();
38
39 bool setTargetFile(gchar const *filename);
40
43 bool setupDocument(SPDocument *doc, SPItem *base);
44
46 void renderItem(SPItem *item);
47
48protected:
54
55 FILE * _stream;
56 gchar * _filename;
57
58 bool _pdflatex;
62
64 Geom::Affine const & transform();
65 void pop_transform();
66 std::stack<Geom::Affine> _transform_stack;
67
68 void writePreamble();
69 void writePostamble();
70
71 void writeGraphicPage();
72
75 void sp_group_render(SPGroup *group);
76 void sp_use_render(SPUse *use);
77 void sp_text_render(SPText *text);
78 void sp_flowtext_render(SPFlowtext *flowtext);
79};
80
81} /* namespace Internal */
82} /* namespace Extension */
83} /* namespace Inkscape */
84
85#endif /* !EXTENSION_INTERNAL_LATEX_TEXT_RENDERER_H_SEEN */
86
87/*
88 Local Variables:
89 mode:c++
90 c-file-style:"stroustrup"
91 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
92 indent-tabs-mode:nil
93 fill-column:99
94 End:
95*/
96// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
3x3 affine transformation matrix.
3x3 matrix representing an affine transformation.
Definition affine.h:70
bool setupDocument(SPDocument *doc, SPItem *base)
Initializes the LaTeXTextRenderer according to the specified SPDocument.
bool setTargetFile(gchar const *filename)
This should create the output LaTeX file, and assign it to _stream.
void renderItem(SPItem *item)
Traverses the object tree and invokes the render methods.
LaTeXOmitTextPageState _omittext_state
true if outputting for pdfLaTeX
void push_transform(Geom::Affine const &transform)
Typed SVG document implementation.
Definition document.h:101
Base class for visual SVG elements.
Definition sp-item.h:109
<svg> element
Definition sp-root.h:31
Definition sp-use.h:25
Inkscape::Extension::Extension: Frontend to certain, possibly pluggable, actions.
SPItem * item
bool latex_render_document_text_to_file(SPDocument *doc, gchar const *filename, bool pdflatex)
This method is called by the PDF, EPS and PS output extensions.
Helper class to stream background task notifications as a series of messages.