Defines a particular format for text, including font face, size, and style attributes. This class cannot be inherited.
Constructors | |
| font (const font &prototype, float em_size) | |
| IInitializes a new Font that uses the specified existing xtd::drawing::font and size. More... | |
| font (const font &prototype, float em_size, font_style style) | |
| IInitializes a new Font that uses the specified existing xtd::drawing::font, size and font_style enumeration. More... | |
| font (const font &prototype, font_style style) | |
| IInitializes a new Font that uses the specified existing xtd::drawing::font and font_style enumeration. More... | |
| font (xtd::ustring family_name, float em_size, font_style style, graphics_unit unit, xtd::byte gdi_char_set, bool gdi_vertical_font) | |
| IInitializes a new xtd::drawing::font using the specified size, style, unit, and character set. More... | |
| font (const drawing::font_family &font_family, float em_size, font_style style, graphics_unit unit, xtd::byte gdi_char_set, bool gdi_vertical_font) | |
| Initializes a new xtd::drawing::font using the specified size, style, unit, and character set. More... | |
| font (xtd::ustring family_name, float em_size, font_style style, graphics_unit unit, xtd::byte gdi_char_set) | |
| Initializes a new xtd::drawing::font using the specified size, style, unit, and character set. More... | |
| font (const drawing::font_family &font_family, float em_size, font_style style, graphics_unit unit, xtd::byte gdi_char_set) | |
| Initializes a new xtd::drawing::font using the specified size, style, unit, and character set. More... | |
| font (xtd::ustring family_name, float em_size, font_style style, graphics_unit unit) | |
| Initializes a new xtd::drawing::font using the specified size, style and unit. More... | |
| font (const drawing::font_family &font_family, float em_size, font_style style, graphics_unit unit) | |
| Initializes a new xtd::drawing::font using the specified size, style and unit. More... | |
| font (xtd::ustring family_name, float em_size, font_style style) | |
| Initializes a new xtd::drawing::font using the specified size and style. More... | |
| font (const drawing::font_family &font_family, float em_size, font_style style) | |
| Initializes a new xtd::drawing::font using the specified size and style. More... | |
| font (xtd::ustring family_name, float em_size, graphics_unit unit) | |
| Initializes a new xtd::drawing::font using the specified size and unit. More... | |
| font (const drawing::font_family &font_family, float em_size, graphics_unit unit) | |
| Initializes a new xtd::drawing::font using the specified size and unit. More... | |
| font (xtd::ustring family_name, float em_size) | |
| Initializes a new xtd::drawing::font using the specified size and unit. More... | |
| font (const drawing::font_family &font_family, float em_size) | |
| Initializes a new xtd::drawing::font using the specified size. More... | |
Properties | |
| bool | bold () const noexcept |
| Gets a value that indicates whether this xtd::drawing::font is bold. More... | |
| drawing::font_family | font_family () const noexcept |
| Gets the xtd::drawing::font_family associated with this xtd::drawing::font. More... | |
| xtd::byte | gdi_char_set () const noexcept |
| Gets a byte value that specifies the GDI character set that this xtd::drawing::font uses. More... | |
| bool | gdi_vertical_font () const noexcept |
| Gets a Boolean value that indicates whether this xtd::drawing::font is derived from a GDI vertical font. More... | |
| intptr | handle () const noexcept |
| Gets the window handle that the font is bound to. More... | |
| int32 | height () const noexcept |
| Gets the line spacing of this font. More... | |
| bool | is_system_font () const noexcept |
| Gets a value indicating whether the font is a member of xtd::drawing::system_fonts. More... | |
| bool | italic () const noexcept |
| Gets a value that indicates whether this xtd::drawing::font is italic. More... | |
| const xtd::ustring & | name () const noexcept |
| Gets the face name of this xtd::drawing::font. More... | |
| const xtd::ustring & | original_font_name () const noexcept |
| Gets the face name of this Font. More... | |
| float | size () const noexcept |
| Gets the em-size of this xtd::drawing::font measured in the units specified by the unit property. More... | |
| float | size_in_points () const noexcept |
| bool | strikeout () const noexcept |
| Gets a value that indicates whether this xtd::drawing::font is strikeout. More... | |
| font_style | style () const noexcept |
| Gets style information for this xtd::drawing::font. More... | |
| bool | underline () const noexcept |
| Gets a value that indicates whether this xtd::drawing::font is underline. More... | |
| graphics_unit | unit () const noexcept |
| Gets the unit of measure for this xtd::drawing::font. More... | |
Methods | |
| bool | equals (const font &value) const noexcept override |
| float | get_height () const |
| Returns the line spacing, in pixels, of this font. More... | |
| float | get_height (const graphics &graphics) const |
| Returns the line spacing, in the current unit of a specified xtd::drawing::graphics, of this font. More... | |
| float | get_height (float dpi) const |
| Returns the height, in pixels, of this Font when drawn to a device with the specified vertical resolution. More... | |
| intptr | to_hfont () const |
| xtd::ustring | to_string () const noexcept override |
| Converts this font_family to a human-readable string representation. More... | |
| static font | from_hdc (const intptr hdc) |
| Creates a font from the specified Windows handle to a device context. More... | |
| static font | from_hfont (const intptr hfont) |
| Creates a font from the specified Windows handle. More... | |
Additional Inherited Members | |
Public Member Functions inherited from xtd::object | |
| object ()=default | |
| Create a new instance of the ultimate base class object. More... | |
| bool | equals (const object &obj) const noexcept |
| Determines whether the specified object is equal to the current object. More... | |
| virtual size_t | get_hash_code () const noexcept |
| Serves as a hash function for a particular type. More... | |
| virtual type_object | get_type () const noexcept |
| Gets the type of the current instance. More... | |
| template<typename object_t > | |
| std::unique_ptr< object_t > | memberwise_clone () const noexcept |
| Creates a shallow copy of the current object. More... | |
Public Member Functions inherited from xtd::iequatable< font > | |
| virtual bool | equals (const font &) const noexcept=0 |
| Indicates whether the current object is equal to another object of the same type. More... | |
Static Public Member Functions inherited from xtd::object | |
| static bool | equals (const object &object_a, const object &object_b) noexcept |
| Determines whether the specified object instances are considered equal. More... | |
| static bool | reference_equals (const object &object_a, const object &object_b) noexcept |
| Determines whether the specified object instances are the same instance. More... | |
| xtd::drawing::font::font | ( | const font & | prototype, |
| float | em_size | ||
| ) |
IInitializes a new Font that uses the specified existing xtd::drawing::font and size.
| prototype | The existing xtd::drawing::font from which to create the new xtd::drawing::font. |
| em_size | The em-size of the new font in the units specified by the unit parameter. |
| xtd::drawing::font::font | ( | const font & | prototype, |
| float | em_size, | ||
| font_style | style | ||
| ) |
IInitializes a new Font that uses the specified existing xtd::drawing::font, size and font_style enumeration.
| prototype | The existing xtd::drawing::font from which to create the new xtd::drawing::font. |
| em_size | The em-size of the new font in the units specified by the unit parameter. |
| style | The font_style to apply to the new xtd::drawing::font. Multiple values of the font_style enumeration can be combined with the OR operator. |
| xtd::drawing::font::font | ( | const font & | prototype, |
| font_style | style | ||
| ) |
IInitializes a new Font that uses the specified existing xtd::drawing::font and font_style enumeration.
| prototype | The existing xtd::drawing::font from which to create the new xtd::drawing::font. |
| style | The font_style to apply to the new xtd::drawing::font. Multiple values of the font_style enumeration can be combined with the OR operator. |
| xtd::drawing::font::font | ( | xtd::ustring | family_name, |
| float | em_size, | ||
| font_style | style, | ||
| graphics_unit | unit, | ||
| xtd::byte | gdi_char_set, | ||
| bool | gdi_vertical_font | ||
| ) |
IInitializes a new xtd::drawing::font using the specified size, style, unit, and character set.
| family_name | A string representation of the font_family for the new xtd::drawing::font. |
| em_size | The em-size of the new font in the units specified by the unit parameter. |
| style | The font_style of the new xtd::drawing::font. |
| unit | The graphics_unit of the new xtd::drawing::font. |
| gdi_char_set | A byte that specifies a GDI character set to use for this font. |
| gdi_vertical_font | A boolean value indicating whether the new xtd::drawing::font is derived from a GDI vertical font. |
| std::invalid_param | emSize is less than or equal to 0, evaluates to infinity, or is not a valid number. |
| xtd::drawing::font::font | ( | const drawing::font_family & | font_family, |
| float | em_size, | ||
| font_style | style, | ||
| graphics_unit | unit, | ||
| xtd::byte | gdi_char_set, | ||
| bool | gdi_vertical_font | ||
| ) |
Initializes a new xtd::drawing::font using the specified size, style, unit, and character set.
| font_family | The font_family of the new Font. |
| em_size | The em-size of the new font in the units specified by the unit parameter. |
| style | The font_style of the new xtd::drawing::font. |
| unit | The graphics_unit of the new xtd::drawing::font. |
| gdi_char_set | A byte that specifies a GDI character set to use for this font. |
| gdi_vertical_font | A boolean value indicating whether the new xtd::drawing::font is derived from a GDI vertical font. |
| std::invalid_param | emSize is less than or equal to 0, evaluates to infinity, or is not a valid number. |
| xtd::drawing::font::font | ( | xtd::ustring | family_name, |
| float | em_size, | ||
| font_style | style, | ||
| graphics_unit | unit, | ||
| xtd::byte | gdi_char_set | ||
| ) |
Initializes a new xtd::drawing::font using the specified size, style, unit, and character set.
| family_name | A string representation of the font_family for the new xtd::drawing::font. |
| em_size | The em-size of the new font in the units specified by the unit parameter. |
| style | The font_style of the new xtd::drawing::font. |
| unit | The graphics_unit of the new xtd::drawing::font. |
| gdi_char_set | A byte that specifies a GDI character set to use for this font. |
| std::invalid_param | emSize is less than or equal to 0, evaluates to infinity, or is not a valid number. |
| xtd::drawing::font::font | ( | const drawing::font_family & | font_family, |
| float | em_size, | ||
| font_style | style, | ||
| graphics_unit | unit, | ||
| xtd::byte | gdi_char_set | ||
| ) |
Initializes a new xtd::drawing::font using the specified size, style, unit, and character set.
| font_family | The font_family of the new Font. |
| em_size | The em-size of the new font in the units specified by the unit parameter. |
| style | The font_style of the new xtd::drawing::font. |
| unit | The graphics_unit of the new xtd::drawing::font. |
| gdi_char_set | A byte that specifies a GDI character set to use for this font. |
| std::invalid_param | emSize is less than or equal to 0, evaluates to infinity, or is not a valid number. |
| xtd::drawing::font::font | ( | xtd::ustring | family_name, |
| float | em_size, | ||
| font_style | style, | ||
| graphics_unit | unit | ||
| ) |
Initializes a new xtd::drawing::font using the specified size, style and unit.
| family_name | A string representation of the font_family for the new xtd::drawing::font. |
| em_size | The em-size of the new font in the units specified by the unit parameter. |
| style | The font_style of the new xtd::drawing::font. |
| unit | The graphics_unit of the new xtd::drawing::font. |
| std::invalid_param | emSize is less than or equal to 0, evaluates to infinity, or is not a valid number. |
| xtd::drawing::font::font | ( | const drawing::font_family & | font_family, |
| float | em_size, | ||
| font_style | style, | ||
| graphics_unit | unit | ||
| ) |
Initializes a new xtd::drawing::font using the specified size, style and unit.
| font_family | The font_family of the new Font. |
| em_size | The em-size of the new font in the units specified by the unit parameter. |
| style | The font_style of the new xtd::drawing::font. |
| unit | The graphics_unit of the new xtd::drawing::font. |
| std::invalid_param | emSize is less than or equal to 0, evaluates to infinity, or is not a valid number. |
| xtd::drawing::font::font | ( | xtd::ustring | family_name, |
| float | em_size, | ||
| font_style | style | ||
| ) |
Initializes a new xtd::drawing::font using the specified size and style.
| family_name | A string representation of the font_family for the new xtd::drawing::font. |
| em_size | The em-size of the new font in the units specified by the unit parameter. |
| style | The font_style of the new xtd::drawing::font. |
| std::invalid_param | emSize is less than or equal to 0, evaluates to infinity, or is not a valid number. |
| xtd::drawing::font::font | ( | const drawing::font_family & | font_family, |
| float | em_size, | ||
| font_style | style | ||
| ) |
Initializes a new xtd::drawing::font using the specified size and style.
| font_family | The font_family of the new Font. |
| em_size | The em-size of the new font in the units specified by the unit parameter. |
| style | The font_style of the new xtd::drawing::font. |
| std::invalid_param | emSize is less than or equal to 0, evaluates to infinity, or is not a valid number. |
| xtd::drawing::font::font | ( | xtd::ustring | family_name, |
| float | em_size, | ||
| graphics_unit | unit | ||
| ) |
Initializes a new xtd::drawing::font using the specified size and unit.
| family_name | A string representation of the font_family for the new xtd::drawing::font. |
| em_size | The em-size of the new font in the units specified by the unit parameter. |
| unit | The graphics_unit of the new xtd::drawing::font. |
| std::invalid_param | emSize is less than or equal to 0, evaluates to infinity, or is not a valid number. |
| xtd::drawing::font::font | ( | const drawing::font_family & | font_family, |
| float | em_size, | ||
| graphics_unit | unit | ||
| ) |
Initializes a new xtd::drawing::font using the specified size and unit.
| font_family | The font_family of the new Font. |
| em_size | The em-size of the new font in the units specified by the unit parameter. |
| unit | The graphics_unit of the new xtd::drawing::font. |
| std::invalid_param | emSize is less than or equal to 0, evaluates to infinity, or is not a valid number. |
| xtd::drawing::font::font | ( | xtd::ustring | family_name, |
| float | em_size | ||
| ) |
Initializes a new xtd::drawing::font using the specified size and unit.
| family_name | A string representation of the font_family for the new xtd::drawing::font. |
| em_size | The em-size of the new font in the units specified by the unit parameter. |
| std::invalid_param | emSize is less than or equal to 0, evaluates to infinity, or is not a valid number. |
| xtd::drawing::font::font | ( | const drawing::font_family & | font_family, |
| float | em_size | ||
| ) |
Initializes a new xtd::drawing::font using the specified size.
| font_family | The font_family of the new Font. |
| em_size | The em-size of the new font in the units specified by the unit parameter. |
| std::invalid_param | emSize is less than or equal to 0, evaluates to infinity, or is not a valid number. |
|
noexcept |
Gets a value that indicates whether this xtd::drawing::font is bold.
|
noexcept |
Gets the xtd::drawing::font_family associated with this xtd::drawing::font.
Creates a font from the specified Windows handle to a device context.
| hdc | A handle to a device context. |
Creates a font from the specified Windows handle.
| hfont | A Windows handle to a GDI font. |
|
noexcept |
Gets a byte value that specifies the GDI character set that this xtd::drawing::font uses.
| 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 |
|
noexcept |
Gets a Boolean value that indicates whether this xtd::drawing::font is derived from a GDI vertical font.
| float xtd::drawing::font::get_height | ( | ) | const |
Returns the line spacing, in pixels, of this font.
| float xtd::drawing::font::get_height | ( | const graphics & | graphics | ) | const |
Returns the line spacing, in the current unit of a specified xtd::drawing::graphics, of this font.
| graphics | A xtd::drawing::graphics that holds the vertical resolution, in dots per inch, of the display device as well as settings for page unit and page scale. |
| float xtd::drawing::font::get_height | ( | float | dpi | ) | const |
Returns the height, in pixels, of this Font when drawn to a device with the specified vertical resolution.
| dpi | The vertical resolution, in dots per inch, used to calculate the height of the font. |
|
noexcept |
Gets the window handle that the font is bound to.
|
noexcept |
Gets the line spacing of this font.
|
noexcept |
Gets a value indicating whether the font is a member of xtd::drawing::system_fonts.
|
noexcept |
Gets a value that indicates whether this xtd::drawing::font is italic.
|
noexcept |
Gets the face name of this xtd::drawing::font.
|
noexcept |
Gets the face name of this Font.
|
noexcept |
Gets the em-size of this xtd::drawing::font measured in the units specified by the unit property.
|
noexcept |
Gets the em-size, in points, of this xtd::drawing::font.
|
noexcept |
Gets a value that indicates whether this xtd::drawing::font is strikeout.
|
noexcept |
Gets style information for this xtd::drawing::font.
| intptr xtd::drawing::font::to_hfont | ( | ) | const |
|
overridevirtualnoexcept |
Converts this font_family to a human-readable string representation.
Reimplemented from xtd::object.
|
noexcept |
Gets a value that indicates whether this xtd::drawing::font is underline.
|
noexcept |
Gets the unit of measure for this xtd::drawing::font.