aboutsummaryrefslogtreecommitdiff
path: root/include/Text.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/Text.hpp')
-rw-r--r--include/Text.hpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/include/Text.hpp b/include/Text.hpp
index 8b6c0b9..d70f356 100644
--- a/include/Text.hpp
+++ b/include/Text.hpp
@@ -35,21 +35,22 @@ namespace QuickMedia
};
TextElement() {}
- TextElement(const StringViewUtf32 &_text, Type _type) : text(_text), type(_type), ownLine(false) {}
+ TextElement(const StringViewUtf32 &_text, Type _type) : text(_text), type(_type), is_japanese(false) {}
StringViewUtf32 text;
sf::Vector2f position;
Type type;
- bool ownLine; // Currently only used for emoji, to make emoji bigger when it's the only thing on a line
+ //bool ownLine; // Currently only used for emoji, to make emoji bigger when it's the only thing on a line
+ bool is_japanese;
};
class Text
{
public:
- Text(const sf::Font *font);
- Text(const sf::String &str, const sf::Font *font, unsigned int characterSize, float maxWidth, bool plainText = true);
+ Text(const sf::Font *font, const sf::Font *cjk_font);
+ Text(sf::String str, const sf::Font *font, const sf::Font *cjk_font, unsigned int characterSize, float maxWidth, bool plainText = true);
- void setString(const sf::String &str);
+ void setString(sf::String str);
const sf::String& getString() const;
void setPosition(float x, float y);
@@ -89,6 +90,7 @@ namespace QuickMedia
END
};
+#if 0
void updateCaret();
bool isCaretAtEnd() const;
int getStartOfLine(int startIndex) const;
@@ -97,11 +99,15 @@ namespace QuickMedia
int getPreviousLineClosestPosition(int startIndex) const;
int getNextLineClosestPosition(int startIndex) const;
+#endif
+
+ void splitTextByFont();
private:
sf::String str;
const sf::Font *font;
+ const sf::Font *cjk_font;
unsigned int characterSize;
- sf::VertexArray vertices;
+ sf::VertexArray vertices[2];
float maxWidth;
sf::Vector2f position;
sf::Color color;