Family: String;
The Family property returns font name.
To get font size, use the IGxFontBase.Size property.
Executing the example requires that the repository contains a regular report with the REGULAR_REPORT identifier, in which the first cell must be filled with any data.
Add links to the Drawing, Metabase, Report, Tab system assemblies.
Sub UserProc;
Var
Mb: IMetaBase;
Report: IPrxReport;
Range: ITabRange;
Font: IGxFontBase;
Family, Style: String;
Size: Double;
Begin
// Open regular report for edit
Mb := MetabaseClass.Active;
Report := Mb.ItemById("REG_REPORT").Edit As IPrxReport;
// Get the first cell of regular report
Range := (Report.Activesheet As IPrxTable).TabSheet.Cell(0, 0);
// Get font of the first cell
Font := Range.Style.Font.AsGxFont;
// Display font name in the console window
Family := Font.Family;
debug.WriteLine("Font name: " + Family);
// Display font size in the console window
Size := Font.Size;
Debug.WriteLine("Font size = " + Size.ToString);
// Display font style in the console window
Style := Font.Style.ToString;
Debug.WriteLine("Font style: " + Style);
End Sub UserProc;
After executing the example the console window displays basic font parameters.
See also: