Code

fix bbox calculation for groups that contain groups with nothing in them (zero bbox...
[inkscape.git] / src / display / nr-svgfonts.h
1 #include "config.h"
2 #ifdef ENABLE_SVG_FONTS
3 #ifndef __SVGFONTS_H__
4 #define __SVGFONTS_H__
5 /*
6  * SVGFonts rendering headear
7  *
8  * Authors:
9  *    Felipe C. da S. Sanches <felipe.sanches@gmail.com>
10  *
11  * Copyright (C) 2008 Felipe C. da S. Sanches
12  *
13  * Released under GNU GPL version 2 or later.
14  * Read the file 'COPYING' for more information.
15  */
17 #include "../sp-font.h"
18 #include "cairo.h"
19 #include <gtkmm.h>
21 #include <gtkmm/widget.h>
22 #include <gtkmm/window.h>
23 #include <gdkmm/drawable.h>
24 #include <gdkmm/general.h>  // for cairo helper functions
26 #include "../sp-glyph.h"
27 #include "../sp-missing-glyph.h"
28 #include "../sp-font.h"
29 #include "../sp-glyph-kerning.h"
31 class SvgFont;
33 class UserFont{
34 public:
35 UserFont(SvgFont* instance);
36 cairo_font_face_t* face;
37 };
39 class SvgFont{
40 public:
41 SvgFont(SPFont* spfont);
42 cairo_font_face_t* get_font_face();
43 cairo_status_t scaled_font_init (cairo_scaled_font_t *scaled_font, cairo_font_extents_t *metrics);
44 cairo_status_t scaled_font_text_to_glyphs (cairo_scaled_font_t *scaled_font, const char *utf8, cairo_glyph_t **glyphs, int *num_glyphs);
45 cairo_status_t scaled_font_render_glyph (cairo_scaled_font_t *scaled_font, unsigned long glyph, cairo_t *cr, cairo_text_extents_t *metrics);
47 private:
48 SPFont* font;
49 UserFont* userfont;
50 std::vector<SPGlyph*> glyphs;
51 SPMissingGlyph* missingglyph;
53 bool drawing_expose_cb (Gtk::Widget *widget, GdkEventExpose *event, gpointer data);
54 };
56 #endif //#ifndef __SVGFONTS_H__
57 #endif //#ifdef ENABLE_SVG_FONTS