1 // SPDX-License-Identifier: GPL-2.0-or-later
2 #ifndef SP_FONT_H_SEEN
3 #define SP_FONT_H_SEEN
4 
5 /*
6  * SVG <font> element implementation
7  *
8  * Authors:
9  *    Felipe C. da S. Sanches <juca@members.fsf.org>
10  *
11  * Copyright (C) 2008 Felipe C. da S. Sanches
12  *
13  * Released under GNU GPL v2+, read the file 'COPYING' for more information.
14  */
15 
16 #include "sp-object.h"
17 
18 #define SP_FONT(obj) (dynamic_cast<SPFont*>((SPObject*)obj))
19 #define SP_IS_FONT(obj) (dynamic_cast<const SPFont*>((SPObject*)obj) != NULL)
20 
21 class SPFont : public SPObject {
22 public:
23 	SPFont();
24 	~SPFont() override;
25 
26     double horiz_origin_x;
27     double horiz_origin_y;
28     double horiz_adv_x;
29     double vert_origin_x;
30     double vert_origin_y;
31     double vert_adv_y;
32 
33 protected:
34 	void build(SPDocument* doc, Inkscape::XML::Node* repr) override;
35 	void release() override;
36 
37 	void child_added(Inkscape::XML::Node* child, Inkscape::XML::Node* ref) override;
38 	void remove_child(Inkscape::XML::Node* child) override;
39 
40 	void set(SPAttr key, char const* value) override;
41 
42 	void update(SPCtx* ctx, unsigned int flags) override;
43 
44 	Inkscape::XML::Node* write(Inkscape::XML::Document* doc, Inkscape::XML::Node* repr, unsigned int flags) override;
45 };
46 
47 #endif //#ifndef SP_FONT_H_SEEN
48