summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/live_effects/parameter/path.cpp4
-rw-r--r--src/ui/dialog/svg-fonts-dialog.cpp6
-rw-r--r--src/ui/dialog/svg-fonts-dialog.h206
3 files changed, 112 insertions, 104 deletions
diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp
index bed191e83..f0c494267 100644
--- a/src/live_effects/parameter/path.cpp
+++ b/src/live_effects/parameter/path.cpp
@@ -237,7 +237,6 @@ PathParam::param_editOncanvas(SPItem *item, SPDesktop * dt)
r.role = SHAPE_ROLE_LPE_PARAM;
r.edit_transform = item->i2dt_affine(); // TODO is it right?
- r.edit_transform *= item->transform.inverse();
if (!href) {
r.item = reinterpret_cast<SPItem*>(param_effect->getLPEObj());
r.lpe_key = param_key;
@@ -458,8 +457,7 @@ PathParam::paste_param_path(const char *svgd)
SPItem * item = SP_ACTIVE_DESKTOP->getSelection()->singleItem();
if (item != NULL) {
Geom::PathVector path_clipboard = sp_svg_read_pathv(svgd);
- path_clipboard *= item->i2doc_affine().inverse() * item->transform;
- path_clipboard *= Geom::Translate(path_clipboard.initialPoint() - _pathvector.initialPoint()).inverse();
+ path_clipboard *= item->i2doc_affine().inverse();
svgd = sp_svg_write_path( path_clipboard );
}
diff --git a/src/ui/dialog/svg-fonts-dialog.cpp b/src/ui/dialog/svg-fonts-dialog.cpp
index 790c0e5fb..a39955123 100644
--- a/src/ui/dialog/svg-fonts-dialog.cpp
+++ b/src/ui/dialog/svg-fonts-dialog.cpp
@@ -266,7 +266,7 @@ void SvgFontsDialog::update_fonts()
{
SPDesktop* desktop = this->getDesktop();
SPDocument* document = desktop->getDocument();
- std::vector<SPObject *> fonts = document->getResourceList( "fonts" );
+ std::vector<SPObject *> fonts = document->getResourceList( "font" );
_model->clear();
for (std::vector<SPObject *>::const_iterator it = fonts.begin(); it != fonts.end(); ++it) {
@@ -340,7 +340,7 @@ void SvgFontsDialog::on_font_selection_changed(){
update_sensitiveness();
}
-void SvgFontsDialog::on_setwidth_changed(){
+void SvgFontsDialog::on_setfontdata_changed(){
SPFont* spfont = this->get_selected_spfont();
if (spfont){
spfont->horiz_adv_x = setwidth_spin.get_value();
@@ -397,7 +397,7 @@ Gtk::VBox* SvgFontsDialog::global_settings_tab(){
setwidth_hbox->add(*Gtk::manage(new Gtk::Label(_("Set width:"))));
setwidth_hbox->add(setwidth_spin);
- setwidth_spin.signal_changed().connect(sigc::mem_fun(*this, &SvgFontsDialog::on_setwidth_changed));
+ setwidth_spin.signal_changed().connect(sigc::mem_fun(*this, &SvgFontsDialog::on_setfontdata_changed));
setwidth_spin.set_range(0, 4096);
setwidth_spin.set_increments(10, 0);
global_vbox.pack_start(*setwidth_hbox, false, false);
diff --git a/src/ui/dialog/svg-fonts-dialog.h b/src/ui/dialog/svg-fonts-dialog.h
index e5c4631e4..e80bbfd39 100644
--- a/src/ui/dialog/svg-fonts-dialog.h
+++ b/src/ui/dialog/svg-fonts-dialog.h
@@ -69,64 +69,63 @@ public:
SvgFontsDialog();
~SvgFontsDialog();
- static SvgFontsDialog &getInstance()
- { return *new SvgFontsDialog(); }
+ static SvgFontsDialog &getInstance() { return *new SvgFontsDialog(); }
void update_fonts();
SvgFont* get_selected_svgfont();
SPFont* get_selected_spfont();
- SPGlyph* get_selected_glyph();
- SPGlyphKerning* get_selected_kerning_pair();
+ SPGlyph* get_selected_glyph();
+ SPGlyphKerning* get_selected_kerning_pair();
- //TODO: these methods should be private, right?!
+ //TODO: these methods should be private, right?!
void on_font_selection_changed();
- void on_kerning_pair_selection_changed();
+ void on_kerning_pair_selection_changed();
void on_preview_text_changed();
void on_kerning_pair_changed();
void on_kerning_value_changed();
- void on_setwidth_changed();
- void add_font();
- Geom::PathVector flip_coordinate_system(Geom::PathVector pathv);
+ void on_setfontdata_changed();
+ void add_font();
+ Geom::PathVector flip_coordinate_system(Geom::PathVector pathv);
- //TODO: AttrEntry is currently unused. Should we remove it?
+ //TODO: AttrEntry is currently unused. Should we remove it?
class AttrEntry : public Gtk::HBox
- {
- public:
- AttrEntry(SvgFontsDialog* d, gchar* lbl, const SPAttributeEnum attr);
- void set_text(char*);
- private:
- SvgFontsDialog* dialog;
- void on_attr_changed();
- Gtk::Entry entry;
- SPAttributeEnum attr;
+ {
+ public:
+ AttrEntry(SvgFontsDialog* d, gchar* lbl, const SPAttributeEnum attr);
+ void set_text(char*);
+ private:
+ SvgFontsDialog* dialog;
+ void on_attr_changed();
+ Gtk::Entry entry;
+ SPAttributeEnum attr;
};
private:
- void update_glyphs();
- void update_sensitiveness();
- void update_global_settings_tab();
- void populate_glyphs_box();
+ void update_glyphs();
+ void update_sensitiveness();
+ void update_global_settings_tab();
+ void populate_glyphs_box();
void populate_kerning_pairs_box();
- void set_glyph_description_from_selected_path();
- void missing_glyph_description_from_selected_path();
- void reset_missing_glyph_description();
- void add_glyph();
- void glyph_unicode_edit(const Glib::ustring&, const Glib::ustring&);
- void glyph_name_edit(const Glib::ustring&, const Glib::ustring&);
- void remove_selected_glyph();
- void remove_selected_font();
- void remove_selected_kerning_pair();
+ void set_glyph_description_from_selected_path();
+ void missing_glyph_description_from_selected_path();
+ void reset_missing_glyph_description();
+ void add_glyph();
+ void glyph_unicode_edit(const Glib::ustring&, const Glib::ustring&);
+ void glyph_name_edit(const Glib::ustring&, const Glib::ustring&);
+ void remove_selected_glyph();
+ void remove_selected_font();
+ void remove_selected_kerning_pair();
- void add_kerning_pair();
+ void add_kerning_pair();
- void create_glyphs_popup_menu(Gtk::Widget& parent, sigc::slot<void> rem);
- void glyphs_list_button_release(GdkEventButton* event);
+ void create_glyphs_popup_menu(Gtk::Widget& parent, sigc::slot<void> rem);
+ void glyphs_list_button_release(GdkEventButton* event);
- void create_fonts_popup_menu(Gtk::Widget& parent, sigc::slot<void> rem);
- void fonts_list_button_release(GdkEventButton* event);
+ void create_fonts_popup_menu(Gtk::Widget& parent, sigc::slot<void> rem);
+ void fonts_list_button_release(GdkEventButton* event);
- void create_kerning_pairs_popup_menu(Gtk::Widget& parent, sigc::slot<void> rem);
- void kerning_pairs_list_button_release(GdkEventButton* event);
+ void create_kerning_pairs_popup_menu(Gtk::Widget& parent, sigc::slot<void> rem);
+ void kerning_pairs_list_button_release(GdkEventButton* event);
Inkscape::XML::SignalObserver _defs_observer; //in order to update fonts
Inkscape::XML::SignalObserver _glyphs_observer;
@@ -134,47 +133,47 @@ private:
Gtk::HBox* AttrCombo(gchar* lbl, const SPAttributeEnum attr);
// Gtk::HBox* AttrSpin(gchar* lbl, const SPAttributeEnum attr);
Gtk::VBox* global_settings_tab();
- AttrEntry* _familyname_entry;
+ AttrEntry* _familyname_entry;
Gtk::VBox* kerning_tab();
Gtk::VBox* glyphs_tab();
Gtk::Button _add;
Gtk::Button add_glyph_button;
- Gtk::Button glyph_from_path_button;
- Gtk::Button missing_glyph_button;
- Gtk::Button missing_glyph_reset_button;
+ Gtk::Button glyph_from_path_button;
+ Gtk::Button missing_glyph_button;
+ Gtk::Button missing_glyph_reset_button;
class Columns : public Gtk::TreeModel::ColumnRecord
- {
- public:
- Columns()
- {
- add(spfont);
- add(svgfont);
- add(label);
- }
-
- Gtk::TreeModelColumn<SPFont*> spfont;
- Gtk::TreeModelColumn<SvgFont*> svgfont;
- Gtk::TreeModelColumn<Glib::ustring> label;
+ {
+ public:
+ Columns()
+ {
+ add(spfont);
+ add(svgfont);
+ add(label);
+ }
+
+ Gtk::TreeModelColumn<SPFont*> spfont;
+ Gtk::TreeModelColumn<SvgFont*> svgfont;
+ Gtk::TreeModelColumn<Glib::ustring> label;
};
Glib::RefPtr<Gtk::ListStore> _model;
Columns _columns;
Gtk::TreeView _FontsList;
class GlyphsColumns : public Gtk::TreeModel::ColumnRecord
- {
- public:
- GlyphsColumns()
- {
- add(glyph_node);
- add(glyph_name);
- add(unicode);
- }
-
- Gtk::TreeModelColumn<SPGlyph*> glyph_node;
- Gtk::TreeModelColumn<Glib::ustring> glyph_name;
- Gtk::TreeModelColumn<Glib::ustring> unicode;
+ {
+ public:
+ GlyphsColumns()
+ {
+ add(glyph_node);
+ add(glyph_name);
+ add(unicode);
+ }
+
+ Gtk::TreeModelColumn<SPGlyph*> glyph_node;
+ Gtk::TreeModelColumn<Glib::ustring> glyph_name;
+ Gtk::TreeModelColumn<Glib::ustring> unicode;
};
GlyphsColumns _GlyphsListColumns;
Glib::RefPtr<Gtk::ListStore> _GlyphsListStore;
@@ -182,30 +181,30 @@ private:
Gtk::ScrolledWindow _GlyphsListScroller;
class KerningPairColumns : public Gtk::TreeModel::ColumnRecord
- {
- public:
- KerningPairColumns()
- {
- add(first_glyph);
- add(second_glyph);
- add(kerning_value);
- add(spnode);
- }
-
- Gtk::TreeModelColumn<Glib::ustring> first_glyph;
- Gtk::TreeModelColumn<Glib::ustring> second_glyph;
- Gtk::TreeModelColumn<double> kerning_value;
- Gtk::TreeModelColumn<SPGlyphKerning*> spnode;
+ {
+ public:
+ KerningPairColumns()
+ {
+ add(first_glyph);
+ add(second_glyph);
+ add(kerning_value);
+ add(spnode);
+ }
+
+ Gtk::TreeModelColumn<Glib::ustring> first_glyph;
+ Gtk::TreeModelColumn<Glib::ustring> second_glyph;
+ Gtk::TreeModelColumn<double> kerning_value;
+ Gtk::TreeModelColumn<SPGlyphKerning*> spnode;
};
KerningPairColumns _KerningPairsListColumns;
Glib::RefPtr<Gtk::ListStore> _KerningPairsListStore;
Gtk::TreeView _KerningPairsList;
Gtk::ScrolledWindow _KerningPairsListScroller;
- Gtk::Button add_kernpair_button;
+ Gtk::Button add_kernpair_button;
Gtk::VBox _font_settings;
- Gtk::VBox global_vbox;
- Gtk::VBox glyphs_vbox;
+ Gtk::VBox global_vbox;
+ Gtk::VBox glyphs_vbox;
Gtk::VBox kerning_vbox;
Gtk::Entry _preview_entry;
@@ -225,20 +224,20 @@ private:
#endif
class EntryWidget : public Gtk::HBox
- {
- public:
- EntryWidget()
- {
- this->add(this->_label);
- this->add(this->_entry);
- }
- void set_label(const gchar* l){
- this->_label.set_text(l);
- }
- private:
- Gtk::Label _label;
- Gtk::Entry _entry;
- };
+ {
+ public:
+ EntryWidget()
+ {
+ this->add(this->_label);
+ this->add(this->_entry);
+ }
+ void set_label(const gchar* l){
+ this->_label.set_text(l);
+ }
+ private:
+ Gtk::Label _label;
+ Gtk::Entry _entry;
+ };
EntryWidget _font_family, _font_variant;
};
@@ -247,3 +246,14 @@ private:
} // namespace Inkscape
#endif //#ifndef INKSCAPE_UI_DIALOG_SVG_FONTS_H
+
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :