summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d4c33c0)
raw | patch | inline | side by side (parent: d4c33c0)
author | JucaBlues <JucaBlues@users.sourceforge.net> | |
Sat, 12 Jul 2008 11:27:58 +0000 (11:27 +0000) | ||
committer | JucaBlues <JucaBlues@users.sourceforge.net> | |
Sat, 12 Jul 2008 11:27:58 +0000 (11:27 +0000) |
src/ui/dialog/svg-fonts-dialog.cpp | patch | blob | history | |
src/ui/dialog/svg-fonts-dialog.h | patch | blob | history |
index 53fd8cd0fa31283ea3aceee7384b2efedb541bcb..d280853675d16e89bc1fff6919816fb241c73aea 100644 (file)
#ifdef ENABLE_SVG_FONTS
#include "svg-fonts-dialog.h"
+#include <string.h>
SvgFontDrawingArea::SvgFontDrawingArea(){
this->text = "";
void GlyphComboBox::update(SPFont* spfont){
if (spfont) {
+ this->clear();
for(SPObject* node = spfont->children; node; node=node->next){
if (SP_IS_GLYPH(node)){
- g_warning("glyphCombo unicode='%s'", ((SPGlyph*)node)->unicode);
+ this->append_text(((SPGlyph*)node)->unicode);
}
}
}
}
+void SvgFontsDialog::on_glyphs_changed(){
+ std::string str1(first_glyph.get_active_text());
+ std::string str2(second_glyph.get_active_text());
+ kerning_preview.set_text((gchar*) (str1+str2).c_str());
+ kerning_preview.redraw();
+}
/* Add all fonts in the document to the combobox. */
void SvgFontsDialog::update_fonts()
void SvgFontsDialog::on_font_selection_changed(){
first_glyph.update(this->get_selected_spfont());
second_glyph.update(this->get_selected_spfont());
+ kerning_preview.set_svgfont(this->get_selected_svgfont());
_font_da.set_svgfont(this->get_selected_svgfont());
_font_da.redraw();
}
Gtk::HBox* kerning_selector = Gtk::manage(new Gtk::HBox());
kerning_selector->add(first_glyph);
kerning_selector->add(second_glyph);
+ first_glyph.signal_changed().connect(sigc::mem_fun(*this, &SvgFontsDialog::on_glyphs_changed));
+ second_glyph.signal_changed().connect(sigc::mem_fun(*this, &SvgFontsDialog::on_glyphs_changed));
Gtk::SpinButton* kerning_spin = Gtk::manage(new Gtk::SpinButton());
kernvbox->add(*kerning_selector);
index 7efa380fbd9f98229cd42597aafea0aa4de23959..09378130c971ded1de1e35b15ae12d76f10548b9 100644 (file)
namespace UI {
namespace Dialog {
-class GlyphComboBox : public Gtk::Combo {
+class GlyphComboBox : public Gtk::ComboBoxText {
public:
GlyphComboBox();
void update(SPFont*);
SPFont* get_selected_spfont();
void on_font_selection_changed();
void on_preview_text_changed();
+ void on_glyphs_changed();
private:
class Columns : public Gtk::TreeModel::ColumnRecord
{