Added more variants of Ysabeuau fonts

This commit is contained in:
2023-06-18 00:42:49 -07:00
parent 0ea7f1d749
commit 24cf072b97
8 changed files with 16 additions and 12 deletions

View File

@ -5,7 +5,7 @@
#pragma once #pragma once
#include "scene/SceneItemComponent.hpp" #include "scene/SceneItemComponent.hpp"
#include "scene/components/ui/text/UILabel.hpp" #include "scene/components/ui/text/UIRichTextLabel.hpp"
#include "input/InputManager.hpp" #include "input/InputManager.hpp"
#define VN_TEXTBOX_SPEED 25.0f #define VN_TEXTBOX_SPEED 25.0f
@ -15,7 +15,7 @@ namespace Dawn {
class VNTextboxScroller : public SceneItemComponent { class VNTextboxScroller : public SceneItemComponent {
public: public:
// @optional // @optional
StateProperty<UILabel*> label; StateProperty<UIRichTextLabel*> label;
// @optional // @optional
StateProperty<int32_t> visibleLines; StateProperty<int32_t> visibleLines;

View File

@ -20,8 +20,7 @@ namespace Dawn {
scroller = this->getScene()->findComponent<VNTextboxScroller>(); scroller = this->getScene()->findComponent<VNTextboxScroller>();
assertNotNull(scroller); assertNotNull(scroller);
assertUnreachable(); scroller->label->richText = "<font font=\"font_main\" size=\"32\">" + text + "</font>";
// scroller->label->text = text;
useEvent([&](inputbind_t bind){ useEvent([&](inputbind_t bind){
if(bind != INPUT_BIND_ACCEPT) return; if(bind != INPUT_BIND_ACCEPT) return;

View File

@ -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_texture(texture_border FILE=${LIMINAL_ASSETS_DIR}/textures/texture_test.png)
tool_truetype(font_main tool_truetype(font_main
REGULAR=${LIMINAL_ASSETS_DIR}/fonts/Ysabeau-Medium.ttf 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) tool_scene(${LIMINAL_ASSETS_DIR}/scenes/SceneBase.xml)

View File

@ -10,6 +10,6 @@
using namespace Dawn; using namespace Dawn;
Scene * Dawn::dawnGameGetInitialScene(DawnGame *game) { Scene * Dawn::dawnGameGetInitialScene(DawnGame *game) {
return new HelloWorldScene(game); // return new HelloWorldScene(game);
// return new Scene1Prologue(game); return new Scene1Prologue(game);
} }

View File

@ -13,13 +13,13 @@ TrueTypeFile::TrueTypeFile(std::string path) : file(path) {
// Remove extension // Remove extension
size_t pos = path.find_last_of("."); size_t pos = path.find_last_of(".");
std::string filename = path.substr(0, pos); std::string filename = path.substr(0, pos);
std::string pathLower = stringToLowercase(path);
style = 0; 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; 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; style |= TRUE_TYPE_VARIANT_ITALICS;
} }

View File

@ -7,6 +7,7 @@
#include "util/DawnTool.hpp" #include "util/DawnTool.hpp"
#include "util/File.hpp" #include "util/File.hpp"
#include "display/font/truetype/TrueTypeShared.hpp" #include "display/font/truetype/TrueTypeShared.hpp"
#include "util/string.hpp"
namespace Dawn { namespace Dawn {
class TrueTypeFile { class TrueTypeFile {

View File

@ -23,7 +23,7 @@ void VNSceneGen::test(
case VN_SCENE_EVENT_TYPE_TEXT: case VN_SCENE_EVENT_TYPE_TEXT:
initType = "VNTextEvent"; initType = "VNTextEvent";
toInclude = "games/vn/events/VNTextEvent.hpp"; 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; break;
case VN_SCENE_EVENT_TYPE_POSITION: case VN_SCENE_EVENT_TYPE_POSITION:

View File

@ -4,6 +4,7 @@
// https://opensource.org/licenses/MIT // https://opensource.org/licenses/MIT
#include "VNTextEventParser.hpp" #include "VNTextEventParser.hpp"
#include "util/parser/TypeParsers.hpp"
using namespace Dawn; using namespace Dawn;
@ -22,8 +23,8 @@ int32_t VNTextParser::onParse(
std::string *error std::string *error
) { ) {
out->language = values["lang"]; out->language = values["lang"];
out->text = node->value; out->text = stringParser(node->innerXml, error);
return 0; return error->length() == 0 ? 0 : -1;
} }
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //