diff options
author | chai <chaifix@163.com> | 2021-11-03 18:52:30 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-11-03 18:52:30 +0800 |
commit | 08ddd44b634d4da78edd0964f539a310544c7883 (patch) | |
tree | 108317d9138c3e8a19f3cc3f2ffcfba4768f22d5 /Runtime/GUI/Font.cpp | |
parent | 6f62a3d5ad405dbab5ac031fb8eeb03bdb395904 (diff) |
! UI9Slicing
Diffstat (limited to 'Runtime/GUI/Font.cpp')
-rw-r--r-- | Runtime/GUI/Font.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Runtime/GUI/Font.cpp b/Runtime/GUI/Font.cpp index 8a5acea..1993126 100644 --- a/Runtime/GUI/Font.cpp +++ b/Runtime/GUI/Font.cpp @@ -16,7 +16,7 @@ using namespace character; static std::string s_FontError; static std::vector<unsigned char> s_PixelBuffer; -static int s_SizePerPixel = sizeof(unsigned char); +static const int s_SizePerPixel = sizeof(unsigned char); Font::Font(std::string path, TextGeneratingSettings settings) : LuaBind::NativeClass<Font>() @@ -98,7 +98,7 @@ Font::Font(LuaBind::VM* vm, DataBuffer* db, TextGeneratingSettings settings) } } -character::Hash Font::GetHash(Codepoint codepoint, int pixelSize) +character::Hash Font::GetHash(Unicode codepoint, int pixelSize) { character::Hash hash; hash.codepoint = codepoint; @@ -106,7 +106,7 @@ character::Hash Font::GetHash(Codepoint codepoint, int pixelSize) return hash; } -const Character* Font::GetCharacter(character::Codepoint codepoint, int pixelSize) +const Character* Font::GetCharacter(character::Unicode codepoint, int pixelSize) { character::Hash hash = GetHash(codepoint, pixelSize); auto iter = m_Characters.find(hash); @@ -125,7 +125,7 @@ const Character* Font::GetCharacter(character::Codepoint codepoint, int pixelSiz return &iter->second; } -void Font::RenderCharacters(character::Codepoint* codepoint, int n, int pixelSize) +void Font::RenderCharacters(character::Unicode* codepoint, int n, int pixelSize) { for (int i = 0; i < n; ++i) { @@ -133,7 +133,7 @@ void Font::RenderCharacters(character::Codepoint* codepoint, int n, int pixelSiz } } -void Font::RenderCharacters(std::vector<character::Codepoint>& codepoint, int pixelSize) +void Font::RenderCharacters(std::vector<character::Unicode>& codepoint, int pixelSize) { int n = codepoint.size(); for (int i = 0; i < n; ++i) @@ -142,7 +142,7 @@ void Font::RenderCharacters(std::vector<character::Codepoint>& codepoint, int pi } } -bool Font::RenderCharacter(character::Codepoint codepoint, int pixelSize) +bool Font::RenderCharacter(character::Unicode codepoint, int pixelSize) { character::Hash hash = GetHash(codepoint, pixelSize); if (m_Characters.count(hash) != 0) @@ -318,7 +318,7 @@ bool Font::HasEnoughSpace(GlyphAtals* atlas, Internal::Vector2 preferSize) return false; } -Character GetCharacter(character::Codepoint Codepoint, int pixelSize) +Character GetCharacter(character::Unicode Unicode, int pixelSize) { return Character(); } |