From 22f081b4206e716c03c4ba740b499f20a568b163 Mon Sep 17 00:00:00 2001 From: JucaBlues Date: Sat, 12 Jul 2008 13:24:51 +0000 Subject: [PATCH] increase font size on kerning_preview and text_preview drawing areas --- src/ui/dialog/svg-fonts-dialog.cpp | 14 +++++++++++--- src/ui/dialog/svg-fonts-dialog.h | 2 ++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/ui/dialog/svg-fonts-dialog.cpp b/src/ui/dialog/svg-fonts-dialog.cpp index 254929bdb..b5489e31a 100644 --- a/src/ui/dialog/svg-fonts-dialog.cpp +++ b/src/ui/dialog/svg-fonts-dialog.cpp @@ -21,7 +21,6 @@ SvgFontDrawingArea::SvgFontDrawingArea(){ this->text = ""; this->svgfont = NULL; - ((Gtk::Widget*) this)->set_size_request(150, 50); } void SvgFontDrawingArea::set_svgfont(SvgFont* svgfont){ @@ -32,6 +31,12 @@ void SvgFontDrawingArea::set_text(Glib::ustring text){ 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(); } @@ -41,8 +46,8 @@ bool SvgFontDrawingArea::on_expose_event (GdkEventExpose *event){ Glib::RefPtr window = get_window(); Cairo::RefPtr cr = window->create_cairo_context(); cr->set_font_face( Cairo::RefPtr(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; @@ -188,6 +193,9 @@ SvgFontsDialog::SvgFontsDialog() 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:"))); diff --git a/src/ui/dialog/svg-fonts-dialog.h b/src/ui/dialog/svg-fonts-dialog.h index 837fc0478..24da11f10 100644 --- a/src/ui/dialog/svg-fonts-dialog.h +++ b/src/ui/dialog/svg-fonts-dialog.h @@ -32,8 +32,10 @@ public: 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); -- 2.30.2