summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/glyphs.cpp
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2013-03-01 16:48:58 +0000
committertavmjong-free <tavmjong@free.fr>2013-03-01 16:48:58 +0000
commitf71eb7bbf5a09eb685c655762465cea23f5f9aee (patch)
treeaecebd436d44f1c2569d7a54c5a9dd7001b482a8 /src/ui/dialog/glyphs.cpp
parentPatch generated locale Makefile to give correct installation folder (diff)
downloadinkscape-f71eb7bbf5a09eb685c655762465cea23f5f9aee.tar.gz
inkscape-f71eb7bbf5a09eb685c655762465cea23f5f9aee.zip
Convert font-selector, text-edit, glyphs to use updated font-lister (use fontspec rather than font).
(bzr r12164)
Diffstat (limited to 'src/ui/dialog/glyphs.cpp')
-rw-r--r--src/ui/dialog/glyphs.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/ui/dialog/glyphs.cpp b/src/ui/dialog/glyphs.cpp
index eec904ee4..be44794d0 100644
--- a/src/ui/dialog/glyphs.cpp
+++ b/src/ui/dialog/glyphs.cpp
@@ -1,6 +1,7 @@
/* Authors:
* Jon A. Cruz
* Abhishek Sharma
+ * Tavmjong Bah
*
* Copyright (C) 2010 Jon A. Cruz
* Released under GNU GPL, read the file 'COPYING' for more information
@@ -343,7 +344,8 @@ GlyphsPanel::GlyphsPanel(gchar const *prefsPath) :
GtkWidget *fontsel = sp_font_selector_new();
fsel = SP_FONT_SELECTOR(fontsel);
- sp_font_selector_set_font(fsel, sp_font_selector_get_font(fsel), 12.0);
+ sp_font_selector_set_fontspec( fsel, sp_font_selector_get_fontspec(fsel), 12.0 );
+
gtk_widget_set_size_request (fontsel, 0, 150);
g_signal_connect( G_OBJECT(fontsel), "font_set", G_CALLBACK(fontChangeCB), this );
@@ -520,6 +522,7 @@ void GlyphsPanel::setTargetDesktop(SPDesktop *desktop)
}
}
+// Append selected glyphs to selected text
void GlyphsPanel::insertText()
{
SPItem *textItem = 0;
@@ -611,7 +614,7 @@ void GlyphsPanel::glyphSelectionChanged()
calcCanInsert();
}
-void GlyphsPanel::fontChangeCB(SPFontSelector * /*fontsel*/, font_instance * /*font*/, GlyphsPanel *self)
+void GlyphsPanel::fontChangeCB(SPFontSelector * /*fontsel*/, Glib::ustring /*fontspec*/, GlyphsPanel *self)
{
if (self) {
self->rebuild();
@@ -667,7 +670,13 @@ void GlyphsPanel::readSelection( bool updateStyle, bool /*updateContent*/ )
void GlyphsPanel::rebuild()
{
- font_instance *font = fsel ? sp_font_selector_get_font(fsel) : 0;
+ Glib::ustring fontspec = fsel ? sp_font_selector_get_fontspec(fsel) : "";
+
+ font_instance* font = 0;
+ if( !fontspec.empty() ) {
+ font = font_factory::Default()->FaceFromFontSpecification( fontspec.c_str() );
+ }
+
if (font) {
//double sp_font_selector_get_size (SPFontSelector *fsel);