Code

fix crash on svnfonts dialog
authorJucaBlues <JucaBlues@users.sourceforge.net>
Sat, 12 Jul 2008 03:57:00 +0000 (03:57 +0000)
committerJucaBlues <JucaBlues@users.sourceforge.net>
Sat, 12 Jul 2008 03:57:00 +0000 (03:57 +0000)
src/display/nr-svgfonts.cpp
src/display/nr-svgfonts.h
src/ui/dialog/svg-fonts-dialog.cpp

index b59d0569de467a6f6161ecfe79dc4cc8f912ce3a..e70b1becaf82e98d0dc8c66bd83c66806f1cf2f1 100644 (file)
@@ -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;
index ff98f521f6879030acb9bad86ee87367c7bd242e..e3bac7d7a083b0ac8ce2ff7c52063cd901ee33ba 100644 (file)
  */
 
 #include "cairo.h"
-//#include <gtkmm.h>
-
 #include <gtkmm/widget.h>
-//#include <gtkmm/window.h>
-//#include <gdkmm/drawable.h>
-//#include <gdkmm/general.h>  // for cairo helper functions
-
 #include "../sp-glyph.h"
 #include "../sp-missing-glyph.h"
 #include "../sp-font.h"
index 5fa90966ccfe0b7849298a09942b293849efc55b..24bd7ae2856a23a3f6e63d9ae42662e7c72b58ff 100644 (file)
@@ -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(){}