|
uLib
User mode C/C++ extended API library for Win32 programmers.
|
TTResFont supports TrueType fonts embedded as resources. More...
#include <uLib/ResFont.h>
TTResFont supports TrueType fonts embedded as resources.
It uses the TTF name table to find the typeface name, hence
using it on a non-TTF resource will produce undefined results, possibly GPF.
Public Data | |
| TCHAR | TypeFace [LF_FACESIZE] |
Public Functions | |
| TTResFont () | |
| TTResFont (HMODULE hModule, CSTR Id, CSTR Type) | |
| virtual | ~TTResFont () |
| bool | Load (HMODULE hModule, CSTR Id, CSTR Type) |
| HFONT | CreateFont (int Points, int Weight, DWORD CharSet=ANSI_CHARSET, DWORD Quality=ANTIALIASED_QUALITY) |
| TTResFont::TTResFont | ( | ) |
You must use Load() to load the TTF before use.
Definition at line 12 of file ResFont.cpp.
Initialize and call Load().
Definition at line 18 of file ResFont.cpp.
|
virtual |
Uninstall and free memory..
Definition at line 25 of file ResFont.cpp.
Load a TTF resource with Id from hModule.
As this is a custom resource, you should normally use a Type id > 255.
Definition at line 30 of file ResFont.cpp.
| HFONT TTResFont::CreateFont | ( | int | Points, |
| int | Weight, | ||
| DWORD | CharSet = ANSI_CHARSET, |
||
| DWORD | Quality = ANTIALIASED_QUALITY |
||
| ) |
Create a GUI font of the TTF species.
Since TypeFace is already known, you don't need to specify it.
| Points | Height, in typographic points (1/72" each). |
| Weight | Weight, f.ex. FW_NORMAL or FW_BOLD. |
| CharSet | Character set to use. Default is ANSI. |
| Quality | Font rendering quality |
Definition at line 44 of file ResFont.cpp.
| TCHAR TTResFont::TypeFace[LF_FACESIZE] |