TMSFNCFontDialog
The TMSFNCFontDialog is a component with a listbox filled with the available font names, a listbox filled with sizes, options for styles and a color picker. The sample area is in the bottom right corner, which shows the changes immediately.
Before executing the TMSFNCFontDialog, the font name, the size, the color and the sizes can be set. After the dialog is closed, the results can be retrieved via the same properties. These are the following: FontName, FontSize, FontColor, BoldSelected, ItalicSelected, UnderlineSelected, StrikethroughSelected.
procedure TForm1.Button1Click(Sender: TObject);
begin
TMSFNCFontDialog1.Execute;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
TMSFNCFontDialog1.FontName := ‘Courier’;
TMSFNCFontDialog1.FontSize := 16;
TMSFNCFontDialog1.FontColor := gcOrange;
TMSFNCFontDialog1.ItalicSelected := True;
end;

Executing and retrieving the results
Executing the TMSFNCFontDialog can be done with a single line of code in every platform:
TMSFNCFontDialog1.Execute;
Keep in mind, that different platforms have different behaviour. Tipically on the desktop, the code will stop from further executing until the dialog is closed, while in the WEB and on mobile platforms, it’s an async call. Therefore, use the OnDialogResult event to handle the results of the dialog.
procedure TForm1.TMSFNCFontDialog1DialogResult(Sender: TObject;
AModalResult: TModalResult);
begin
case AModalResult of
mrOK: TMSFNCHTMLText1.Text := 'OK clicked';
mrCancel: TMSFNCHTMLText1.Text := 'Cancelled';
end;
TMSFNCHTMLText1.Font.Name := TMSFNCFontDialog1.FontName;
TMSFNCHTMLText1.Font.Size := TMSFNCFontDialog1.FontSize;
TMSFNCHTMLText1.Font.Color := TMSFNCFontDialog1.FontColor;
if TMSFNCFontDialog1.BoldSelected then
TMSFNCHTMLText1.Font.Style := TMSFNCHTMLText1.Font.Style + [TFontStyle.fsBold];
if TMSFNCFontDialog1.ItalicSelected then
TMSFNCHTMLText1.Font.Style := TMSFNCHTMLText1.Font.Style + [TFontStyle.fsItalic];
if TMSFNCFontDialog1.UnderlineSelected then
TMSFNCHTMLText1.Font.Style := TMSFNCHTMLText1.Font.Style + [TFontStyle.fsUnderline];
if TMSFNCFontDialog1.StrikethroughSelected then
TMSFNCHTMLText1.Font.Style := TMSFNCHTMLText1.Font.Style + [TFontStyle.fsStrikeOut];
end;