From 600bdbe99f09162ebf264af88ac7cd91d36ac035 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 21 Nov 2020 20:46:24 +0100 Subject: Smooth emoji --- src/ResourceLoader.cpp | 1 + src/Text.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src') 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); -- cgit v1.2.3