sp-glyph.cpp revision 76f6adc520900e5e0cb8aa3ec96fed84980a5601
#define __SP_ANCHOR_C__
/*
* SVG <glyph> element implementation
*
* 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.h"
#include "document.h"
#include "helper-fns.h"
static Inkscape::XML::Node *sp_glyph_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
static SPObjectClass *parent_class;
GType sp_glyph_get_type(void)
{
if (!type) {
sizeof(SPGlyphClass),
NULL, /* base_init */
NULL, /* base_finalize */
NULL, /* class_finalize */
NULL, /* class_data */
sizeof(SPGlyph),
16, /* n_preallocs */
NULL, /* value_table */
};
}
return type;
}
{
}
{
//TODO: correct these values:
glyph->horiz_adv_x = 0;
glyph->vert_origin_x = 0;
glyph->vert_origin_y = 0;
glyph->vert_adv_y = 0;
}
{
}
}
{
//SPGlyph *glyph = SP_GLYPH(object);
}
}
if (!value) return GLYPH_ARABIC_FORM_INITIAL; //TODO: verify which is the default default (for me, the spec is not clear)
switch(value[0]){
case 'i':
break;
case 'm':
break;
case 't':
break;
}
return GLYPH_ARABIC_FORM_INITIAL; //TODO: VERIFY DEFAULT!
}
if (!value) return GLYPH_ORIENTATION_BOTH;
switch(value[0]){
case 'h':
return GLYPH_ORIENTATION_HORIZONTAL;
break;
case 'v':
return GLYPH_ORIENTATION_VERTICAL;
break;
}
//ERROR? TODO: VERIFY PROPER ERROR HANDLING
return GLYPH_ORIENTATION_BOTH;
}
{
double number;
switch (key) {
case SP_ATTR_UNICODE:
break;
case SP_ATTR_GLYPH_NAME:
break;
case SP_ATTR_D:
break;
case SP_ATTR_ORIENTATION:
}
break;
case SP_ATTR_ARABIC_FORM:
}
break;
case SP_ATTR_LANG:
break;
case SP_ATTR_HORIZ_ADV_X:
}
break;
case SP_ATTR_VERT_ORIGIN_X:
}
break;
case SP_ATTR_VERT_ORIGIN_Y:
}
break;
case SP_ATTR_VERT_ADV_Y:
}
break;
default:
}
break;
}
}
static Inkscape::XML::Node *sp_glyph_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
{
// SPGlyph *glyph = SP_GLYPH(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 :