Support decimal values in Font sizes

This commit is contained in:
2023-06-18 20:10:56 +03:00
parent dd8817582a
commit 2190031ccf
8 changed files with 19 additions and 19 deletions

View File

@@ -7,7 +7,7 @@
#include "Engine/Threading/Threading.h"
#include "IncludeFreeType.h"
Font::Font(FontAsset* parentAsset, int32 size)
Font::Font(FontAsset* parentAsset, float size)
: ManagedScriptingObject(SpawnParams(Guid::New(), Font::TypeInitializer))
, _asset(parentAsset)
, _size(size)
@@ -436,7 +436,7 @@ void Font::FlushFaceSize() const
{
// Set the character size
const FT_Face face = _asset->GetFTFace();
const FT_Error error = FT_Set_Char_Size(face, 0, ConvertPixelTo26Dot6<FT_F26Dot6>((float)_size * FontManager::FontScale), DefaultDPI, DefaultDPI);
const FT_Error error = FT_Set_Char_Size(face, 0, ConvertPixelTo26Dot6<FT_F26Dot6>(_size * FontManager::FontScale), DefaultDPI, DefaultDPI);
if (error)
{
LOG_FT_ERROR(error);