// Copyright (c) 2023 Dominic Masters // // This software is released under the MIT License. // https://opensource.org/licenses/MIT #include "VNSetDefaultFontEventParser.hpp" using namespace Dawn; std::map VNSetDefaultFontEventParser::getOptionalAttributes() { return { { "font", "font_main" }, { "style", "" }, { "size", "" }, { "color", "" } }; } std::vector VNSetDefaultFontEventParser::getRequiredAttributes() { return {}; } int32_t VNSetDefaultFontEventParser::onParse( Xml *node, std::map values, struct VNSetFont *out, std::string *error ) { //Get the font out->font = values["font"]; if(out->font.empty()) { *error = "Font is required."; return 1; } //Get the style out->style = values["style"]; //Get the size out->fontSize = values["size"]; //Get the color out->color = values["color"]; return 0; }