summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 645f584)
raw | patch | inline | side by side (parent: 645f584)
author | JucaBlues <JucaBlues@users.sourceforge.net> | |
Sat, 12 Jul 2008 10:41:34 +0000 (10:41 +0000) | ||
committer | JucaBlues <JucaBlues@users.sourceforge.net> | |
Sat, 12 Jul 2008 10:41:34 +0000 (10:41 +0000) |
src/ui/dialog/svg-fonts-dialog.cpp | patch | blob | history | |
src/ui/dialog/svg-fonts-dialog.h | patch | blob | history |
index 24bd7ae2856a23a3f6e63d9ae42662e7c72b58ff..53fd8cd0fa31283ea3aceee7384b2efedb541bcb 100644 (file)
/*** SvgFontsDialog ***/
+GlyphComboBox::GlyphComboBox(){
+}
+
+void GlyphComboBox::update(SPFont* spfont){
+ if (spfont) {
+ for(SPObject* node = spfont->children; node; node=node->next){
+ if (SP_IS_GLYPH(node)){
+ g_warning("glyphCombo unicode='%s'", ((SPGlyph*)node)->unicode);
+ }
+ }
+ }
+}
+
+
/* Add all fonts in the document to the combobox. */
void SvgFontsDialog::update_fonts()
{
for(const GSList *l = fonts; l; l = l->next) {
Gtk::TreeModel::Row row = *_model->append();
SPFont* f = (SPFont*)l->data;
- row[_columns.font] = f;
+ row[_columns.spfont] = f;
row[_columns.svgfont] = new SvgFont(f);
const gchar* lbl = f->label();
const gchar* id = SP_OBJECT_ID(f);
}
void SvgFontsDialog::on_font_selection_changed(){
+ first_glyph.update(this->get_selected_spfont());
+ second_glyph.update(this->get_selected_spfont());
_font_da.set_svgfont(this->get_selected_svgfont());
_font_da.redraw();
}
return NULL;
}
+SPFont* SvgFontsDialog::get_selected_spfont()
+{
+ Gtk::TreeModel::iterator i = _font_list.get_selection()->get_selected();
+ if(i)
+ return (*i)[_columns.spfont];
+ return NULL;
+}
+
SvgFontsDialog::SvgFontsDialog()
: UI::Widget::Panel("", "dialogs.svgfonts", SP_VERB_DIALOG_SVG_FONTS)
{
this->update_fonts();
+//kerning setup:
+ Gtk::VBox* kernvbox = Gtk::manage(new Gtk::VBox());
+ _font_settings.add(*kernvbox);
+ kernvbox->add(*Gtk::manage(new Gtk::Label("Kerning Setup:")));
+ Gtk::HBox* kerning_selector = Gtk::manage(new Gtk::HBox());
+ kerning_selector->add(first_glyph);
+ kerning_selector->add(second_glyph);
+
+ Gtk::SpinButton* kerning_spin = Gtk::manage(new Gtk::SpinButton());
+ kernvbox->add(*kerning_selector);
+ kernvbox->add((Gtk::Widget&) kerning_preview);
+ kernvbox->add(*kerning_spin);
+
//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:")));
index 789ccafcf53c0aeb5f1510e9f5f16fd625dc6bcf..7efa380fbd9f98229cd42597aafea0aa4de23959 100644 (file)
namespace UI {
namespace Dialog {
+class GlyphComboBox : public Gtk::Combo {
+public:
+ GlyphComboBox();
+ void update(SPFont*);
+};
+
class SvgFontsDialog : public UI::Widget::Panel {
public:
SvgFontsDialog();
void update_fonts();
SvgFont* get_selected_svgfont();
+ SPFont* get_selected_spfont();
void on_font_selection_changed();
void on_preview_text_changed();
private:
public:
Columns()
{
- add(font);
+ add(spfont);
add(svgfont);
add(label);
}
- Gtk::TreeModelColumn<SPFont*> font;
+ Gtk::TreeModelColumn<SPFont*> spfont;
Gtk::TreeModelColumn<SvgFont*> svgfont;
Gtk::TreeModelColumn<Glib::ustring> label;
};
Gtk::TreeView _font_list;
Gtk::VBox _font_settings;
Gtk::Entry _preview_entry;
- SvgFontDrawingArea _font_da;
+ SvgFontDrawingArea _font_da, kerning_preview;
+ GlyphComboBox first_glyph, second_glyph;
class EntryWidget : public Gtk::HBox
{