mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 16:40:05 +00:00
Render hover text in monospace
- TODO: Configure separate font size for monospace
This commit is contained in:
parent
48d71cc14d
commit
8be32a8998
9 changed files with 58 additions and 8 deletions
|
|
@ -299,6 +299,16 @@ void FontImpl::CreateImGuiFont(QFile& fontFile,
|
|||
}
|
||||
}
|
||||
|
||||
ImFont* Font::ImGuiFont(std::size_t fontPixelSize)
|
||||
{
|
||||
auto it = p->imGuiFonts_.find(fontPixelSize);
|
||||
if (it != p->imGuiFonts_.cend())
|
||||
{
|
||||
return it->second;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<Font> Font::Create(const std::string& resource)
|
||||
{
|
||||
logger_->debug("Loading font file: {}", resource);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,9 @@
|
|||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include <boost/gil.hpp>
|
||||
#include <boost/gil/typedefs.hpp>
|
||||
|
||||
struct ImFont;
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
|
|
@ -23,10 +25,10 @@ public:
|
|||
explicit Font(const std::string& resource);
|
||||
~Font();
|
||||
|
||||
Font(const Font&) = delete;
|
||||
Font(const Font&) = delete;
|
||||
Font& operator=(const Font&) = delete;
|
||||
|
||||
Font(Font&&) = delete;
|
||||
Font(Font&&) = delete;
|
||||
Font& operator=(Font&&) = delete;
|
||||
|
||||
float BufferText(std::shared_ptr<FontBuffer> buffer,
|
||||
|
|
@ -38,6 +40,8 @@ public:
|
|||
float Kerning(char c1, char c2) const;
|
||||
float TextLength(const std::string& text, float pointSize) const;
|
||||
|
||||
ImFont* ImGuiFont(std::size_t fontPixelSize);
|
||||
|
||||
GLuint GenerateTexture(gl::OpenGLFunctions& gl);
|
||||
|
||||
static std::shared_ptr<Font> Create(const std::string& resource);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue