xtd 0.2.0
Loading...
Searching...
No Matches
xtd::drawing::native::font Class Referencefinal
Inheritance diagram for xtd::drawing::native::font:
xtd::static_object

Definition

Contains font native API.

Namespace
xtd::drawing::native
Library
xtd.drawing.native
Warning
Internal use only

Protected Static Methods

static intptr create (const xtd::string &family_name, float em_size, bool bold, bool italic, bool underline, bool strikeout, xtd::byte gdi_char_set, bool gdi_vertical_font)
 Creates font.
 
static intptr create_from_hdc (intptr hdc)
 Creates font from hdc.
 
static intptr create_from_hfont (intptr hfont)
 Creates font from hfont.
 
static void destroy (intptr font)
 Destroys the font.
 
static int32 dpi ()
 Gets the screen dpi .
 
static void get_information (intptr font, xtd::string &name, float &em_size, bool &bold, bool &italic, bool &underline, bool &strikeout, xtd::byte &gdi_char_set, bool &gdi_vertical_font)
 Gets the font information from font hanfle.
 
static float height (intptr font)
 Gets the font height.
 
static float height (intptr font, intptr hdc)
 Gets the font height for the specified hdc.
 

Member Function Documentation

◆ create()

static intptr xtd::drawing::native::font::create ( const xtd::string family_name,
float  em_size,
bool  bold,
bool  italic,
bool  underline,
bool  strikeout,
xtd::byte  gdi_char_set,
bool  gdi_vertical_font 
)
staticprotected

Creates font.

Parameters
family_nameA string representation of the font family for the new font.
em_sizeThe em-size of the new font in pixels.
boldtrue if font is bold; otherwise false.
italictrue if font is italic; otherwise false.
underlinetrue if font is underline; otherwise false.
strikeouttrue if font is strikeout; otherwise false.
gdi_char_setA byte that specifies a GDI character set to use for this font.
gdi_vertical_fontA boolean value indicating whether the new xtd::drawing::font is derived from a GDI vertical font.
Returns
The created font handle.
Warning
Internal use only

◆ create_from_hdc()

static intptr xtd::drawing::native::font::create_from_hdc ( intptr  hdc)
staticprotected

Creates font from hdc.

Parameters
hdcThe handle of the device context font.
Returns
The created font handle.
Warning
Internal use only

◆ create_from_hfont()

static intptr xtd::drawing::native::font::create_from_hfont ( intptr  hfont)
staticprotected

Creates font from hfont.

Parameters
hfontThe handle of the font.
Returns
The created font handle.
Warning
Internal use only

◆ destroy()

static void xtd::drawing::native::font::destroy ( intptr  font)
staticprotected

Destroys the font.

Parameters
fontThe font handle.
Warning
Internal use only

◆ dpi()

static int32 xtd::drawing::native::font::dpi ( )
staticprotected

Gets the screen dpi .

Returns
The screen dpi.
Warning
Internal use only

◆ get_information()

static void xtd::drawing::native::font::get_information ( intptr  font,
xtd::string name,
float &  em_size,
bool &  bold,
bool &  italic,
bool &  underline,
bool &  strikeout,
xtd::byte gdi_char_set,
bool &  gdi_vertical_font 
)
staticprotected

Gets the font information from font hanfle.

Parameters
fontThe font handle to retrieve informations.
nameThe font name.
em_sizeThe font em-size.
boldTrue is the font is bold; otherwise false.
italicTrue is the font is italic; otherwise false.
underlineTrue is the font is underline; otherwise false.
strikeoutTrue is the font is strikeout; otherwise false.
gdi_char_setThe GDI character set.
gdi_vertical_fontTrue is the font is GDI vertical font; otherwise false.
 Character set  Value
ANSI 0
DEFAULT 1
SYMBOL  2
SHIFTJIS 128
HANGEUL 129
HANGUL 129
GB2312 134
CHINESEBIG5 136
OEM  255
JOHAB  130
HEBREW 177
ARABIC  178
GREEK  161
TURKISH 162
VIETNAMESE 163
THAI  222
EASTEUROPE  238
RUSSIAN  204
MAC 77
BALTIC  186
Warning
Internal use only

◆ height() [1/2]

static float xtd::drawing::native::font::height ( intptr  font)
staticprotected

Gets the font height.

Parameters
fontThe font handle.
Returns
The font height.
Warning
Internal use only

◆ height() [2/2]

static float xtd::drawing::native::font::height ( intptr  font,
intptr  hdc 
)
staticprotected

Gets the font height for the specified hdc.

Parameters
fontThe font handle.
hdcThe device context handle.
Returns
The font height.
Warning
Internal use only

The documentation for this class was generated from the following file: