aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-11-21 20:46:24 +0100
committerdec05eba <dec05eba@protonmail.com>2020-11-21 20:46:24 +0100
commit600bdbe99f09162ebf264af88ac7cd91d36ac035 (patch)
treecfe8df80f2e4376f2e73b6f5b681a017a99a239c /src
parent44e66882f6e517b06522cb1e510ed9dea7574273 (diff)
Smooth emoji
Diffstat (limited to 'src')
-rw-r--r--src/ResourceLoader.cpp1
-rw-r--r--src/Text.cpp2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/ResourceLoader.cpp b/src/ResourceLoader.cpp
index 9a6060d..77ad675 100644
--- a/src/ResourceLoader.cpp
+++ b/src/ResourceLoader.cpp
@@ -73,6 +73,7 @@ namespace QuickMedia::TextureLoader {
sf::Texture *result = new_texture.get();
if(!new_texture->loadFromFile(resource_root + str))
fprintf(stderr, "Failed to load image: %s%s\n", resource_root.c_str(), filepath);
+ new_texture->setSmooth(true);
texture_cache[str] = std::move(new_texture);
return result;
}
diff --git a/src/Text.cpp b/src/Text.cpp
index 539f211..46e09de 100644
--- a/src/Text.cpp
+++ b/src/Text.cpp
@@ -364,7 +364,7 @@ namespace QuickMedia
int vertexStart = vertices[vertices_index].getVertexCount();
EmojiRectangle emoji_rec = emoji_get_extents(codePoint);
- const float font_height_offset = -latin_font_height * 1.0f;
+ const float font_height_offset = -latin_font_height * 1.2f;
sf::Vector2f vertexTopLeft(glyphPos.x, glyphPos.y + font_height_offset - emoji_rec.height * 0.5f);
sf::Vector2f vertexTopRight(glyphPos.x + emoji_rec.width, glyphPos.y + font_height_offset - emoji_rec.height * 0.5f);
sf::Vector2f vertexBottomLeft(glyphPos.x, glyphPos.y + font_height_offset + emoji_rec.height * 0.5f);