sp-font-face.cpp revision ef8951e23bbe332bc38842a832281ecf8b00d78e
#define __SP_FONTFACE_C__
/*
* SVG <font-face> element implementation
*
* Section 20.8.3 of the W3C SVG 1.1 spec
* available at:
* http://www.w3.org/TR/SVG/fonts.html#FontFaceElement
*
* 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-font-face.h"
#include "document.h"
#include "helper-fns.h"
class ObjectContainer
{
public:
ObjectContainer(double def){
this->isset = false;
this->default_value = def;
}
double get(){
if (this->isset)
return this->obj;
else
return this->default_value;
}
this->isset = true;
}
void unset(){
this->isset = false;
}
private:
double obj;
double default_value;
bool isset;
};
static Inkscape::XML::Node *sp_fontface_write(SPObject *object, Inkscape::XML::Node *repr, guint flags);
static void sp_fontface_child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref);
static SPObjectClass *parent_class;
GType sp_fontface_get_type(void)
{
if (!type) {
sizeof(SPFontFaceClass),
NULL, /* base_init */
NULL, /* base_finalize */
NULL, /* class_finalize */
NULL, /* class_data */
sizeof(SPFontFace),
16, /* n_preallocs */
NULL, /* value_table */
};
}
return type;
}
{
}
{
/*
face->font_family = NULL;
//face->font_style = ;
//face->font_variant = ;
//face->font_weight = ;
//face->font_stretch = ;
face->font_size = NULL;
//face->unicode_range = ;
face->units_per_em = 1000;
//face->panose_1 = ;
face->stem_v = ;
face->stem_h = ;
face->slope = 0;
face->cap_height = ;
face->x_height = ;
face->accent_height = ;
face->ascent = ;
face->descent = ;
face->widths = NULL;
face->bbox = NULL;
face->ideographic = ;
face->alphabetic = ;
face->mathematical = ;
face->hanging = ;
face->v_ideographic = ;
face->v_alphabetic = ;
face->v_mathematical = ;
face->v_hanging = ;
face->underline_position = ;
face->underline_thickness = ;
face->strikethrough_position = ;
face->strikethrough_thickness = ;
face->overline_position = ;
face->overline_thickness = ;
*/
}
{
}
}
{
}
/**
* Callback for child_added event.
*/
static void
{
}
/**
* Callback for remove_child event.
*/
static void
{
}
{
//SPFontFace *font = SP_FONTFACE(object);
}
}
{
double number;
switch (key) {
case SP_ATTR_UNITS_PER_EM:
}
break;
case SP_ATTR_STEMV:
}
break;
case SP_ATTR_STEMH:
}
break;
case SP_ATTR_SLOPE:
}
break;
case SP_ATTR_CAP_HEIGHT:
}
break;
case SP_ATTR_X_HEIGHT:
}
break;
case SP_ATTR_ACCENT_HEIGHT:
}
break;
case SP_ATTR_ASCENT:
}
break;
case SP_ATTR_DESCENT:
}
break;
case SP_ATTR_IDEOGRAPHIC:
}
break;
case SP_ATTR_ALPHABETIC:
}
break;
case SP_ATTR_MATHEMATICAL:
}
break;
case SP_ATTR_HANGING:
}
break;
case SP_ATTR_V_IDEOGRAPHIC:
}
break;
case SP_ATTR_V_ALPHABETIC:
}
break;
case SP_ATTR_V_MATHEMATICAL:
}
break;
case SP_ATTR_V_HANGING:
}
break;
}
break;
}
break;
}
break;
}
break;
}
break;
}
break;
default:
}
break;
}
}
/**
* Receives update notifications.
*/
static void
{
if (flags & (SP_OBJECT_MODIFIED_FLAG)) {
}
}
}
static Inkscape::XML::Node *sp_fontface_write(SPObject *object, Inkscape::XML::Node *repr, guint flags)
{
}
//TODO:
//sp_repr_set_svg_double(repr, "font-family", face->font_family);
//sp_repr_set_svg_double(repr, "font-style", face->font_style);
//sp_repr_set_svg_double(repr, "font-variant", face->font_variant);
//sp_repr_set_svg_double(repr, "font-weight", face->font_weight);
//sp_repr_set_svg_double(repr, "font-stretch", face->font_stretch);
//sp_repr_set_svg_double(repr, "font-size", face->font_size);
//sp_repr_set_svg_double(repr, "unicode-range", face->unicode_range);
//sp_repr_set_svg_double(repr, "panose-1", face->panose_1);
//sp_repr_set_svg_double(repr, "widths", face->widths);
//sp_repr_set_svg_double(repr, "bbox", face->bbox);
}
}
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 :