Spread 8.0 Documentation
FontName Property
Support Options
ActiveX Reference > ActiveX Properties > FontName Property

Glossary Item Box

FontName Property


See Also    DLL

Applies To

fpSpread control

Description

Sets or returns the font used for the displayed text.

Syntax

C++

CString CSpreadSheet::GetFontName( );
void CSpreadSheet::SetFontName(LPCTSTR value);

Visual Basic

[form.]fpSpread.FontName[ = text$]

Remarks

The default value for the FontName property is determined by your system settings.

This setting is applied to the current sheet setting unless you first set the Sheet property to specify the sheet for which you are setting the property. Before specifying the font, specify the cell or cells to which to apply the font, as described in Using Column and Row Properties. Then set the font.

Note: When you set fonts, you are setting properties of the Font object. For more information about the Font object, see Font Object Settings.

Available fonts vary according to your system configuration, display devices, and printing devices. Font-related properties can be set only to values for which actual fonts exist.

If you use the FontName property to retrieve the font for a block of cells that do not all use the same font, the font used in the active cell is returned.

Notes:
  • In general, you should change the FontName property before you set size and style attributes with the FontSize, FontBold, FontItalic, FontStrikethru, and FontUnderline properties. However, when you set TrueType fonts to smaller than 8 points, you should set the point size with the FontSize property, then set the FontName property, and then set the size again with the FontSize property. The Windows environment uses a different font for TrueType fonts that are smaller than 8 points.
  • The method for accessing the Font properties varies depending on your development environment. In some environments, such as Visual Basic 4.0, you must double-click the Font property listed in the Properties window to access the Font dialog for setting font characteristics.
  • If you are using the fpSpread control with a language that uses the double-byte character set (DBCS), you must change the FontName property to a font that supports DBCS.

Visual Basic users can refer to the Visual Basic documentation for additional information about this property.

Spread Designer

Choose the Cell menu, then the Font menu, and then the Font tab, and then select the font in the Font combo box in the Cell Settings dialog box.

Specify the portion of the sheet to which to apply the font using the instructions in Selecting an Item in Spread Designer. Then use the combo box to specify the font.

Data Type

String

See Also

Font Object Settings
Setting the Font

Font, FontBold, FontItalic, FontSize, FontStrikethru, FontUnderline, Sheet properties

DLL Correspondence

SSGetFont, SSSetFont, SSSetFontRange functions

Copyright © GrapeCity, inc. All rights reserved.