1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-30 23:28:12 +00:00
serenity/Applications/FontEditor/main.cpp
Andreas Kling 7f6c81d90f Implement basic support for variable-width fonts.
Also add a nice new font called Katica. It's not used anywhere yet but
I'm definitely itching to start using it. :^)
2019-03-06 12:52:41 +01:00

35 lines
909 B
C++

#include "FontEditor.h"
#include <LibGUI/GApplication.h>
#include <LibGUI/GWindow.h>
#include <stdio.h>
int main(int argc, char** argv)
{
GApplication app(argc, argv);
RetainPtr<Font> edited_font;
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();
auto* window = new GWindow;
window->set_title("FontEditor");
window->set_rect({ 50, 50, 420, 300 });
auto* font_editor = new FontEditorWidget(path, move(edited_font));
window->set_main_widget(font_editor);
window->set_should_exit_app_on_close(true);
window->show();
return app.exec();
}