Prompts the user to choose a font from among those installed on the local computer.
| Windows | macOS | Gnome | |
|---|---|---|---|
| Light |   
 |   
 |   
 | 
| Dark |   
 |   
 |   
 | 
Public Events | |
| event< font_dialog, event_handler > | apply | 
| Occurs when the user clicks the Apply button in the font dialog box.   | |
Public Constructors | |
| font_dialog () | |
| Initializes a new instance of the font_dialog class.   | |
Public Properties | |
| bool | allow_script_change () const noexcept | 
| Gets a value indicating whether the user can change the character set specified in the Script combo box to display a character set other than the one currently displayed.   | |
| font_dialog & | allow_script_change (bool allow_script_change) | 
| Sets a value indicating whether the user can change the character set specified in the Script combo box to display a character set other than the one currently displayed.   | |
| bool | allow_simulation () const noexcept | 
| Gets a value indicating whether the dialog box allows graphics device interface (GDI) font simulations.   | |
| font_dialog & | allow_simulation (bool allow_simulation) | 
| Sets a value indicating whether the dialog box allows graphics device interface (GDI) font simulations.   | |
| bool | allow_vector_fonts () const noexcept | 
| Gets a value indicating whether the dialog box allows vector font selections.   | |
| font_dialog & | allow_vector_fonts (bool allow_vector_fonts) | 
| Sets a value indicating whether the dialog box allows vector font selections.   | |
| bool | allow_vertical_fonts () const noexcept | 
| Gets a value indicating whether the dialog box displays both vertical and horizontal fonts or only horizontal fonts.   | |
| font_dialog & | allow_vertical_fonts (bool allow_vertical_fonts) | 
| Sets a value indicating whether the dialog box displays both vertical and horizontal fonts or only horizontal fonts.   | |
| drawing::color | color () const noexcept | 
| Gets the selected font color.   | |
| font_dialog & | color (const drawing::color &color) | 
| Sets the selected font color.   | |
| bool | fixed_pitch_only () const noexcept | 
| Gets a value indicating whether the dialog box allows only the selection of fixed-pitch fonts.   | |
| font_dialog & | fixed_pitch_only (bool fixed_pitch_only) | 
| Sets a value indicating whether the dialog box allows only the selection of fixed-pitch fonts.   | |
| drawing::font | font () const noexcept | 
| Gets the selected font.   | |
| font_dialog & | font (const drawing::font &font) | 
| Sets the selected font.   | |
| bool | font_must_exist () const noexcept | 
| Gets a value indicating whether the dialog box specifies an error condition if the user attempts to select a font or style that does not exist.   | |
| font_dialog & | font_must_exist (bool font_must_exist) | 
| Sets a value indicating whether the dialog box specifies an error condition if the user attempts to select a font or style that does not exist.   | |
| size_t | max_size () const noexcept | 
| Gets the maximum point size a user can select.   | |
| font_dialog & | max_size (size_t max_size) | 
| Sets the maximum point size a user can select.   | |
| size_t | min_size () const noexcept | 
| Gets the minimum point size a user can select.   | |
| font_dialog & | min_size (size_t min_size) | 
| Sets the minimum point size a user can select.   | |
| size_t | options () const noexcept | 
| Gets values to initialize the font_dialog.   | |
| bool | script_only () const noexcept | 
| Gets a value indicating whether the dialog box allows selection of fonts for all non-OEM and Symbol character sets, as well as the ANSI character set.   | |
| font_dialog & | script_only (bool script_only) | 
| Sets a value indicating whether the dialog box allows selection of fonts for all non-OEM and Symbol character sets, as well as the ANSI character set.   | |
| bool | show_apply () const noexcept | 
| Gets a value indicating whether the dialog box contains an Apply button.   | |
| font_dialog & | show_apply (bool show_apply) | 
| Sets a value indicating whether the dialog box contains an Apply button.   | |
| bool | show_color () const noexcept | 
| Gets a value indicating whether the dialog box displays the color choice.   | |
| font_dialog & | show_color (bool show_color) | 
| Sets a value indicating whether the dialog box displays the color choice.   | |
| bool | show_effect () const noexcept | 
| Gets a value indicating whether the dialog box contains controls that allow the user to specify strikethrough, underline, and text color options.   | |
| font_dialog & | show_effect (bool show_effect) | 
| Sets a value indicating whether the dialog box contains controls that allow the user to specify strikethrough, underline, and text color options.   | |
| bool | show_help () const noexcept | 
| Gets a value indicating whether the dialog box displays a Help button.   | |
| font_dialog & | show_help (bool show_help) | 
| Sets a value indicating whether the dialog box displays a Help button.   | |
Public Methods | |
| void | reset () noexcept override | 
| Resets all dialog box options to their default values.   | |
Protected Methods | |
| virtual void | on_apply (const event_args &e) | 
| Raises the font_dialog::apply event.   | |
| bool | run_dialog (intptr owner) override | 
| void | run_sheet (intptr owner) override | 
| When overridden in a derived class, specifies a common dialog box.   | |
Additional Inherited Members | |
  Public Attributes inherited from xtd::forms::common_dialog | |
