summaryrefslogtreecommitdiffstats
path: root/src/sp-glyph.cpp
diff options
context:
space:
mode:
authorFelipe Corr??a da Silva Sanches <juca@members.fsf.org>2008-12-28 18:35:14 +0000
committerJucaBlues <JucaBlues@users.sourceforge.net>2008-12-28 18:35:14 +0000
commitc3e30311de25dc8b874ce99ccdb864e0a18cf7d6 (patch)
tree1a9d0a2de159bd94fab214717136e1474d4db08c /src/sp-glyph.cpp
parentMakes sure a Gaussian filter is applied to premultiplied data. (diff)
downloadinkscape-c3e30311de25dc8b874ce99ccdb864e0a18cf7d6.tar.gz
inkscape-c3e30311de25dc8b874ce99ccdb864e0a18cf7d6.zip
Now users can design a font within inkscape, save it and then open the
SVG file in Fontforge in order to export a truetype font (or other system font formarts fontforge supports). This improves previous workflow of font design using Inkscape which involved creating one SVG for each glyph. Now user only needs to create a single SVG file containing an SVGFont. Glyph kerning settings for the font can also be defined withing Inkscape itself with live preview. The kerning management still needs some improvements but is currently functional at least. Improvements in the SVGFonts dialog: * In Global Settings tab you can define the font family name. Other attributes should be added to this tab in the future. * Glyphs tab allows the user to: ** see a list (combobox) of glyphs available in the currently selected font. ** add/remove glyphs ** edit glyph name and unicode ** set the glyph curves based on a given path (selected from canvas). Same feature for the missing glyph. * Kerning tab allows user to: ** add new kerning pairs ** adjust kerning values of selected kerning pair ** live preview while adjusting the kerning values Code refactoring: * Inner classes DocumentProperties::SignalObserver and FilterEffectsDialog::SignalObserver were duplicated code and another instance would be needed in SVGFonts dialog. So, I moved it to Inkscape::XML::SignalObserver (in helper-observer.{cpp,h}) * changed SPGlyph->glyph_name and SPGlyph->unicode from char* to Glib::ustring * added sp_remove_resource to the release method in sp-font.cpp * glyph curves used to be stored (in d attribute) and rendered upside-down. Now that bug is fixed. Sorry about this huge commit. I got one week away from the Internet during a xmas travel. The lack of 'net connection made me work more intensely in Inkscape :-D Felipe Sanches (bzr r7029)
Diffstat (limited to 'src/sp-glyph.cpp')
-rw-r--r--src/sp-glyph.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/sp-glyph.cpp b/src/sp-glyph.cpp
index fb7cea15d..8af78a0aa 100644
--- a/src/sp-glyph.cpp
+++ b/src/sp-glyph.cpp
@@ -72,8 +72,9 @@ static void sp_glyph_class_init(SPGlyphClass *gc)
static void sp_glyph_init(SPGlyph *glyph)
{
//TODO: correct these values:
- glyph->unicode = NULL;
- glyph->glyph_name = NULL;
+
+ new (&glyph->unicode) Glib::ustring();
+ new (&glyph->glyph_name) Glib::ustring();
glyph->d = NULL;
glyph->orientation = GLYPH_ORIENTATION_BOTH;
glyph->arabic_form = GLYPH_ARABIC_FORM_INITIAL;
@@ -151,13 +152,13 @@ static void sp_glyph_set(SPObject *object, unsigned int key, const gchar *value)
switch (key) {
case SP_ATTR_UNICODE:
- if (glyph->unicode) g_free(glyph->unicode);
- glyph->unicode = g_strdup(value);
+ glyph->unicode.clear();
+ if (value) glyph->unicode.append(value);
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
break;
case SP_ATTR_GLYPH_NAME:
- if (glyph->glyph_name) g_free(glyph->glyph_name);
- glyph->glyph_name = g_strdup(value);
+ glyph->glyph_name.clear();
+ if (value) glyph->glyph_name.append(value);
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
break;
case SP_ATTR_D: