diff --git a/es-app/src/views/SystemView.cpp b/es-app/src/views/SystemView.cpp index 2b05a5e3b..11a5131ec 100644 --- a/es-app/src/views/SystemView.cpp +++ b/es-app/src/views/SystemView.cpp @@ -1187,8 +1187,7 @@ void SystemView::legacyApplyTheme(const std::shared_ptr& theme) std::floor(mPrimary->getPosition().y) + mPrimary->getSize().y); mLegacySystemInfo->setBackgroundColor(0xDDDDDDD8); mLegacySystemInfo->setRenderBackground(true); - mLegacySystemInfo->setFont( - Font::get(static_cast(0.035f * mSize.y), Font::getDefaultPath())); + mLegacySystemInfo->setFont(Font::get(0.035f * mSize.y, Font::getDefaultPath())); mLegacySystemInfo->setColor(0x000000FF); mLegacySystemInfo->setUppercase(true); mLegacySystemInfo->setZIndex(50.0f); diff --git a/es-core/src/components/SliderComponent.cpp b/es-core/src/components/SliderComponent.cpp index 7a9a4aea4..4402d9277 100644 --- a/es-core/src/components/SliderComponent.cpp +++ b/es-core/src/components/SliderComponent.cpp @@ -121,7 +121,7 @@ void SliderComponent::setValue(float value) void SliderComponent::onSizeChanged() { if (!mSuffix.empty()) - mFont = Font::get(static_cast(mSize.y), FONT_PATH_LIGHT); + mFont = Font::get(mSize.y, FONT_PATH_LIGHT); onValueChanged(); } diff --git a/es-core/src/resources/Font.cpp b/es-core/src/resources/Font.cpp index b44d75a96..c6bf3ed02 100644 --- a/es-core/src/resources/Font.cpp +++ b/es-core/src/resources/Font.cpp @@ -413,7 +413,7 @@ glm::vec2 Font::getWrappedTextCursorOffset(const std::string& wrappedText, float Font::getLetterHeight() { if (mLetterHeight == 0.0f) - return mFontSize * 0.737; // Only needed if face does not contain the letter 'S'. + return mFontSize * 0.737f; // Only needed if face does not contain the letter 'S'. else return mLetterHeight; } @@ -593,7 +593,8 @@ Font::FontFace::FontFace(ResourceData&& d, float size, const std::string& path) // Even though a fractional font size can be requested, the glyphs will always be rounded // to integers. It's not useless to call FT_Set_Char_Size() instead of FT_Set_Pixel_Sizes() // though as the glyphs will still be much more evenely sized across different resolutions. - FT_Set_Char_Size(face, 0.0f, size * 64.0f, 0, 0); + FT_Set_Char_Size(face, static_cast(0.0f), static_cast(size * 64.0f), 0, + 0); } Font::FontFace::~FontFace() @@ -659,7 +660,7 @@ void Font::getTextureForNewGlyph(const glm::ivec2& glyphSize, return; // Yes. } - mTextures.emplace_back(std::make_unique(mFontSize)); + mTextures.emplace_back(std::make_unique(static_cast(std::round(mFontSize)))); tex_out = mTextures.back().get(); tex_out->initTexture();