12#ifndef INKSCAPE_UI_DIALOG_SVG_FONTS_H
13#define INKSCAPE_UI_DIALOG_SVG_FONTS_H
15#include <glibmm/property.h>
16#include <gtkmm/combobox.h>
17#include <gtkmm/drawingarea.h>
18#include <gtkmm/entry.h>
19#include <gtkmm/grid.h>
20#include <gtkmm/iconview.h>
21#include <gtkmm/label.h>
22#include <gtkmm/menubutton.h>
23#include <gtkmm/scrolledwindow.h>
24#include <gtkmm/treeview.h>
86 Glib::ObjectBase(typeid(CellRenderer)),
88 _property_active(*this,
"active", true),
89 _property_activatable(*this,
"activatable", true),
90 _property_glyph(*this,
"glyph",
"") {
92 property_mode() = Gtk::CellRendererMode::ACTIVATABLE;
95 Glib::PropertyProxy<Glib::ustring>
property_glyph() {
return _property_glyph.get_proxy(); }
96 Glib::PropertyProxy<bool>
property_active() {
return _property_active.get_proxy(); }
100 return _signal_clicked;
124 void snapshot_vfunc(Glib::RefPtr<Gtk::Snapshot>
const& snapshot,
126 Gdk::Rectangle
const &background_area,
127 Gdk::Rectangle
const &cell_area,
128 Gtk::CellRendererState flags)
final;
130 bool activate_vfunc(Glib::RefPtr<Gdk::Event const>
const &event,
132 Glib::ustring
const &path,
133 Gdk::Rectangle
const &background_area,
134 Gdk::Rectangle
const &cell_area,
135 Gtk::CellRendererState flags)
final;
139 min_w = nat_w = _width;
144 min_h = nat_h = _height;
156 sigc::signal<void (Glib::RefPtr<Gdk::Event const>
const &,
167 void documentReplaced() final;
170 void update_fonts(
bool document_replaced);
171 SvgFont* get_selected_svgfont();
172 SPFont* get_selected_spfont();
176 void on_font_selection_changed();
177 void on_kerning_pair_selection_changed();
178 void on_preview_text_changed();
179 void on_kerning_pair_changed();
180 void on_kerning_value_changed();
181 void on_setfontdata_changed();
189 void set_text(
const char*);
194 void on_attr_changed();
204 void set_value(
double v);
205 void set_range(
double low,
double high);
210 void on_attr_changed();
218 void update_glyphs(
SPGlyph* changed_glyph =
nullptr);
219 void update_glyph(
SPGlyph* glyph);
220 void set_glyph_row(Gtk::TreeRow &row,
SPGlyph &glyph);
221 void refresh_svgfont();
222 void update_sensitiveness();
223 void update_global_settings_tab();
224 void populate_glyphs_box();
225 void populate_kerning_pairs_box();
226 void set_glyph_description_from_selected_path();
227 void missing_glyph_description_from_selected_path();
228 void reset_missing_glyph_description();
230 void glyph_unicode_edit(
const Glib::ustring&,
const Glib::ustring&);
231 void glyph_name_edit(
const Glib::ustring&,
const Glib::ustring&);
232 void glyph_advance_edit(
const Glib::ustring&,
const Glib::ustring&);
233 void remove_selected_glyph();
234 void remove_selected_font();
235 void remove_selected_kerning_pair();
238 void add_kerning_pair();
240 Gtk::TreeModel::iterator get_selected_glyph_iter();
241 void set_selected_glyph(
SPGlyph* glyph);
242 void edit_glyph(
SPGlyph* glyph);
243 void sort_glyphs(
SPFont* font);
249 Gtk::Box* AttrCombo(gchar* lbl,
const SPAttr attr);
250 Gtk::Box* global_settings_tab();
267 Gtk::Box* kerning_tab();
268 Gtk::Box* glyphs_tab();
272 class Columns :
public Gtk::TreeModel::ColumnRecord
283 Gtk::TreeModelColumn<Glib::ustring>
label;
334 Gtk::TreeModelColumn<SPGlyphKerning *>
spnode;
349 bool _show_glyph_list =
true;
350 void set_glyphs_view_mode(
bool list);
362 :
Gtk::Box(
Gtk::Orientation::HORIZONTAL) {
367 this->_label.set_text(l);
Lookup dictionary for attributes/properties.
DialogBase is the base class for the dialog system.
Inkscape::UI::Widget::SpinButton * getSpin()
Inkscape::UI::Widget::SpinButton spin
Gtk::TreeModelColumn< SPFont * > spfont
Gtk::TreeModelColumn< Glib::ustring > label
Gtk::TreeModelColumn< SvgFont * > svgfont
void set_label(const gchar *l)
Gtk::TreeModelColumn< Glib::ustring > glyph_name
Gtk::TreeModelColumn< SPGlyph * > glyph_node
Gtk::TreeModelColumn< double > advance
Gtk::TreeModelColumn< Glib::ustring > name_markup
Gtk::TreeModelColumn< Glib::ustring > UplusCode
Gtk::TreeModelColumn< Glib::ustring > unicode
Gtk::TreeModelColumn< Glib::ustring > second_glyph
Gtk::TreeModelColumn< Glib::ustring > first_glyph
Gtk::TreeModelColumn< double > kerning_value
Gtk::TreeModelColumn< SPGlyphKerning * > spnode
std::unique_ptr< AttrEntry > _familyname_entry
Gtk::ScrolledWindow _fonts_scroller
Glib::RefPtr< Gtk::ListStore > _GlyphsListStore
SPGlyphKerning * kerning_pair
KerningPairColumns _KerningPairsListColumns
Gtk::Button add_kernpair_button
GlyphsColumns _GlyphsListColumns
Inkscape::XML::SignalObserver _glyphs_observer
std::unique_ptr< AttrSpin > _horiz_adv_x_spin
std::unique_ptr< AttrSpin > _ascent_spin
Gtk::TreeView _KerningPairsList
std::unique_ptr< AttrSpin > _x_height_spin
Gtk::Scale * kerning_slider
Glib::RefPtr< Gtk::ListStore > _model
Inkscape::UI::Widget::SpinButton setwidth_spin
Gtk::TreeView _GlyphsList
GlyphMenuButton first_glyph
Gtk::ScrolledWindow _KerningPairsListScroller
Gtk::Label * _font_face_label
SvgFontDrawingArea _font_da
std::unique_ptr< AttrSpin > _descent_spin
sigc::scoped_connection _defs_observer_connection
Inkscape::XML::SignalObserver _defs_observer
Glib::RefPtr< Gtk::ListStore > _KerningPairsListStore
Gtk::Entry _preview_entry
Gtk::IconView _glyphs_grid
Gtk::ScrolledWindow _glyphs_icon_scroller
std::unique_ptr< AttrSpin > _units_per_em_spin
std::unique_ptr< AttrSpin > _horiz_origin_x_spin
std::unique_ptr< AttrSpin > _cap_height_spin
Gtk::ScrolledWindow _GlyphsListScroller
std::unique_ptr< AttrSpin > _horiz_origin_y_spin
Glib::PropertyProxy< Glib::ustring > property_glyph()
Glib::Property< bool > _property_activatable
void set_font_size(int size)
void set_cell_size(int w, int h)
void get_preferred_width_vfunc(Gtk::Widget &widget, int &min_w, int &nat_w) const final
Glib::Property< bool > _property_active
Glib::PropertyProxy< bool > property_activatable()
Glib::PropertyProxy< bool > property_active()
void set_svg_font(SvgFont *font)
void get_preferred_height_vfunc(Gtk::Widget &widget, int &min_h, int &nat_h) const final
void set_tree(Gtk::Widget *tree)
sigc::signal< void(Glib::RefPtr< Gdk::Event const > const &, Glib::ustring const &)> _signal_clicked
Glib::Property< Glib::ustring > _property_glyph
void set_svgfont(SvgFont *)
void set_text(Glib::ustring)
void draw_func(Cairo::RefPtr< Cairo::Context > const &cr, int width, int height)
void set_size(int x, int y)
A base class for all dialogs.
Util::TreeifyResult const & _tree
TODO: insert short description here.
void append(std::vector< T > &vec, std::vector< T > const &other)