aboutsummaryrefslogtreecommitdiff
path: root/src/Body.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Body.cpp')
-rw-r--r--src/Body.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/Body.cpp b/src/Body.cpp
index 3f5c755..06907c8 100644
--- a/src/Body.cpp
+++ b/src/Body.cpp
@@ -1,6 +1,7 @@
#include "../include/Body.hpp"
#include "../include/QuickMedia.hpp"
#include "../include/Scale.hpp"
+#include "../include/FontLoader.hpp"
#include "../plugins/Plugin.hpp"
#include <SFML/Graphics/CircleShape.hpp>
#include <SFML/OpenGL.hpp>
@@ -79,13 +80,10 @@ namespace QuickMedia {
return *this;
}
- Body::Body(Program *program, sf::Font *font, sf::Font *bold_font, sf::Font *cjk_font, sf::Texture &loading_icon_texture) :
- font(font),
- bold_font(bold_font),
- cjk_font(cjk_font),
- progress_text("", *font, 14),
- replies_text("", *font, 14),
- embedded_item_load_text("", *font, 14),
+ Body::Body(Program *program, sf::Texture &loading_icon_texture) :
+ progress_text("", *FontLoader::get_font(FontLoader::FontType::LATIN), 14),
+ replies_text("", *FontLoader::get_font(FontLoader::FontType::LATIN), 14),
+ embedded_item_load_text("", *FontLoader::get_font(FontLoader::FontType::LATIN), 14),
draw_thumbnails(true),
wrap_around(false),
line_separator_color(sf::Color(32, 37, 43, 255)),
@@ -475,7 +473,7 @@ namespace QuickMedia {
if(body_item->title_text)
body_item->title_text->setString(std::move(str));
else
- body_item->title_text = std::make_unique<Text>(std::move(str), font, cjk_font, 16, width - 50 - image_padding_x * 2.0f);
+ body_item->title_text = std::make_unique<Text>(std::move(str), false, 16, width - 50 - image_padding_x * 2.0f);
body_item->title_text->setFillColor(body_item->get_title_color());
body_item->title_text->updateGeometry();
}
@@ -486,7 +484,7 @@ namespace QuickMedia {
if(body_item->description_text)
body_item->description_text->setString(std::move(str));
else
- body_item->description_text = std::make_unique<Text>(std::move(str), font, cjk_font, 14, width - 50 - image_padding_x * 2.0f);
+ body_item->description_text = std::make_unique<Text>(std::move(str), false, 14, width - 50 - image_padding_x * 2.0f);
body_item->description_text->setFillColor(body_item->get_description_color());
body_item->description_text->updateGeometry();
}
@@ -497,7 +495,7 @@ namespace QuickMedia {
if(body_item->author_text)
body_item->author_text->setString(std::move(str));
else
- body_item->author_text = std::make_unique<Text>(std::move(str), bold_font, cjk_font, 14, width - 50 - image_padding_x * 2.0f);
+ body_item->author_text = std::make_unique<Text>(std::move(str), true, 14, width - 50 - image_padding_x * 2.0f);
body_item->author_text->setFillColor(body_item->get_author_color());
body_item->author_text->updateGeometry();
}
@@ -525,7 +523,7 @@ namespace QuickMedia {
if(body_item->timestamp_text)
body_item->timestamp_text->setString(time_str);
else
- body_item->timestamp_text = std::make_unique<sf::Text>(time_str, *font, 10);
+ body_item->timestamp_text = std::make_unique<sf::Text>(time_str, *FontLoader::get_font(FontLoader::FontType::LATIN), 10);
body_item->timestamp_text->setFillColor(sf::Color(185, 190, 198, 100));
}