nr-svgfonts.cpp revision ae3eacfd49646a2f254b3ff70db24d2a6d68f287
#include "config.h"
#ifdef ENABLE_SVG_FONTS
/*
* SVGFonts rendering implementation
*
* Authors:
* Felipe C. da S. Sanches <felipe.sanches@gmail.com>
*
* Copyright (C) 2008 Felipe C. da S. Sanches
*
* Released under GNU GPL version 2 or later.
* Read the file 'COPYING' for more information.
*/
#include <libnr/n-art-bpath.h>
#include "../style.h"
#include <cairo.h>
#include <vector>
#include "inkscape-cairo.h"
#include "nr-svgfonts.h"
//***********************************//
// SvgFontDrawingArea Implementation //
//***********************************//
public:
}
private:
cr->set_font_face( Cairo::RefPtr<Cairo::FontFace>(new Cairo::FontFace(this->svgfont->get_font_face(), false /* does not have reference */)) );
return TRUE;
}
};//class SvgFontDrawingArea
//*************************//
// UserFont Implementation //
//*************************//
static cairo_user_data_key_t key;
}
const char *utf8,
int *num_glyphs){
}
unsigned long glyph,
}
this->face = cairo_user_font_face_create ();
}
//******************************//
// SvgFont class Implementation //
//******************************//
this->missingglyph = NULL;
font_da = new SvgFontDrawingArea(this);
}
{
//TODO
// metrics->ascent = .75;
// metrics->descent = .25;
return CAIRO_STATUS_SUCCESS;
}
unsigned int p=0;
if (s1[p]=='\0') return p;
else return 0;
}
const char *utf8,
int *num_glyphs)
{
unsigned long i;
int count = 0;
unsigned int len;
while(_utf8[0] != '\0'){
_utf8++;
count++;
}
count=0;
while(_utf8[0] != '\0'){
len = 0;
continue;
}
}
if (!len){
_utf8++;
}
}
*num_glyphs = count;
return CAIRO_STATUS_SUCCESS;
}
unsigned long glyph,
{
if (!this->missingglyph) return CAIRO_STATUS_SUCCESS;
g_warning("RENDER MISSING-GLYPH");
} else {
}
if (SP_IS_MISSING_GLYPH(node) && ((SPMissingGlyph*)node)->d) bpath = sp_svg_read_path(((SPMissingGlyph*)node)->d);
if (!bpath) return CAIRO_STATUS_SUCCESS;
cairo_fill(cr);
return CAIRO_STATUS_SUCCESS;
}
SvgFont::get_font_face(){
if (!this->userfont) {
if (SP_IS_GLYPH(node)){
}
if (SP_IS_MISSING_GLYPH(node)){
g_warning("missingglyph=(SPMissingGlyph*)node;");
}
}
}
}
#endif //#ifdef ENABLE_SVG_FONTS