Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
sp-glyph-kerning.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * SVG <hkern> and <vkern> elements implementation
4 *
5 * Authors:
6 * Felipe C. da S. Sanches <juca@members.fsf.org>
7 *
8 * Copyright (C) 2008 Felipe C. da S. Sanches
9 *
10 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
11 */
12
13#ifndef SEEN_SP_GLYPH_KERNING_H
14#define SEEN_SP_GLYPH_KERNING_H
15
16#include "sp-object.h"
17#include "unicoderange.h"
18
20public:
21 GlyphNames(char const* value);
23 bool contains(char const* name);
24private:
25 char* names;
26};
27
28class SPGlyphKerning : public SPObject {
29public:
31 ~SPGlyphKerning() override = default;
32 int tag() const override { return tag_of<decltype(*this)>; }
33
34 // FIXME encapsulation
39 double k;
40
41protected:
42 void build(SPDocument* doc, Inkscape::XML::Node* repr) override;
43 void release() override;
44 void set(SPAttr key, char const* value) override;
45 void update(SPCtx* ctx, unsigned int flags) override;
46 Inkscape::XML::Node* write(Inkscape::XML::Document* doc, Inkscape::XML::Node* repr, unsigned int flags) override;
47};
48
49class SPHkern final : public SPGlyphKerning {
50 ~SPHkern() override = default;
51 int tag() const override { return tag_of<decltype(*this)>; }
52};
53
54class SPVkern final : public SPGlyphKerning {
55 ~SPVkern() override = default;
56 int tag() const override { return tag_of<decltype(*this)>; }
57};
58
59#endif // !SEEN_SP_GLYPH_KERNING_H
60
61/*
62 Local Variables:
63 mode:c++
64 c-file-style:"stroustrup"
65 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
66 indent-tabs-mode:nil
67 fill-column:99
68 End:
69*/
70// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8 :
SPAttr
Definition attributes.h:27
constexpr int tag_of
Convenience function to retrieve the tag (class id) of a given type.
Definition cast.h:26
bool contains(char const *name)
Interface for refcounted XML nodes.
Definition node.h:80
Typed SVG document implementation.
Definition document.h:101
void update(SPCtx *ctx, unsigned int flags) override
Receives update notifications.
GlyphNames * g1
UnicodeRange * u2
void build(SPDocument *doc, Inkscape::XML::Node *repr) override
UnicodeRange * u1
void release() override
~SPGlyphKerning() override=default
GlyphNames * g2
Inkscape::XML::Node * write(Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, unsigned int flags) override
int tag() const override
~SPHkern() override=default
int tag() const override
SPObject is an abstract base class of all of the document nodes at the SVG document level.
Definition sp-object.h:160
Inkscape::XML::Node * repr
Definition sp-object.h:193
~SPVkern() override=default
int tag() const override
static cairo_user_data_key_t key
Interface for XML documents.
Definition document.h:43
Unused.
Definition sp-object.h:94
Glib::ustring name
Definition toolbars.cpp:55
TODO: insert short description here.