Code

Add option to align & distribute dialog to treat the selection as a group (closes...
[inkscape.git] / src / ui / dialog / svg-fonts-dialog.h
index 789ccafcf53c0aeb5f1510e9f5f16fd625dc6bcf..8502a34686d168e682859f76ae3118fa09149d3a 100644 (file)
@@ -14,6 +14,7 @@
 
 #include "ui/widget/panel.h"
 #include "sp-font.h"
+#include "sp-font-face.h"
 #include "verbs.h"
 #include "document.h"
 #include "desktop.h"
 #include <gtkmm/box.h>
 
 #include "display/nr-svgfonts.h"
+#include "attributes.h"
+
 
 class SvgFontDrawingArea : Gtk::DrawingArea{
 public:
     SvgFontDrawingArea();
     void set_text(Glib::ustring);
     void set_svgfont(SvgFont*);
+    void set_size(int x, int y);
     void redraw();
 private:
+    int x,y;
     SvgFont* svgfont;
     Glib::ustring text;
     bool on_expose_event (GdkEventExpose *event);
@@ -45,6 +50,12 @@ namespace Inkscape {
 namespace UI {
 namespace Dialog {
 
+class GlyphComboBox : public Gtk::ComboBoxText {
+public:
+    GlyphComboBox();
+    void update(SPFont*);
+};
+
 class SvgFontsDialog : public UI::Widget::Panel {
 public:
     SvgFontsDialog();
@@ -55,20 +66,42 @@ public:
 
     void update_fonts();
     SvgFont* get_selected_svgfont();
+    SPFont* get_selected_spfont();
     void on_font_selection_changed();
     void on_preview_text_changed();
+    void on_glyphs_changed();
+    void on_kerning_changed();
+    void on_setwidth_changed();
+
+    class AttrEntry : public Gtk::HBox
+       {
+       public:
+           AttrEntry(SvgFontsDialog* d, gchar* lbl, const SPAttributeEnum attr);
+       private:
+           SvgFontsDialog* dialog;
+           void on_attr_changed();
+           Gtk::Entry entry;
+           SPAttributeEnum attr;
+    };
+
 private:
+    Gtk::HBox* AttrCombo(gchar* lbl, const SPAttributeEnum attr);
+//    Gtk::HBox* AttrSpin(gchar* lbl, const SPAttributeEnum attr);
+    Gtk::VBox* global_settings_tab();
+    Gtk::VBox* kerning_tab();
+    Gtk::VBox* glyphs_tab();
+
     class Columns : public Gtk::TreeModel::ColumnRecord
         {
         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;
     };
@@ -77,7 +110,10 @@ private:
     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;
+    SPGlyphKerning* kerning_pair;
+    Gtk::SpinButton kerning_spin, setwidth_spin;
 
     class EntryWidget : public Gtk::HBox
         {