#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
/*
* 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 <juca@members.fsf.org>
* Abhishek Sharma
*
* 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 <cstring>
if (!value){
return v;
}
value += 3;
value++;
return v;
}
while(value[0]!='\0'){
switch(value[0]){
case 'n':
value += 6;
}
break;
case 'i':
value += 6;
}
break;
case 'o':
value += 7;
}
break;
}
value++;
}
return v;
}
if (!value){
return v;
}
while(value[0]!='\0'){
switch(value[0]){
case 'n':
value += 6;
}
break;
case 's':
value += 10;
}
break;
}
value++;
}
return v;
}
if (!value){
return v;
}
value += 3;
value++;
return v;
}
while(value[0]!='\0'){
switch(value[0]){
case 'n':
value += 6;
}
break;
case 'b':
value += 4;
}
break;
case '1':
value += 3;
}
break;
case '2':
value += 3;
}
break;
case '3':
value += 3;
}
break;
case '4':
value += 3;
}
break;
case '5':
value += 3;
}
break;
case '6':
value += 3;
}
break;
case '7':
value += 3;
}
break;
case '8':
value += 3;
}
break;
case '9':
value += 3;
}
break;
}
value++;
}
return v;
}
if (!value){
return v;
}
value += 3;
value++;
return v;
}
while(value[0]!='\0'){
switch(value[0]){
case 'n':
value += 6;
}
break;
case 'u':
value += 15;
}
value += 14;
}
break;
case 'e':
value += 8;
}
value += 15;
}
value += 14;
}
break;
case 'c':
value += 9;
}
break;
case 's':
value += 14;
}
value += 13;
}
break;
}
value++;
}
return v;
}
this->font_style = style;
this->font_variant = variant;
this->font_weight = weight;
this->font_stretch = stretch;
this->font_family = NULL;
//this->font_style = ;
//this->font_variant = ;
//this->font_weight = ;
//this->font_stretch = ;
//this->unicode_range = ;
this->units_per_em = 1000;
//this->panose_1 = ;
this->stemv = 0;
this->stemh = 0;
this->slope = 0;
this->cap_height = 0;
this->x_height = 0;
this->accent_height = 0;
this->ascent = 0;
this->descent = 0;
this->ideographic = 0;
this->alphabetic = 0;
this->mathematical = 0;
this->hanging = 0;
this->v_ideographic = 0;
this->v_alphabetic = 0;
this->v_mathematical = 0;
this->v_hanging = 0;
this->underline_position = 0;
this->underline_thickness = 0;
this->strikethrough_position = 0;
this->strikethrough_thickness = 0;
this->overline_position = 0;
this->overline_thickness = 0;
}
SPFontFace::~SPFontFace() {
}
this->readAttr( "font-family" );
this->readAttr( "font-style" );
this->readAttr( "font-variant" );
this->readAttr( "font-weight" );
this->readAttr( "font-stretch" );
this->readAttr( "font-size" );
this->readAttr( "unicode-range" );
this->readAttr( "units-per-em" );
this->readAttr( "panose-1" );
this->readAttr( "stem-v" );
this->readAttr( "stem-h" );
this->readAttr( "slope" );
this->readAttr( "cap-height" );
this->readAttr( "x-height" );
this->readAttr( "accent-height" );
this->readAttr( "ascent" );
this->readAttr( "descent" );
this->readAttr( "widths" );
this->readAttr( "bbox" );
this->readAttr( "ideographic" );
this->readAttr( "alphabetic" );
this->readAttr( "mathematical" );
this->readAttr( "ranging" );
this->readAttr( "v-ideogaphic" );
this->readAttr( "v-alphabetic" );
this->readAttr( "v-mathematical" );
this->readAttr( "v-hanging" );
this->readAttr( "underline-position" );
this->readAttr( "underline-thickness" );
this->readAttr( "strikethrough-position" );
this->readAttr( "strikethrough-thickness" );
this->readAttr( "overline-position" );
this->readAttr( "overline-thickness" );
}
/**
* Callback for child_added event.
*/
}
/**
* Callback for remove_child event.
*/
}
}
switch (key) {
case SP_PROP_FONT_FAMILY:
if (this->font_family) {
g_free(this->font_family);
}
break;
case SP_PROP_FONT_STYLE:
this->font_style = style;
} else {
if (style[i] != this->font_style[i]){
this->font_style = style;
break;
}
}
}
break;
case SP_PROP_FONT_VARIANT:
this->font_variant = variant;
} else {
if (variant[i] != this->font_variant[i]){
this->font_variant = variant;
break;
}
}
}
break;
case SP_PROP_FONT_WEIGHT:
this->font_weight = weight;
} else {
if (weight[i] != this->font_weight[i]){
this->font_weight = weight;
break;
}
}
}
break;
case SP_PROP_FONT_STRETCH:
this->font_stretch = stretch;
} else {
if (stretch[i] != this->font_stretch[i]){
this->font_stretch = stretch;
break;
}
}
}
break;
case SP_ATTR_UNITS_PER_EM:
{
if (number != this->units_per_em){
this->units_per_em = number;
}
break;
}
case SP_ATTR_STEMV:
{
}
break;
}
case SP_ATTR_STEMH:
{
}
break;
}
case SP_ATTR_SLOPE:
{
}
break;
}
case SP_ATTR_CAP_HEIGHT:
{
if (number != this->cap_height){
this->cap_height = number;
}
break;
}
case SP_ATTR_X_HEIGHT:
{
}
break;
}
case SP_ATTR_ACCENT_HEIGHT:
{
if (number != this->accent_height){
this->accent_height = number;
}
break;
}
case SP_ATTR_ASCENT:
{
}
break;
}
case SP_ATTR_DESCENT:
{
}
break;
}
case SP_ATTR_IDEOGRAPHIC:
{
if (number != this->ideographic){
this->ideographic = number;
}
break;
}
case SP_ATTR_ALPHABETIC:
{
if (number != this->alphabetic){
this->alphabetic = number;
}
break;
}
case SP_ATTR_MATHEMATICAL:
{
if (number != this->mathematical){
this->mathematical = number;
}
break;
}
case SP_ATTR_HANGING:
{
}
break;
}
case SP_ATTR_V_IDEOGRAPHIC:
{
if (number != this->v_ideographic){
this->v_ideographic = number;
}
break;
}
case SP_ATTR_V_ALPHABETIC:
{
if (number != this->v_alphabetic){
this->v_alphabetic = number;
}
break;
}
case SP_ATTR_V_MATHEMATICAL:
{
if (number != this->v_mathematical){
this->v_mathematical = number;
}
break;
}
case SP_ATTR_V_HANGING:
{
}
break;
}
{
if (number != this->underline_position){
this->underline_position = number;
}
break;
}
{
if (number != this->underline_thickness){
this->underline_thickness = number;
}
break;
}
{
if (number != this->strikethrough_position){
this->strikethrough_position = number;
}
break;
}
{
if (number != this->strikethrough_thickness){
this->strikethrough_thickness = number;
}
break;
}
{
if (number != this->overline_position){
this->overline_position = number;
}
break;
}
{
if (number != this->overline_thickness){
this->overline_thickness = number;
}
break;
}
default:
break;
}
}
/**
* Receives update notifications.
*/
if (flags & (SP_OBJECT_MODIFIED_FLAG)) {
this->readAttr( "font-family" );
this->readAttr( "font-style" );
this->readAttr( "font-variant" );
this->readAttr( "font-weight" );
this->readAttr( "font-stretch" );
this->readAttr( "font-size" );
this->readAttr( "unicode-range" );
this->readAttr( "units-per-em" );
this->readAttr( "panose-1" );
this->readAttr( "stemv" );
this->readAttr( "stemh" );
this->readAttr( "slope" );
this->readAttr( "cap-height" );
this->readAttr( "x-height" );
this->readAttr( "accent-height" );
this->readAttr( "ascent" );
this->readAttr( "descent" );
this->readAttr( "widths" );
this->readAttr( "bbox" );
this->readAttr( "ideographic" );
this->readAttr( "alphabetic" );
this->readAttr( "mathematical" );
this->readAttr( "hanging" );
this->readAttr( "v-ideographic" );
this->readAttr( "v-alphabetic" );
this->readAttr( "v-mathematical" );
this->readAttr( "v-hanging" );
this->readAttr( "underline-position" );
this->readAttr( "underline-thickness" );
this->readAttr( "strikethrough-position" );
this->readAttr( "strikethrough-thickness" );
this->readAttr( "overline-position" );
this->readAttr( "overline-thickness" );
}
}
Inkscape::XML::Node* SPFontFace::write(Inkscape::XML::Document *xml_doc, 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);
// In all COPY_ATTR given below the XML tree is
// being used directly while it shouldn't be.
}
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 :