diff options
author | Tibor Nagy <xnagytibor@gmail.com> | 2019-12-30 11:40:30 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-12-30 14:02:12 +0100 |
commit | 62d79a77d640432b6cc1c74f9f67061ebd98c0af (patch) | |
tree | 2253ee39500d38d9b7c594439a92f6ce023ec18c /Applications/FontEditor | |
parent | edc35807562967899e84d531886c42589efc8488 (diff) | |
download | serenity-62d79a77d640432b6cc1c74f9f67061ebd98c0af.zip |
FontEditor: Add glyph spacing spinbox
Diffstat (limited to 'Applications/FontEditor')
-rw-r--r-- | Applications/FontEditor/FontEditor.cpp | 7 | ||||
-rw-r--r-- | Applications/FontEditor/FontEditorBottom.frm | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/Applications/FontEditor/FontEditor.cpp b/Applications/FontEditor/FontEditor.cpp index 09f7de7e4d..e622d191b0 100644 --- a/Applications/FontEditor/FontEditor.cpp +++ b/Applications/FontEditor/FontEditor.cpp @@ -41,6 +41,8 @@ FontEditorWidget::FontEditorWidget(const String& path, RefPtr<Font>&& edited_fon m_ui->fixed_width_checkbox->set_text("Fixed width"); m_ui->fixed_width_checkbox->set_checked(m_edited_font->is_fixed_width()); + m_ui->spacing_spinbox->set_value(m_edited_font->glyph_spacing()); + m_ui->path_textbox->set_text(m_path); m_ui->path_textbox->on_change = [this] { m_path = m_ui->path_textbox->text(); @@ -104,6 +106,11 @@ FontEditorWidget::FontEditorWidget(const String& path, RefPtr<Font>&& edited_fon update_demo(); }; + m_ui->spacing_spinbox->on_change = [this, update_demo](int value) { + m_edited_font->set_glyph_spacing(value); + update_demo(); + }; + m_glyph_map_widget->set_selected_glyph('A'); } diff --git a/Applications/FontEditor/FontEditorBottom.frm b/Applications/FontEditor/FontEditorBottom.frm index 4ced8283f6..d0c12834a8 100644 --- a/Applications/FontEditor/FontEditorBottom.frm +++ b/Applications/FontEditor/FontEditorBottom.frm @@ -1 +1 @@ -{"name":"FontEditorBottom","widgets":[{"enabled":true,"forecolor":"#000000ff","autofill":false,"x":5,"tooltip":"[null]","name":"info_label","height":16,"width":66,"y":15,"class":"GLabel","text":"info_label","backcolor":"#d4d0c8ff","visible":true},{"enabled":true,"forecolor":"#00000000","autofill":false,"x":95,"tooltip":null,"name":"demo_label_1","height":16,"width":276,"y":15,"class":"GLabel","text":"demo_label_1","backcolor":"#00000000","visible":true},{"enabled":true,"forecolor":"#00000000","autofill":false,"x":95,"tooltip":null,"name":"demo_label_2","height":16,"width":276,"y":40,"class":"GLabel","text":"demo_label_2","backcolor":"#00000000","visible":true},{"enabled":true,"forecolor":"#00000000","autofill":false,"x":5,"tooltip":null,"name":"label1","height":16,"width":66,"y":40,"class":"GLabel","text":"Glyph width:","backcolor":"#00000000","visible":true},{"forecolor":"#00000000","name":"width_spinbox","height":21,"backcolor":"#00000000","enabled":true,"value":0,"tooltip":null,"max":32,"visible":true,"y":60,"width":71,"autofill":false,"x":5,"class":"GSpinBox","min":0},{"enabled":true,"forecolor":"#00000000","autofill":false,"x":5,"tooltip":null,"name":"gb1","height":71,"width":216,"y":95,"class":"GGroupBox","backcolor":"#d4d0c8ff","title":"Font metadata","visible":true},{"tooltip":null,"forecolor":"#00000000","name":"name_textbox","y":115,"autofill":false,"x":15,"class":"GTextBox","backcolor":"#00000000","ruler_visible":false,"height":21,"enabled":true,"text":"","visible":true,"width":196},{"tooltip":null,"checked":false,"forecolor":"#00000000","name":"fixed_width_checkbox","y":140,"autofill":false,"x":15,"class":"GCheckBox","backcolor":"#00000000","height":21,"enabled":true,"text":"Fixed width","visible":true,"width":101},{"tooltip":null,"forecolor":"#00000000","name":"path_textbox","y":175,"autofill":false,"x":5,"class":"GTextBox","backcolor":"#00000000","ruler_visible":false,"height":21,"enabled":true,"text":"","visible":true,"width":216},{"enabled":true,"forecolor":"#00000000","autofill":false,"x":5,"tooltip":null,"name":"save_button","height":21,"width":106,"y":205,"class":"GButton","text":"Save","backcolor":"#00000000","visible":true},{"enabled":true,"forecolor":"#00000000","autofill":false,"x":115,"tooltip":null,"name":"quit_button","height":21,"width":106,"y":205,"class":"GButton","text":"Quit","backcolor":"#00000000","visible":true}]} +{"name":"FontEditorBottom","widgets":[{"enabled":true,"forecolor":"#000000ff","autofill":false,"x":5,"tooltip":"[null]","name":"info_label","height":16,"width":66,"y":15,"class":"GLabel","text":"info_label","backcolor":"#d4d0c8ff","visible":true},{"enabled":true,"forecolor":"#00000000","autofill":false,"x":95,"tooltip":null,"name":"demo_label_1","height":16,"width":276,"y":15,"class":"GLabel","text":"demo_label_1","backcolor":"#00000000","visible":true},{"enabled":true,"forecolor":"#00000000","autofill":false,"x":95,"tooltip":null,"name":"demo_label_2","height":16,"width":276,"y":40,"class":"GLabel","text":"demo_label_2","backcolor":"#00000000","visible":true},{"enabled":true,"forecolor":"#00000000","autofill":false,"x":5,"tooltip":null,"name":"label1","height":16,"width":66,"y":40,"class":"GLabel","text":"Glyph width:","backcolor":"#00000000","visible":true},{"forecolor":"#00000000","name":"width_spinbox","height":21,"backcolor":"#00000000","enabled":true,"value":0,"tooltip":null,"max":32,"visible":true,"y":60,"width":71,"autofill":false,"x":5,"class":"GSpinBox","min":0},{"enabled":true,"forecolor":"#00000000","autofill":false,"x":5,"tooltip":null,"name":"gb1","height":76,"width":300,"y":95,"class":"GGroupBox","backcolor":"#d4d0c8ff","title":"Font metadata","visible":true},{"enabled":true,"forecolor":"#00000000","autofill":false,"x":15,"tooltip":null,"name":"label2","height":16,"width":40,"y":105,"class":"GLabel","text":"Name:","backcolor":"#00000000","visible":true},{"tooltip":null,"forecolor":"#00000000","name":"name_textbox","y":120,"autofill":false,"x":15,"class":"GTextBox","backcolor":"#00000000","ruler_visible":false,"height":21,"enabled":true,"text":"","visible":true,"width":196},{"enabled":true,"forecolor":"#00000000","autofill":false,"x":215,"tooltip":null,"name":"label3","height":16,"width":80,"y":105,"class":"GLabel","text":"Glyph spacing:","backcolor":"#00000000","visible":true},{"forecolor":"#00000000","name":"spacing_spinbox","height":21,"backcolor":"#00000000","enabled":true,"value":0,"tooltip":null,"max":255,"visible":true,"y":120,"width":80,"autofill":false,"x":215,"class":"GSpinBox","min":0},{"tooltip":null,"checked":false,"forecolor":"#00000000","name":"fixed_width_checkbox","y":145,"autofill":false,"x":15,"class":"GCheckBox","backcolor":"#00000000","height":21,"enabled":true,"text":"Fixed width","visible":true,"width":101},{"tooltip":null,"forecolor":"#00000000","name":"path_textbox","y":175,"autofill":false,"x":5,"class":"GTextBox","backcolor":"#00000000","ruler_visible":false,"height":21,"enabled":true,"text":"","visible":true,"width":216},{"enabled":true,"forecolor":"#00000000","autofill":false,"x":5,"tooltip":null,"name":"save_button","height":21,"width":106,"y":205,"class":"GButton","text":"Save","backcolor":"#00000000","visible":true},{"enabled":true,"forecolor":"#00000000","autofill":false,"x":115,"tooltip":null,"name":"quit_button","height":21,"width":106,"y":205,"class":"GButton","text":"Quit","backcolor":"#00000000","visible":true}]} |