diff --git a/assets/games/liminal/fonts/OFL.txt b/assets/games/liminal/fonts/OFL.txt new file mode 100644 index 00000000..a1430120 --- /dev/null +++ b/assets/games/liminal/fonts/OFL.txt @@ -0,0 +1,93 @@ +Copyright 2023 The Ysabeau Project Authors (https://github.com/CatharsisFonts/Ysabeau) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/assets/games/liminal/fonts/Ysabeau-Black.ttf b/assets/games/liminal/fonts/Ysabeau-Black.ttf new file mode 100644 index 00000000..464e986c Binary files /dev/null and b/assets/games/liminal/fonts/Ysabeau-Black.ttf differ diff --git a/assets/games/liminal/fonts/Ysabeau-BlackItalic.ttf b/assets/games/liminal/fonts/Ysabeau-BlackItalic.ttf new file mode 100644 index 00000000..30bee34f Binary files /dev/null and b/assets/games/liminal/fonts/Ysabeau-BlackItalic.ttf differ diff --git a/assets/games/liminal/fonts/Ysabeau-Bold.ttf b/assets/games/liminal/fonts/Ysabeau-Bold.ttf new file mode 100644 index 00000000..393171ab Binary files /dev/null and b/assets/games/liminal/fonts/Ysabeau-Bold.ttf differ diff --git a/assets/games/liminal/fonts/Ysabeau-BoldItalic.ttf b/assets/games/liminal/fonts/Ysabeau-BoldItalic.ttf new file mode 100644 index 00000000..1cfd39cc Binary files /dev/null and b/assets/games/liminal/fonts/Ysabeau-BoldItalic.ttf differ diff --git a/assets/games/liminal/fonts/Ysabeau-ExtraBold.ttf b/assets/games/liminal/fonts/Ysabeau-ExtraBold.ttf new file mode 100644 index 00000000..4638eeaa Binary files /dev/null and b/assets/games/liminal/fonts/Ysabeau-ExtraBold.ttf differ diff --git a/assets/games/liminal/fonts/Ysabeau-ExtraBoldItalic.ttf b/assets/games/liminal/fonts/Ysabeau-ExtraBoldItalic.ttf new file mode 100644 index 00000000..71d4650b Binary files /dev/null and b/assets/games/liminal/fonts/Ysabeau-ExtraBoldItalic.ttf differ diff --git a/assets/games/liminal/fonts/Ysabeau-ExtraLight.ttf b/assets/games/liminal/fonts/Ysabeau-ExtraLight.ttf new file mode 100644 index 00000000..abf55005 Binary files /dev/null and b/assets/games/liminal/fonts/Ysabeau-ExtraLight.ttf differ diff --git a/assets/games/liminal/fonts/Ysabeau-ExtraLightItalic.ttf b/assets/games/liminal/fonts/Ysabeau-ExtraLightItalic.ttf new file mode 100644 index 00000000..b09cb8c6 Binary files /dev/null and b/assets/games/liminal/fonts/Ysabeau-ExtraLightItalic.ttf differ diff --git a/assets/games/liminal/fonts/Ysabeau-Italic.ttf b/assets/games/liminal/fonts/Ysabeau-Italic.ttf new file mode 100644 index 00000000..dbee740e Binary files /dev/null and b/assets/games/liminal/fonts/Ysabeau-Italic.ttf differ diff --git a/assets/games/liminal/fonts/Ysabeau-Light.ttf b/assets/games/liminal/fonts/Ysabeau-Light.ttf new file mode 100644 index 00000000..6e331c65 Binary files /dev/null and b/assets/games/liminal/fonts/Ysabeau-Light.ttf differ diff --git a/assets/games/liminal/fonts/Ysabeau-LightItalic.ttf b/assets/games/liminal/fonts/Ysabeau-LightItalic.ttf new file mode 100644 index 00000000..7370dfa5 Binary files /dev/null and b/assets/games/liminal/fonts/Ysabeau-LightItalic.ttf differ diff --git a/assets/games/liminal/fonts/Ysabeau-Medium.ttf b/assets/games/liminal/fonts/Ysabeau-Medium.ttf index 8ece58eb..4aeafced 100644 Binary files a/assets/games/liminal/fonts/Ysabeau-Medium.ttf and b/assets/games/liminal/fonts/Ysabeau-Medium.ttf differ diff --git a/assets/games/liminal/fonts/Ysabeau-MediumItalic.ttf b/assets/games/liminal/fonts/Ysabeau-MediumItalic.ttf new file mode 100644 index 00000000..569c342b Binary files /dev/null and b/assets/games/liminal/fonts/Ysabeau-MediumItalic.ttf differ diff --git a/assets/games/liminal/fonts/Ysabeau-Regular.ttf b/assets/games/liminal/fonts/Ysabeau-Regular.ttf new file mode 100644 index 00000000..2ff4508a Binary files /dev/null and b/assets/games/liminal/fonts/Ysabeau-Regular.ttf differ diff --git a/assets/games/liminal/fonts/Ysabeau-SemiBold.ttf b/assets/games/liminal/fonts/Ysabeau-SemiBold.ttf new file mode 100644 index 00000000..d8760786 Binary files /dev/null and b/assets/games/liminal/fonts/Ysabeau-SemiBold.ttf differ diff --git a/assets/games/liminal/fonts/Ysabeau-SemiBoldItalic.ttf b/assets/games/liminal/fonts/Ysabeau-SemiBoldItalic.ttf new file mode 100644 index 00000000..7133da29 Binary files /dev/null and b/assets/games/liminal/fonts/Ysabeau-SemiBoldItalic.ttf differ diff --git a/assets/games/liminal/fonts/Ysabeau-Thin.ttf b/assets/games/liminal/fonts/Ysabeau-Thin.ttf new file mode 100644 index 00000000..4401870f Binary files /dev/null and b/assets/games/liminal/fonts/Ysabeau-Thin.ttf differ diff --git a/assets/games/liminal/fonts/Ysabeau-ThinItalic.ttf b/assets/games/liminal/fonts/Ysabeau-ThinItalic.ttf new file mode 100644 index 00000000..8602804f Binary files /dev/null and b/assets/games/liminal/fonts/Ysabeau-ThinItalic.ttf differ diff --git a/assets/games/liminal/scenes/Scene1Prologue0.xml b/assets/games/liminal/scenes/Scene1Prologue0.xml index 7923922e..3bdf0e1b 100644 --- a/assets/games/liminal/scenes/Scene1Prologue0.xml +++ b/assets/games/liminal/scenes/Scene1Prologue0.xml @@ -1,7 +1,7 @@ - There is a bucket. + There is a bucket. @@ -21,7 +21,7 @@ - You are dead when the bucket falls — crushes your skull — caves you open — drenches you and drenches you, drowns you, fells you and kills, kills, kills you. + You are dead when the bucket falls - crushes your skull - caves you open - drenches you and drenches you, drowns you, fells you and kills, kills, kills you. diff --git a/src/dawn/games/vn/components/VNTextboxScroller.hpp b/src/dawn/games/vn/components/VNTextboxScroller.hpp index 3bf4b868..e1707110 100644 --- a/src/dawn/games/vn/components/VNTextboxScroller.hpp +++ b/src/dawn/games/vn/components/VNTextboxScroller.hpp @@ -5,7 +5,7 @@ #pragma once #include "scene/SceneItemComponent.hpp" -#include "scene/components/ui/text/UILabel.hpp" +#include "scene/components/ui/text/UIRichTextLabel.hpp" #include "input/InputManager.hpp" #define VN_TEXTBOX_SPEED 25.0f @@ -15,7 +15,7 @@ namespace Dawn { class VNTextboxScroller : public SceneItemComponent { public: // @optional - StateProperty label; + StateProperty label; // @optional StateProperty visibleLines; diff --git a/src/dawn/games/vn/events/VNTextEvent.hpp b/src/dawn/games/vn/events/VNTextEvent.hpp index 2272bf9d..c6e30fec 100644 --- a/src/dawn/games/vn/events/VNTextEvent.hpp +++ b/src/dawn/games/vn/events/VNTextEvent.hpp @@ -20,8 +20,7 @@ namespace Dawn { scroller = this->getScene()->findComponent(); assertNotNull(scroller); - assertUnreachable(); - // scroller->label->text = text; + scroller->label->richText = "" + text + ""; useEvent([&](inputbind_t bind){ if(bind != INPUT_BIND_ACCEPT) return; diff --git a/src/dawnliminal/CMakeLists.txt b/src/dawnliminal/CMakeLists.txt index 23f69400..4d3f83c8 100644 --- a/src/dawnliminal/CMakeLists.txt +++ b/src/dawnliminal/CMakeLists.txt @@ -23,6 +23,9 @@ tool_texture(texture_eth FILE=${LIMINAL_ASSETS_DIR}/textures/eth.png) tool_texture(texture_border FILE=${LIMINAL_ASSETS_DIR}/textures/texture_test.png) tool_truetype(font_main REGULAR=${LIMINAL_ASSETS_DIR}/fonts/Ysabeau-Medium.ttf + BOLD=${LIMINAL_ASSETS_DIR}/fonts/Ysabeau-SemiBold.ttf + ITALICS=${LIMINAL_ASSETS_DIR}/fonts/Ysabeau-MediumItalic.ttf + BOLD_ITALICS=${LIMINAL_ASSETS_DIR}/fonts/Ysabeau-SemiBoldItalic.ttf ) tool_scene(${LIMINAL_ASSETS_DIR}/scenes/SceneBase.xml) diff --git a/src/dawnliminal/game/LiminalGame.cpp b/src/dawnliminal/game/LiminalGame.cpp index 3341dd8c..0b992f0f 100644 --- a/src/dawnliminal/game/LiminalGame.cpp +++ b/src/dawnliminal/game/LiminalGame.cpp @@ -10,6 +10,6 @@ using namespace Dawn; Scene * Dawn::dawnGameGetInitialScene(DawnGame *game) { - return new HelloWorldScene(game); - // return new Scene1Prologue(game); + // return new HelloWorldScene(game); + return new Scene1Prologue(game); } \ No newline at end of file diff --git a/src/dawntools/truetypetool/TrueTypeTool.cpp b/src/dawntools/truetypetool/TrueTypeTool.cpp index 166ddc3c..33db3e7e 100644 --- a/src/dawntools/truetypetool/TrueTypeTool.cpp +++ b/src/dawntools/truetypetool/TrueTypeTool.cpp @@ -13,13 +13,13 @@ TrueTypeFile::TrueTypeFile(std::string path) : file(path) { // Remove extension size_t pos = path.find_last_of("."); std::string filename = path.substr(0, pos); - + std::string pathLower = stringToLowercase(path); style = 0; - if(path.find("bold") != std::string::npos || filename.ends_with("bd") || filename.ends_with("bi")) { + if(pathLower.find("bold") != std::string::npos || filename.ends_with("bd") || filename.ends_with("bi")) { style |= TRUE_TYPE_VARIANT_BOLD; } - if(path.find("italics") != std::string::npos || filename.ends_with("i") || filename.ends_with("bi")) { + if(pathLower.find("italic") != std::string::npos || filename.ends_with("i") || filename.ends_with("bi")) { style |= TRUE_TYPE_VARIANT_ITALICS; } diff --git a/src/dawntools/truetypetool/TrueTypeTool.hpp b/src/dawntools/truetypetool/TrueTypeTool.hpp index 9121c219..62f196dc 100644 --- a/src/dawntools/truetypetool/TrueTypeTool.hpp +++ b/src/dawntools/truetypetool/TrueTypeTool.hpp @@ -7,6 +7,7 @@ #include "util/DawnTool.hpp" #include "util/File.hpp" #include "display/font/truetype/TrueTypeShared.hpp" +#include "util/string.hpp" namespace Dawn { class TrueTypeFile { diff --git a/src/dawntools/vnscenetool/VNSceneGen.cpp b/src/dawntools/vnscenetool/VNSceneGen.cpp index 372f395f..82aedc86 100644 --- a/src/dawntools/vnscenetool/VNSceneGen.cpp +++ b/src/dawntools/vnscenetool/VNSceneGen.cpp @@ -23,7 +23,7 @@ void VNSceneGen::test( case VN_SCENE_EVENT_TYPE_TEXT: initType = "VNTextEvent"; toInclude = "games/vn/events/VNTextEvent.hpp"; - line(&afterLines, eventName + "->" + "text = \"" + event->text.texts.begin()->text + "\";", ""); + line(&afterLines, eventName + "->" + "text = " + event->text.texts.begin()->text + ";", ""); break; case VN_SCENE_EVENT_TYPE_POSITION: diff --git a/src/dawntools/vnscenetool/events/VNTextEventParser.cpp b/src/dawntools/vnscenetool/events/VNTextEventParser.cpp index caadf738..e97efe2a 100644 --- a/src/dawntools/vnscenetool/events/VNTextEventParser.cpp +++ b/src/dawntools/vnscenetool/events/VNTextEventParser.cpp @@ -4,6 +4,7 @@ // https://opensource.org/licenses/MIT #include "VNTextEventParser.hpp" +#include "util/parser/TypeParsers.hpp" using namespace Dawn; @@ -22,8 +23,8 @@ int32_t VNTextParser::onParse( std::string *error ) { out->language = values["lang"]; - out->text = node->value; - return 0; + out->text = stringParser(node->innerXml, error); + return error->length() == 0 ? 0 : -1; } // // // // // // // // // // // // // // // // // // // // // // // // // // //