From ff89c21c3b425d442921d3ec4ff1eb7752ec5cd5 Mon Sep 17 00:00:00 2001 From: JucaBlues Date: Sat, 12 Jul 2008 03:57:00 +0000 Subject: [PATCH] fix crash on svnfonts dialog --- src/display/nr-svgfonts.cpp | 5 +++-- src/display/nr-svgfonts.h | 6 ------ src/ui/dialog/svg-fonts-dialog.cpp | 23 ++++++----------------- 3 files changed, 9 insertions(+), 25 deletions(-) diff --git a/src/display/nr-svgfonts.cpp b/src/display/nr-svgfonts.cpp index b59d0569d..e70b1beca 100644 --- a/src/display/nr-svgfonts.cpp +++ b/src/display/nr-svgfonts.cpp @@ -153,7 +153,6 @@ SvgFont::scaled_font_text_to_glyphs (cairo_scaled_font_t *scaled_font, } previous_unicode = this->glyphs[i]->unicode;//used for kerning checking previous_glyph_name = this->glyphs[i]->glyph_name;//used for kerning checking - (*glyphs)[count].index = i; (*glyphs)[count].x = x; (*glyphs)[count++].y = y; @@ -161,9 +160,11 @@ SvgFont::scaled_font_text_to_glyphs (cairo_scaled_font_t *scaled_font, if (is_horizontal_text) x++; else y++; _utf8+=len; //advance 'len' chars in our string pointer - continue; + //continue; + goto dirty; } } +dirty: if (!len){ (*glyphs)[count].index = i; (*glyphs)[count].x = x; diff --git a/src/display/nr-svgfonts.h b/src/display/nr-svgfonts.h index ff98f521f..e3bac7d7a 100644 --- a/src/display/nr-svgfonts.h +++ b/src/display/nr-svgfonts.h @@ -14,13 +14,7 @@ */ #include "cairo.h" -//#include - #include -//#include -//#include -//#include // for cairo helper functions - #include "../sp-glyph.h" #include "../sp-missing-glyph.h" #include "../sp-font.h" diff --git a/src/ui/dialog/svg-fonts-dialog.cpp b/src/ui/dialog/svg-fonts-dialog.cpp index 5fa90966c..24bd7ae28 100644 --- a/src/ui/dialog/svg-fonts-dialog.cpp +++ b/src/ui/dialog/svg-fonts-dialog.cpp @@ -18,7 +18,7 @@ #include "svg-fonts-dialog.h" SvgFontDrawingArea::SvgFontDrawingArea(){ - this->text = "Sample Text"; + this->text = ""; this->svgfont = NULL; ((Gtk::Widget*) this)->set_size_request(150, 50); } @@ -73,7 +73,7 @@ void SvgFontsDialog::update_fonts() } void SvgFontsDialog::on_preview_text_changed(){ -// _font_da.set_text((gchar*) _preview_entry.get_text().c_str()); + _font_da.set_text((gchar*) _preview_entry.get_text().c_str()); _font_da.set_text(_preview_entry.get_text()); _font_da.redraw(); } @@ -107,25 +107,14 @@ SvgFontsDialog::SvgFontsDialog() this->update_fonts(); +//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:"))); _getContents()->add((Gtk::Widget&) _font_da); + _preview_entry.set_text("Sample Text"); + _font_da.set_text("Sample Text"); _getContents()->add(_preview_entry); - -/* Gtk::HBox* preview_box = Gtk::manage(new Gtk::HBox()); - _preview_entry.signal_changed().connect(sigc::mem_fun(*this, &SvgFontsDialog::on_preview_text_changed)); - preview_box->add(_preview_entry); - preview_box->add((Gtk::Widget&) _font_da); - - _getContents()->add(*preview_box);*/ _getContents()->show_all(); - -//Settings for the selected SVGFont: -// _font_family.set_label("font-family"); -// _font_variant.set_label("font-variant"); - -// _font_settings.add(_font_family); -// _font_settings.add(_font_variant); } SvgFontsDialog::~SvgFontsDialog(){} -- 2.30.2