soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
SDpiAwareFont.h
1#ifndef __SDPIAWAREFONT__H__
2#define __SDPIAWAREFONT__H__
3
4SNSBEGIN
5
6/**
7 * @class SDpiAwareFont
8 * @brief Class for managing DPI-aware fonts.
9 * This class provides functionality to handle font scaling based on DPI settings.
10 */
11class SOUI_EXP SDpiAwareFont {
12 public:
13 /**
14 * @brief Constructor.
15 */
16 SDpiAwareFont(void);
17
18 /**
19 * @brief Destructor.
20 */
21 ~SDpiAwareFont(void);
22
23 /**
24 * @brief Retrieves the pointer to the current font object.
25 * @return Pointer to the IFontS object.
26 */
28
29 /**
30 * @brief Sets the font description and scale.
31 * @param strDesc Font description string.
32 * @param nScale DPI scaling factor.
33 */
34 void SetFontDesc(const SStringW &strDesc, int nScale);
35
36 /**
37 * @brief Updates the font based on the provided scale.
38 * @param nScale DPI scaling factor.
39 */
40 void UpdateFont(int nScale);
41
42 protected:
43 /**
44 * @brief Retrieves the font object based on the description and scale.
45 * @param strDesc Font description string.
46 * @param nScale DPI scaling factor.
47 * @return Pointer to the IFontS object.
48 */
49 IFontS *OnGetFont(const SStringW &strDesc, int nScale);
50
51 SStringW m_strDesc; // Font description string
52 SAutoRefPtr<IFontS> m_object; // Pointer to the font object
53};
54
55SNSEND
56
57#endif // __SDPIAWAREFONT__H__
Smart pointer class for managing COM-style reference-counted objects.
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.
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