summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFelipe Corr??a da Silva Sanches <juca@members.fsf.org>2008-12-29 11:00:44 +0000
committerJucaBlues <JucaBlues@users.sourceforge.net>2008-12-29 11:00:44 +0000
commit9fb1ffa7e49a9cf53d07fae3f7abbad7578f96dc (patch)
tree5af405c58bb1382869ecd3b5c0a2f2a431c7daa2 /src
parentfix crash, allow combine to work transparently on groups (diff)
downloadinkscape-9fb1ffa7e49a9cf53d07fae3f7abbad7578f96dc.tar.gz
inkscape-9fb1ffa7e49a9cf53d07fae3f7abbad7578f96dc.zip
fixing the upside-down glyph issue for the missing-glyph case (which I
had forgoten previously) Also fixing a crash reported by prokoudine (bzr r7037)
Diffstat (limited to 'src')
-rw-r--r--src/ui/dialog/svg-fonts-dialog.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/ui/dialog/svg-fonts-dialog.cpp b/src/ui/dialog/svg-fonts-dialog.cpp
index 6ef8fa729..e2a5c196a 100644
--- a/src/ui/dialog/svg-fonts-dialog.cpp
+++ b/src/ui/dialog/svg-fonts-dialog.cpp
@@ -453,8 +453,10 @@ void SvgFontsDialog::set_glyph_description_from_selected_path(){
if (sel->isEmpty()) return;
Inkscape::XML::Node* node = (Inkscape::XML::Node*) g_slist_nth_data((GSList *)sel->reprList(), 0);
if (!node || !node->matchAttributeName("d")) return;
+ if (!node->attribute("d")) return; //TODO: give a message to the user
Geom::PathVector pathv = sp_svg_read_pathv(node->attribute("d"));
+
//This matrix flips the glyph vertically
Geom::Matrix m(Geom::Coord(1),Geom::Coord(0),Geom::Coord(0),Geom::Coord(-1),Geom::Coord(0),Geom::Coord(0));
pathv*=m;
@@ -473,11 +475,20 @@ void SvgFontsDialog::missing_glyph_description_from_selected_path(){
if (sel->isEmpty()) return;
Inkscape::XML::Node* node = (Inkscape::XML::Node*) g_slist_nth_data((GSList *)sel->reprList(), 0);
if (!node || !node->matchAttributeName("d")) return;
+ if (!node->attribute("d")) return; //TODO: give a message to the user
+
+ Geom::PathVector pathv = sp_svg_read_pathv(node->attribute("d"));
+
+ //This matrix flips the glyph vertically
+ Geom::Matrix m(Geom::Coord(1),Geom::Coord(0),Geom::Coord(0),Geom::Coord(-1),Geom::Coord(0),Geom::Coord(0));
+ pathv*=m;
+ //then we offset it
+ pathv+=Geom::Point(Geom::Coord(0),Geom::Coord(get_selected_spfont()->horiz_adv_x));
SPObject* obj;
for (obj = get_selected_spfont()->children; obj; obj=obj->next){
if (SP_IS_MISSING_GLYPH(obj)){
- obj->repr->setAttribute("d", (char*) node->attribute("d"));
+ obj->repr->setAttribute("d", (char*) sp_svg_write_path (pathv));
sp_document_done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Set glyph curves"));
}
}