sp-glyph-kerning.cpp revision 1f29ece7a5be5230692c25ff5132d46b20dcd692
#define __SP_ANCHOR_C__
/*
* SVG <hkern> and <vkern> elements implementation
* W3C SVG 1.1 spec, page 476, section 20.7
*
* Author:
* Felipe C. da S. Sanches <felipe.sanches@gmail.com>
*
* Copyright (C) 2008, Felipe C. da S. Sanches
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "attributes.h"
#include "sp-glyph-kerning.h"
#include "document.h"
#include "helper-fns.h"
static void sp_glyph_kerning_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr);
static Inkscape::XML::Node *sp_glyph_kerning_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
static SPObjectClass *parent_class;
{
if (!type) {
sizeof(SPGlyphKerningClass),
NULL, /* base_init */
NULL, /* base_finalize */
NULL, /* class_finalize */
NULL, /* class_data */
sizeof(SPHkern),
16, /* n_preallocs */
NULL, /* value_table */
};
}
return type;
}
{
if (!type) {
sizeof(SPGlyphKerningClass),
NULL, /* base_init */
NULL, /* base_finalize */
NULL, /* class_finalize */
NULL, /* class_data */
sizeof(SPVkern),
16, /* n_preallocs */
NULL, /* value_table */
};
}
return type;
}
{
}
{
//TODO: correct these values:
glyph->k = 0;
}
static void sp_glyph_kerning_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
{
}
}
{
//SPGlyphKerning *glyph = SP_GLYPH_KERNING(object);
}
}
{
SPGlyphKerning * glyphkern = (SPGlyphKerning*) object; //even if it is a VKern this will work. I did it this way just to avoind warnings.
double number;
switch (key) {
case SP_ATTR_U1:
break;
case SP_ATTR_U2:
break;
case SP_ATTR_G1:
break;
case SP_ATTR_G2:
break;
case SP_ATTR_K:
}
break;
default:
}
break;
}
///should free tag?
}
/**
* * Receives update notifications.
* */
static void
{
(void)glyph;
if (flags & SP_OBJECT_MODIFIED_FLAG) {
/* do something to trigger redisplay, updates? */
}
}
}
static Inkscape::XML::Node *sp_glyph_kerning_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
{
// SPGlyphKerning *glyph = SP_GLYPH_KERNING(object);
}
/* I am commenting out this part because I am not certain how does it work. I will have to study it later. Juca
repr->setAttribute("unicode", glyph->unicode);
repr->setAttribute("glyph-name", glyph->glyph_name);
repr->setAttribute("d", glyph->d);
sp_repr_set_svg_double(repr, "orientation", (double) glyph->orientation);
sp_repr_set_svg_double(repr, "arabic-form", (double) glyph->arabic_form);
repr->setAttribute("lang", glyph->lang);
sp_repr_set_svg_double(repr, "horiz-adv-x", glyph->horiz_adv_x);
sp_repr_set_svg_double(repr, "vert-origin-x", glyph->vert_origin_x);
sp_repr_set_svg_double(repr, "vert-origin-y", glyph->vert_origin_y);
sp_repr_set_svg_double(repr, "vert-adv-y", glyph->vert_adv_y);
*/
}
}
return repr;
}
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :