From e8c74450a02dfdb477706614c4f9fbf3da16a3c2 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Mon, 5 Sep 2022 00:11:53 +0200 Subject: [PATCH] Enabled linear interpolation for all font rendering regardless of resolution. --- es-core/src/resources/Font.cpp | 9 ++------- es-core/src/resources/Font.h | 1 - 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/es-core/src/resources/Font.cpp b/es-core/src/resources/Font.cpp index 64a29fa50..9477473ce 100644 --- a/es-core/src/resources/Font.cpp +++ b/es-core/src/resources/Font.cpp @@ -66,10 +66,6 @@ void Font::initLibrary() sLibrary = nullptr; LOG(LogError) << "Couldn't initialize FreeType"; } - - // Whether to enable linear interpolation for font texture magnification (a size of 90 - // means approximately 1920x1080). - mHighResolution = FONT_SIZE_LARGE > 90; } std::vector Font::getFallbackFontPaths() @@ -594,9 +590,8 @@ bool Font::FontTexture::findEmpty(const glm::ivec2& size, glm::ivec2& cursor_out void Font::FontTexture::initTexture() { assert(textureId == 0); - textureId = - Renderer::getInstance()->createTexture(Renderer::TextureType::RED, true, mHighResolution, - false, textureSize.x, textureSize.y, nullptr); + textureId = Renderer::getInstance()->createTexture( + Renderer::TextureType::RED, true, true, false, textureSize.x, textureSize.y, nullptr); } void Font::FontTexture::deinitTexture() diff --git a/es-core/src/resources/Font.h b/es-core/src/resources/Font.h index dae9633a8..d7b54dc7f 100644 --- a/es-core/src/resources/Font.h +++ b/es-core/src/resources/Font.h @@ -175,7 +175,6 @@ private: int mSize; int mMaxGlyphHeight; const std::string mPath; - static inline bool mHighResolution {false}; float getNewlineStartOffset(const std::string& text, const unsigned int& charStart,