FaceName

Applies to

Controls that can display text

Description

The FaceName property specifies the typeface used for text in the control. For tab controls, the property specifies the typeface for text labels on tabs.

The typefaces available for your use are those installed on your system. Keep in mind that the fonts available to you may not be available where you deploy your application.

If you plan to deploy the application as a .NET Windows Forms application and you use a bitmap (screen) font such as MS Sans Serif instead of a True Type font, make sure you select a predefined font size from the TextSize drop-down list. PowerBuilder and .NET use different functions (CreateFontDirect and GdipCreateFont) to render bitmap fonts, and they may display larger in the .NET application than in the development environment or a standard PowerBuilder application. For example, text that uses the MS Sans Serif typeface and the undefined text size 16 looks the same as size 14 in PowerBuilder, but looks larger in .NET.

Usage

This property does not work in MonthCalendar controls on the Microsoft Vista operating system.


In a painter

StepsTo set the typeface of text in a control:

  1. Select a typeface from the FaceName list box on the Font tab page of the control’s Properties view.

StepsTo set the typeface of text objects in a graph control:

  1. Display the Text tab page of the graph control’s Properties view.

  2. Select the desired text object from the Text Object list box.

  3. Select a typeface from the FaceName list box.


In scripts

The FaceName property takes a string value. The following example sets the font for text labels on tab pages of a tab control to the Arial typeface:

tab_1.FaceName = "Arial"