TdxSpreadSheetCustomFont.Name Property
Specifies the font’s typeface name.
Declaration
property Name: TFontName read; write;
Property Value
Type |
---|
TFontName |
Remarks
Use this property to set the font typeface. If the specified font family includes multiple character sets, be sure to set the Charset property as well.
The following code example demonstrates how to use the Name property.
var
ATableView: TdxSpreadSheetTableView;
ACell: TdxSpreadSheetCell;
AFont: TdxSpreadSheetCellFont;
I: Integer;
const
AFontNames: array [0..3] of string = ('Impact', 'Courier New', 'Comic Sans MS', 'Bookman Old Style');
//...
ATableView := TdxSpreadSheetTableView(dxSpreadSheet1.ActiveSheet);
for I := 0 to 3 do
begin
ACell := ATableView.CreateCell(I, 0);
AFont := ACell.Style.Font;
AFont.Name := AFontNames[I];
AFont.Size := 12;
end;
To allow end-users to change the font typeface in the currently selected cells, you can link the ChangeFontName command to an element of your UI.
See Also