Help Center›AfxNova
CDialog.FontNewmethod
Not documented upstream. This symbol was found in the AfxNova source but appears in no documentation topic. The signature below is read directly from the code; any description comes from the source comments.
Syntax
PRIVATE FUNCTION CDialog.FontNew (BYREF wszFaceName AS WSTRING, BYVAL lPointSize AS LONG, BYVAL lWeight AS LONG = 0, BYVAL bItalic AS UBYTE = FALSE, BYVAL bUnderline AS UBYTE = FALSE, BYVAL bStrikeOut AS UBYTE = FALSE, BYVAL bCharSet AS UBYTE = DEFAULT_CHARSET) AS HFONT
Parameters
| Name | Description | |
|---|---|---|
wszFaceName | = The typeface name. | |
lPointSize | = The point size. | |
DPI | = Dots per inch to calculate scaling. Default value = 96 (no scaling). If you pass -1 and the application is DPI aware, the DPI value used by the operating system will be used. | |
lWeight | = The weight of the font in the range 0 through 1000. For example, 400 is normal and 700 is bold. If this value is zero, a default weight is used. The following values are defined for convenience. FW_DONTCARE (0), FW_THIN (100), FW_EXTRALIGHT (200), FW_ULTRALIGHT (200), FW_LIGHT (300), FW_NORMAL (400), FW_REGULAR (400), FW_MEDIUM (500), FW_SEMIBOLD (600), FW_DEMIBOLD (600), FW_BOLD (700), FW_EXTRABOLD (800), FW_ULTRABOLD (800), FW_HEAVY (900), FW_BLACK (900) | |
bItalic | = Italic flag. CTRUE or FALSE | |
bUnderline | = Underline flag. CTRUE or FALSE | |
bStrikeOut | = StrikeOut flag. CTRUE or FALSE | |
bCharset | = Charset. The following values are predefined: ANSI_CHARSET, BALTIC_CHARSET, CHINESEBIG5_CHARSET, DEFAULT_CHARSET, EASTEUROPE_CHARSET, GB2312_CHARSET, GREEK_CHARSET, HANGUL_CHARSET, MAC_CHARSET, OEM_CHARSET, RUSSIAN_CHARSET, SHIFTJIS_CHARSET, SYMBOL_CHARSET, TURKISH_CHARSET, VIETNAMESE_CHARSET, JOHAB_CHARSET (Korean language edition of Windows), ARABIC_CHARSET and HEBREW_CHARSET (Middle East language edition of Windows), THAI_CHARSET (Thai language edition of Windows). The OEM_CHARSET value specifies a character set that is operating-system dependent. DEFAULT_CHARSET is set to a value based on the current system locale. For example, when the system locale is English (United States), it is set as ANSI_CHARSET. Fonts with other character sets may exist in the operating system. If an application uses a font with an unknown character set, it should not attempt to translate or interpret strings that are rendered with that font. This parameter is important in the font mapping process. To ensure consistent results, specify a specific character set. If you specify a typeface name in the lfFaceName member, make sure that the lfCharSet value matches the character set of the typeface specified in lfFaceName. |
Return value
The handle of the font or NULL on failure. Remarks: The returned font must be destroyed with DeleteObject or the macro DeleteFont when no longer needed to prevent memory leaks. Usage examples: hFont = FontNew("MS Sans Serif", 8, FW_NORMAL) hFont = FontNew("Courier New", 10, FW_BOLD) hFont = FontNew("Marlett", 8, FW_NORMAL, , , , SYMBOL_CHARSET)
Reference
- Include file
CDialog.inc - Defined in AfxNova/CDialog.inc:2138