diff options
| author | Felipe Corr??a da Silva Sanches <juca@members.fsf.org> | 2008-07-12 11:27:58 +0000 |
|---|---|---|
| committer | JucaBlues <JucaBlues@users.sourceforge.net> | 2008-07-12 11:27:58 +0000 |
| commit | 760a380b06c6b42019a55824e3fe5fa07948c3c8 (patch) | |
| tree | c86cebde06f499b7675ab906fb69fe4c92bfc4e1 /src | |
| parent | glyph-kerning setup user interface (not functional yet, just the gtk UI sketch) (diff) | |
| download | inkscape-760a380b06c6b42019a55824e3fe5fa07948c3c8.tar.gz inkscape-760a380b06c6b42019a55824e3fe5fa07948c3c8.zip | |
kerning pairs already can be selected but kerning value still cant be set
(bzr r6268)
Diffstat (limited to 'src')
| -rw-r--r-- | src/ui/dialog/svg-fonts-dialog.cpp | 13 | ||||
| -rw-r--r-- | src/ui/dialog/svg-fonts-dialog.h | 3 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/ui/dialog/svg-fonts-dialog.cpp b/src/ui/dialog/svg-fonts-dialog.cpp index 53fd8cd0f..d28085367 100644 --- a/src/ui/dialog/svg-fonts-dialog.cpp +++ b/src/ui/dialog/svg-fonts-dialog.cpp @@ -16,6 +16,7 @@ #ifdef ENABLE_SVG_FONTS #include "svg-fonts-dialog.h" +#include <string.h> SvgFontDrawingArea::SvgFontDrawingArea(){ this->text = ""; @@ -58,14 +59,21 @@ GlyphComboBox::GlyphComboBox(){ 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() @@ -95,6 +103,7 @@ void SvgFontsDialog::on_preview_text_changed(){ 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(); } @@ -138,6 +147,8 @@ SvgFontsDialog::SvgFontsDialog() 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); diff --git a/src/ui/dialog/svg-fonts-dialog.h b/src/ui/dialog/svg-fonts-dialog.h index 7efa380fb..09378130c 100644 --- a/src/ui/dialog/svg-fonts-dialog.h +++ b/src/ui/dialog/svg-fonts-dialog.h @@ -45,7 +45,7 @@ namespace Inkscape { namespace UI { namespace Dialog { -class GlyphComboBox : public Gtk::Combo { +class GlyphComboBox : public Gtk::ComboBoxText { public: GlyphComboBox(); void update(SPFont*); @@ -64,6 +64,7 @@ public: 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 { |
