summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f7e41b7)
raw | patch | inline | side by side (parent: f7e41b7)
author | JucaBlues <JucaBlues@users.sourceforge.net> | |
Sat, 12 Jul 2008 13:24:51 +0000 (13:24 +0000) | ||
committer | JucaBlues <JucaBlues@users.sourceforge.net> | |
Sat, 12 Jul 2008 13:24:51 +0000 (13:24 +0000) |
src/ui/dialog/svg-fonts-dialog.cpp | patch | blob | history | |
src/ui/dialog/svg-fonts-dialog.h | patch | blob | history |
index 254929bdb40a697fcce72de88166848ff0103138..b5489e31ac33c7fca623335b41c1d83e87558599 100644 (file)
SvgFontDrawingArea::SvgFontDrawingArea(){
this->text = "";
this->svgfont = NULL;
- ((Gtk::Widget*) this)->set_size_request(150, 50);
}
void SvgFontDrawingArea::set_svgfont(SvgFont* svgfont){
this->text = text;
}
+void SvgFontDrawingArea::set_size(int x, int y){
+ this->x = x;
+ this->y = y;
+ ((Gtk::Widget*) this)->set_size_request(x, y);
+}
+
void SvgFontDrawingArea::redraw(){
((Gtk::Widget*) this)->queue_draw();
}
Glib::RefPtr<Gdk::Window> window = get_window();
Cairo::RefPtr<Cairo::Context> cr = window->create_cairo_context();
cr->set_font_face( Cairo::RefPtr<Cairo::FontFace>(new Cairo::FontFace(this->svgfont->get_font_face(), false /* does not have reference */)) );
- cr->set_font_size (20);
- cr->move_to (20, 20);
+ cr->set_font_size (this->y);
+ cr->move_to (10, 10);
cr->show_text (this->text.c_str());
}
return TRUE;
kernvbox->add((Gtk::Widget&) kerning_preview);
kernvbox->add(kerning_spin);
+ kerning_preview.set_size(300, 150);
+ _font_da.set_size(150, 50);
+
//Text Preview:
_preview_entry.signal_changed().connect(sigc::mem_fun(*this, &SvgFontsDialog::on_preview_text_changed));
_getContents()->add(*Gtk::manage(new Gtk::Label("Preview Text:")));
index 837fc04786cd2970c57074352b4c5f53acc8b9da..24da11f10760df258706fa22c1ecc1772306cdf1 100644 (file)
SvgFontDrawingArea();
void set_text(Glib::ustring);
void set_svgfont(SvgFont*);
+ void set_size(int x, int y);
void redraw();
private:
+ int x,y;
SvgFont* svgfont;
Glib::ustring text;
bool on_expose_event (GdkEventExpose *event);