nr-svgfonts.h revision 15c2c27530bd335a1fcaf82cf86db65bf87a0233
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm#ifndef NR_SVGFONTS_H_SEEN
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm#define NR_SVGFONTS_H_SEEN
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm/*
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm * SVGFonts rendering headear
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm *
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm * Authors:
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm * Felipe C. da S. Sanches <juca@members.fsf.org>
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm *
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm * Copyright (C) 2008 Felipe C. da S. Sanches
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm *
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm * Released under GNU GPL version 2 or later.
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm * Read the file 'COPYING' for more information.
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm */
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm#include <cairo.h>
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm#include <sigc++/connection.h>
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm
43f848b15ee40a6c108ae9d965cf06f055ecb7a5johanengelenclass SvgFont;
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrmclass SPFont;
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrmclass SPGlyph;
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrmclass SPMissingGlyph;
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrmextern "C" { typedef struct _GdkEventExpose GdkEventExpose; }
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm
afb717c6e7d29c86c404b6627855c438d6dc2c0fjohanengelennamespace Gtk {
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrmclass Widget;
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm}
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrmclass UserFont {
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrmpublic:
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm UserFont(SvgFont* instance);
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm cairo_font_face_t* face;
62d835b4bbb0f1f046e30d9b67f8e9517cc6175cjohanengelen};
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm
d73ff87f5c0a6d911b9808d81e1cbdee5337e069cilixclass SvgFont {
d73ff87f5c0a6d911b9808d81e1cbdee5337e069cilixpublic:
1673045848db9654bcb07a81fad34afb4b0623d1johanengelen SvgFont(SPFont* spfont);
3cc77bbe681dd68bde92a2c4796cd5020aecb214johanengelen void refresh();
afb717c6e7d29c86c404b6627855c438d6dc2c0fjohanengelen cairo_font_face_t* get_font_face();
c0cd5511d3b975ebe07d019c1f5528108725e438johanengelen cairo_status_t scaled_font_init (cairo_scaled_font_t *scaled_font, cairo_font_extents_t *metrics);
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm cairo_status_t scaled_font_text_to_glyphs (cairo_scaled_font_t *scaled_font, const char *utf8, int utf8_len, cairo_glyph_t **glyphs, int *num_glyphs, cairo_text_cluster_t **clusters, int *num_clusters, cairo_text_cluster_flags_t *flags);
94f2e710e9cc2e0eb14c8d73abfe77d60f961db2johanengelen cairo_status_t scaled_font_render_glyph (cairo_scaled_font_t *scaled_font, unsigned long glyph, cairo_t *cr, cairo_text_extents_t *metrics);
94f2e710e9cc2e0eb14c8d73abfe77d60f961db2johanengelen
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm Geom::PathVector flip_coordinate_system(SPFont* spfont, Geom::PathVector pathv);
94f2e710e9cc2e0eb14c8d73abfe77d60f961db2johanengelen void render_glyph_path(cairo_t* cr, Geom::PathVector* pathv);
9bddaf7172a6bb788ccae3ba5a30599d63acf424johanengelen void glyph_modified(SPObject *, unsigned int);
94f2e710e9cc2e0eb14c8d73abfe77d60f961db2johanengelen
94f2e710e9cc2e0eb14c8d73abfe77d60f961db2johanengelenprivate:
42e99769805c14a5cc01c805faa3c3b03f9dd1c0johanengelen SPFont* font;
d431763a9ec8059aa4962688de8144319969fb0fjohanengelen UserFont* userfont;
d431763a9ec8059aa4962688de8144319969fb0fjohanengelen std::vector<SPGlyph*> glyphs;
fb5a72174252e0e79107dcad3bf5a2bbd73e349cjohanengelen SPMissingGlyph* missingglyph;
0903335a0099bd7ee779925f43a15a2216a0e863johanengelen sigc::connection glyph_modified_connection;
bdd7add6c064afee52d2eabeaa18f745430e5a4djohanengelen
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm bool drawing_expose_cb (Gtk::Widget *widget, GdkEventExpose *event, void* data);
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm};
f07bfd5a05d43a6d11f7cd442f085149092dea88pjrm
390745fa4524b55aad12d5d2d656cd73e75a0bc0cilix#endif //#ifndef NR_SVGFONTS_H_SEEN
390745fa4524b55aad12d5d2d656cd73e75a0bc0cilix
390745fa4524b55aad12d5d2d656cd73e75a0bc0cilix/*
afb717c6e7d29c86c404b6627855c438d6dc2c0fjohanengelen Local Variables:
1673045848db9654bcb07a81fad34afb4b0623d1johanengelen mode:c++
1673045848db9654bcb07a81fad34afb4b0623d1johanengelen c-file-style:"stroustrup"
1673045848db9654bcb07a81fad34afb4b0623d1johanengelen c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
1673045848db9654bcb07a81fad34afb4b0623d1johanengelen indent-tabs-mode:nil
1673045848db9654bcb07a81fad34afb4b0623d1johanengelen fill-column:99
1673045848db9654bcb07a81fad34afb4b0623d1johanengelen End:
442e92e07cfe50f73dda0d06638025a65e23a956johanengelen*/
43f848b15ee40a6c108ae9d965cf06f055ecb7a5johanengelen// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8 :
43f848b15ee40a6c108ae9d965cf06f055ecb7a5johanengelen