soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
SDpiAwareFont.cpp
1#include "souistd.h"
2#include "res.mgr/SDpiAwareFont.h"
3
4SNSBEGIN
5static const SStringW KNoneFont = L"none";
7 : m_strDesc(KNoneFont)
8{
9}
10
14
16{
17 return m_object;
18}
19
20void SDpiAwareFont::SetFontDesc(const SStringW &strDesc, int nScale)
21{
22 m_strDesc = strDesc;
23 m_object = OnGetFont(m_strDesc, nScale);
24}
25
27{
28 if (m_strDesc == KNoneFont)
29 return;
30 m_object = OnGetFont(m_strDesc, nScale);
31}
32
33IFontS *SDpiAwareFont::OnGetFont(const SStringW &strDesc, int nScale)
34{
35 return GETUIDEF->GetFont(strDesc, nScale);
36}
37SNSEND
void UpdateFont(int nScale)
Updates the font based on the provided scale.
IFontS * GetFontPtr()
Retrieves the pointer to the current font object.
SDpiAwareFont(void)
Constructor.
IFontS * OnGetFont(const SStringW &strDesc, int nScale)
Retrieves the font object based on the description and scale.
~SDpiAwareFont(void)
Destructor.
void SetFontDesc(const SStringW &strDesc, int nScale)
Sets the font description and scale.
A class representing an ASCII string.
Definition sstringw.h:96
Font object interface.
Definition SRender-i.h:650