2019-02-02 08:05:14 +01:00
|
|
|
#include "FontEditor.h"
|
2019-07-28 10:18:49 +02:00
|
|
|
#include <LibDraw/PNGLoader.h>
|
2019-02-11 14:56:23 +01:00
|
|
|
#include <LibGUI/GApplication.h>
|
2019-02-02 08:05:14 +01:00
|
|
|
#include <LibGUI/GWindow.h>
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
|
|
int main(int argc, char** argv)
|
|
|
|
|
{
|
2019-02-11 14:56:23 +01:00
|
|
|
GApplication app(argc, argv);
|
|
|
|
|
|
2019-06-21 18:37:47 +02:00
|
|
|
RefPtr<Font> edited_font;
|
2019-02-05 07:23:01 +01:00
|
|
|
String path;
|
|
|
|
|
|
|
|
|
|
if (argc == 2) {
|
|
|
|
|
path = argv[1];
|
|
|
|
|
edited_font = Font::load_from_file(path);
|
|
|
|
|
if (!edited_font) {
|
|
|
|
|
fprintf(stderr, "Couldn't load font: %s\n", path.characters());
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (edited_font)
|
|
|
|
|
edited_font = edited_font->clone();
|
|
|
|
|
else
|
|
|
|
|
edited_font = Font::default_font().clone();
|
2019-02-02 08:05:14 +01:00
|
|
|
|
2019-09-21 18:34:06 +02:00
|
|
|
auto window = GWindow::construct();
|
2019-05-27 13:52:28 +02:00
|
|
|
window->set_title("Font Editor");
|
2019-07-11 20:19:26 +02:00
|
|
|
window->set_rect({ 50, 50, 390, 342 });
|
2019-09-21 20:04:00 +02:00
|
|
|
auto font_editor = FontEditorWidget::construct(path, move(edited_font));
|
2019-02-02 08:05:14 +01:00
|
|
|
window->set_main_widget(font_editor);
|
|
|
|
|
window->show();
|
2019-07-28 10:18:49 +02:00
|
|
|
window->set_icon(load_png("/res/icons/16x16/app-font-editor.png"));
|
2019-02-11 14:56:23 +01:00
|
|
|
return app.exec();
|
2019-02-02 08:05:14 +01:00
|
|
|
}
|