xtd
1.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
font.cpp
Shows how to use
xtd::drawing::font
class.
#include <xtd/xtd>
using namespace
xtd::drawing
;
auto
main() ->
int
{
auto
font1 =
font
{
font_family::generic_monospace
(), 42.0f,
font_style::bold
};
console::write_line
(
"font1 = {0}"
, font1);
auto
font2 =
font
{
"Times New Roman"
, 24.0f};
console::write_line
(
"font2 = {0}"
, font2);
auto
font3 =
font
{
font_family::generic_serif
(), 24.0f};
console::write_line
(
"font3 = {0}"
, font3);
console::write_line
(
"font1 {0} font2"
, font1 == font2 ?
"=="
:
"!="
);
console::write_line
(
"font2 {0} font3"
, font2 == font3 ?
"=="
:
"!="
);
}
// This code can produce the following output :
//
// font1 = [font: name=Courier, size=42, units=3, gdi_char_set=0, gdi_vertical_font=false]
// font2 = [font: name=Times, size=24, units=3, gdi_char_set=0, gdi_vertical_font=false]
// font3 = [font: name=Times New Roman, size=24, units=3, gdi_char_set=0, gdi_vertical_font=false]
// font1 != font2
// font2 == font3
xtd::console::write_line
static auto write_line() -> void
Writes the current line terminator to the standard output stream using the specified format informati...
xtd::drawing::font_family::generic_serif
static auto generic_serif() noexcept -> font_family
Gets a generic serif font_family.
xtd::drawing::font_family::generic_monospace
static auto generic_monospace() noexcept -> font_family
Gets a generic monospace font_family.
xtd::drawing::font
Defines a particular format for text, including font face, size, and style attributes....
Definition
font.hpp:45
xtd::drawing::font_style::bold
@ bold
Bold text.
Definition
font_style.hpp:21
xtd::drawing
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition
actions_system_images.hpp:10
Generated on
for xtd by
Gammasoft
. All rights reserved.