Setting Initial Font
Posted: Sat May 04, 2013 7:55 pm
I try to set the initial font for load pascal (*.pas} file as text but after loading font is not correct. How to load .pas file with 'Courier New' Font size = 10?
Code: Select all
// set the initial font
iFontInfo := TFontInfo.Create(nil);
try
iFontInfo.FontName := 'Courier New';
iFontInfo.Size := 10;
iStyleNo := RichViewEdit.Style.TextStyles.FindSuchStyleEX(0, iFontInfo,
RVAllFontInfoProperties);
if iStyleNo < 0 then
begin
RichViewEdit.Style.TextStyles.Add;
iStyleNo := RichViewEdit.Style.TextStyles.Count - 1;
RichViewEdit.Style.TextStyles[iStyleNo].Assign(iFontInfo);
RichViewEdit.Style.TextStyles[iStyleNo].Standard := False;
end;
finally
iFontInfo.Free;
end;