| event< common_dialog, help_event_handler > | help_request | 
| Occurs when the user clicks the Help button on a common dialog box.   | |
| event< common_dialog, dialog_closed_event_handler > | dialog_closed | 
| Occurs when the user close a common dialog box with dialog close button or other dialog buttons.   | |
  Public Member Functions inherited from xtd::forms::common_dialog | |
| common_dialog () | |
| Initializes a new instance of the common_dialog class.   | |
| xtd::forms::dialog_result | dialog_result () const noexcept | 
| Gets async dialog_result result after dialog box is closing.   | |
| std::any | tag () const noexcept | 
| Gets an object that contains data about the control.   | |
| common_dialog & | tag (const std::any &tag) | 
| Sets an object that contains data about the control.   | |
| xtd::forms::dialog_result | show_dialog () | 
| Runs a common dialog box with a default owner.   | |
| xtd::forms::dialog_result | show_dialog (const iwin32_window &owner) | 
| Runs a common dialog box with the specified owner.   | |
| void | show_sheet (const iwin32_window &owner) | 
| Runs a common dialog box with the specified owner.   | |
| xtd::forms::dialog_result | show_sheet_dialog (const iwin32_window &owner) | 
| Runs a common dialog box with the specified owner.   | |
  Public Member Functions inherited from xtd::object | |
| object ()=default | |
| Create a new instance of the ultimate base class object.   | |
| virtual bool | equals (const object &obj) const noexcept | 
| Determines whether the specified object is equal to the current object.   | |
| virtual size_t | get_hash_code () const noexcept | 
| Serves as a hash function for a particular type.   | |
| virtual type_object | get_type () const noexcept | 
| Gets the type of the current instance.   | |
| template<typename object_t > | |
| xtd::uptr< object_t > | memberwise_clone () const | 
| Creates a shallow copy of the current object.   | |
| virtual xtd::string | to_string () const noexcept | 
| Returns a xtd::string that represents the current object.   | |
  Static Public Member Functions inherited from xtd::object | |
| template<typename object_a_t , typename object_b_t > | |
| static bool | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept | 
| Determines whether the specified object instances are considered equal.   | |
| template<typename object_a_t , typename object_b_t > | |
| static bool | reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept | 
| Determines whether the specified object instances are the same instance.   | |
  Protected Member Functions inherited from xtd::forms::common_dialog | |
| virtual void | on_dialog_closed (const dialog_closed_event_args &e) | 
| Raises the common_dialog::dialog_close event.   | |
| virtual void | on_help_request (help_event_args &e) | 
| Raises the common_dialog::help_request event.   | |
| void | set_dialog_result (xtd::forms::dialog_result value) | 
| Sets async dialog_result result after dialog box is closing.   | |
  Protected Member Functions inherited from xtd::forms::component | |
| component () | |
| Initialises a new instance of the component class.   | |
| virtual bool | can_raise_events () const noexcept | 
| Gets a value indicating whether the component can raise an event.   | |
| bool | design_mode () const noexcept | 
| Gets a value that indicates whether the component is currently in design mode.   | |
| xtd::forms::font_dialog::font_dialog | ( | ) | 
Initializes a new instance of the font_dialog class.
| Property | Initial value | 
|---|---|
| allow_simulations | true | 
| allow_vector_fonts | true | 
| allow_vertical_fonts | true | 
| allow_script_change | true | 
| color | color::black | 
| fixed_pitch_only | false | 
| max_size | 0 | 
| min_size | 0 | 
| scripts_only | false | 
| show_apply | false | 
| show_color | false | 
| show_effects | true | 
| show_help | false | 
      
  | 
  noexcept | 
Gets a value indicating whether the user can change the character set specified in the Script combo box to display a character set other than the one currently displayed.
| font_dialog & xtd::forms::font_dialog::allow_script_change | ( | bool | allow_script_change | ) | 
Sets a value indicating whether the user can change the character set specified in the Script combo box to display a character set other than the one currently displayed.
| allow_script_change | true if the user can change the character set specified in the Script combo box; otherwise, false. The default value is true. | 
      
  | 
  noexcept | 
Gets a value indicating whether the dialog box allows graphics device interface (GDI) font simulations.
| font_dialog & xtd::forms::font_dialog::allow_simulation | ( | bool | allow_simulation | ) | 
Sets a value indicating whether the dialog box allows graphics device interface (GDI) font simulations.
| allow_simulation | true if font simulations are allowed; otherwise, false. The default value is true. | 
      
  | 
  noexcept | 
Gets a value indicating whether the dialog box allows vector font selections.
| font_dialog & xtd::forms::font_dialog::allow_vector_fonts | ( | bool | allow_vector_fonts | ) | 
Sets a value indicating whether the dialog box allows vector font selections.
| allow_vector_fonts | true if vector fonts are allowed; otherwise, false. The default value is true. | 
      
  | 
  noexcept | 
