Code

Fixed compilation when the new SVG font stuff is not enabled.
[inkscape.git] / src / display / nr-svgfonts.h
1 #include "config.h"
2 #ifndef NR_SVGFONTS_H_SEEN
3 #define NR_SVGFONTS_H_SEEN
4 /*
5  * SVGFonts rendering headear
6  *
7  * Authors:
8  *    Felipe C. da S. Sanches <felipe.sanches@gmail.com>
9  *
10  * Copyright (C) 2008 Felipe C. da S. Sanches
11  *
12  * Released under GNU GPL version 2 or later.
13  * Read the file 'COPYING' for more information.
14  */
16 #include "cairo.h"
17 #include <gtkmm.h>
19 #include <gtkmm/widget.h>
20 #include <gtkmm/window.h>
21 #include <gdkmm/drawable.h>
22 #include <gdkmm/general.h>  // for cairo helper functions
24 #include "../sp-glyph.h"
25 #include "../sp-missing-glyph.h"
26 #include "../sp-font.h"
27 #include "../sp-glyph-kerning.h"
29 class SvgFont;
30 struct SPFont;
32 class UserFont{
33 public:
34 UserFont(SvgFont* instance);
35 cairo_font_face_t* face;
36 };
38 class SvgFont{
39 public:
40 SvgFont(SPFont* spfont);
41 cairo_font_face_t* get_font_face();
42 cairo_status_t scaled_font_init (cairo_scaled_font_t *scaled_font, cairo_font_extents_t *metrics);
43 cairo_status_t scaled_font_text_to_glyphs (cairo_scaled_font_t *scaled_font, const char *utf8, cairo_glyph_t **glyphs, int *num_glyphs);
44 cairo_status_t scaled_font_render_glyph (cairo_scaled_font_t *scaled_font, unsigned long glyph, cairo_t *cr, cairo_text_extents_t *metrics);
46 private:
47 SPFont* font;
48 UserFont* userfont;
49 std::vector<SPGlyph*> glyphs;
50 SPMissingGlyph* missingglyph;
52 bool drawing_expose_cb (Gtk::Widget *widget, GdkEventExpose *event, gpointer data);
53 };
55 #endif //#ifndef NR_SVGFONTS_H_SEEN