Code

Fixed icon loading, cacheing and fallback to use stock mechanisms.
[inkscape.git] / src / display / nr-svgfonts.h
index f1671cb7deeaf2f10be8b6274581378b3ca88e48..58840e414e729711d7256146837a9a339bdcc9c2 100644 (file)
@@ -1,7 +1,6 @@
 #include "config.h"
-#ifdef ENABLE_SVG_FONTS
-#ifndef __SVGFONTS_H__
-#define __SVGFONTS_H__
+#ifndef NR_SVGFONTS_H_SEEN
+#define NR_SVGFONTS_H_SEEN
 /*
  * SVGFonts rendering headear
  *
  * Read the file 'COPYING' for more information.
  */
 
-#include "../sp-font.h"
 #include "cairo.h"
+#include <gtkmm.h>
+
+#include <gtkmm/widget.h>
+#include <gtkmm/window.h>
+#include <gdkmm/drawable.h>
+#include <gdkmm/general.h>  // for cairo helper functions
+
+#include "../sp-glyph.h"
+#include "../sp-missing-glyph.h"
+#include "../sp-font.h"
+#include "../sp-glyph-kerning.h"
+
+class SvgFont;
+struct SPFont;
+
+class UserFont{
+public:
+UserFont(SvgFont* instance);
+cairo_font_face_t* face;
+};
+
+class SvgFont{
+public:
+SvgFont(SPFont* spfont);
+cairo_font_face_t* get_font_face();
+cairo_status_t scaled_font_init (cairo_scaled_font_t *scaled_font, cairo_font_extents_t *metrics);
+cairo_status_t scaled_font_text_to_glyphs (cairo_scaled_font_t *scaled_font, const char *utf8, cairo_glyph_t **glyphs, int *num_glyphs);
+cairo_status_t scaled_font_render_glyph (cairo_scaled_font_t *scaled_font, unsigned long glyph, cairo_t *cr, cairo_text_extents_t *metrics);
 
-void nr_svgfonts_append_spfont(SPFont* font);
-cairo_font_face_t* nr_svgfonts_get_user_font_face();
+private:
+SPFont* font;
+UserFont* userfont;
+std::vector<SPGlyph*> glyphs;
+SPMissingGlyph* missingglyph;
 
-#endif //#ifndef __SVGFONTS_H__
-#endif //#ifdef ENABLE_SVG_FONTS
+bool drawing_expose_cb (Gtk::Widget *widget, GdkEventExpose *event, gpointer data);
+};
 
+#endif //#ifndef NR_SVGFONTS_H_SEEN