Gets a value indicating whether the dialog box displays both vertical and horizontal fonts or only horizontal fonts.
| font_dialog & xtd::forms::font_dialog::allow_vertical_fonts | ( | bool | allow_vertical_fonts | ) | 
Sets a value indicating whether the dialog box displays both vertical and horizontal fonts or only horizontal fonts.
| allow_vertical_fonts | true if both vertical and horizontal fonts are allowed; otherwise, false. The default value is true. | 
      
  | 
  noexcept | 
Gets the selected font color.
| font_dialog & xtd::forms::font_dialog::color | ( | const drawing::color & | color | ) | 
Sets the selected font color.
| color | The color of the selected font. The default value is Black. | 
      
  | 
  noexcept | 
Gets a value indicating whether the dialog box allows only the selection of fixed-pitch fonts.
| font_dialog & xtd::forms::font_dialog::fixed_pitch_only | ( | bool | fixed_pitch_only | ) | 
Sets a value indicating whether the dialog box allows only the selection of fixed-pitch fonts.
| fixed_pitch_only | true if only fixed-pitch fonts can be selected; otherwise, false. The default value is false. | 
      
  | 
  noexcept | 
| font_dialog & xtd::forms::font_dialog::font | ( | const drawing::font & | font | ) | 
      
  | 
  noexcept | 
Gets a value indicating whether the dialog box specifies an error condition if the user attempts to select a font or style that does not exist.
| font_dialog & xtd::forms::font_dialog::font_must_exist | ( | bool | font_must_exist | ) | 
Sets a value indicating whether the dialog box specifies an error condition if the user attempts to select a font or style that does not exist.
| font_must_exist | true if the dialog box specifies an error condition when the user tries to select a font or style that does not exist; otherwise, false. The default is false. | 
      
  | 
  noexcept | 
Gets the maximum point size a user can select.
| font_dialog & xtd::forms::font_dialog::max_size | ( | size_t | max_size | ) | 
Sets the maximum point size a user can select.
| max_size | The maximum point size a user can select. The default is 0. | 
      
  | 
  noexcept | 
Gets the minimum point size a user can select.
| font_dialog & xtd::forms::font_dialog::min_size | ( | size_t | min_size | ) | 
Sets the minimum point size a user can select.
| min_size | The minimum point size a user can select. The default is 0. | 
      
  | 
  noexcept | 
Gets values to initialize the font_dialog.
      
  | 
  noexcept | 
Gets a value indicating whether the dialog box allows selection of fonts for all non-OEM and Symbol character sets, as well as the ANSI character set.
| font_dialog & xtd::forms::font_dialog::script_only | ( | bool | script_only | ) | 
Sets a value indicating whether the dialog box allows selection of fonts for all non-OEM and Symbol character sets, as well as the ANSI character set.
| script_script | = true if selection of fonts for all non-OEM and Symbol character sets, as well as the ANSI character set, is allowed; otherwise, false. The default value is false. | 
      
  | 
  noexcept | 
Gets a value indicating whether the dialog box contains an Apply button.
| font_dialog & xtd::forms::font_dialog::show_apply | ( | bool | show_apply | ) | 
Sets a value indicating whether the dialog box contains an Apply button.
| show_apply | true if the dialog box contains an Apply button; otherwise, false. The default value is false. | 
      
  | 
  noexcept | 
Gets a value indicating whether the dialog box displays the color choice.
| font_dialog & xtd::forms::font_dialog::show_color | ( | bool | show_color | ) | 
Sets a value indicating whether the dialog box displays the color choice.
| show_color | true if the dialog box displays the color choice; otherwise, false. The default value is false. | 
      
  | 
  noexcept | 
Gets a value indicating whether the dialog box contains controls that allow the user to specify strikethrough, underline, and text color options.
| font_dialog & xtd::forms::font_dialog::show_effect | ( | bool | show_effect | ) | 
Sets a value indicating whether the dialog box contains controls that allow the user to specify strikethrough, underline, and text color options.
| show_effect | true if the dialog box contains controls to set strikethrough, underline, and text color options; otherwise, false. The default value is true. | 
      
  | 
  noexcept | 
Gets a value indicating whether the dialog box displays a Help button.
| font_dialog & xtd::forms::font_dialog::show_help | ( | bool | show_help | ) | 
Sets a value indicating whether the dialog box displays a Help button.
| show_help | true if the dialog box displays a Help button; otherwise, false. The default value is false. | 
      
  | 
  overridevirtualnoexcept | 
Resets all dialog box options to their default values.
Implements xtd::forms::common_dialog.
      
  | 
  protectedvirtual | 
Raises the font_dialog::apply event.
| e | An event_args that contains the data. | 
      
  | 
  overrideprotectedvirtual | 
| owner | The window handle of the owner window for the common dialog box. | 
Implements xtd::forms::common_dialog.
      
  | 
  overrideprotectedvirtual | 
When overridden in a derived class, specifies a common dialog box.
| owner | A value that represents the window handle of the owner window for the common dialog box. | 
Implements xtd::forms::common_dialog.
| event<font_dialog, event_handler> xtd::forms::font_dialog::apply | 
Occurs when the user clicks the Apply button in the font dialog box.