Fastest way to change fonts globably
Fastest way to change fonts globably
Is there a fast way to change an entire text style fontname and then it is applied globably to a RichViewEdit?
Re: Fastest way to change fonts globably
Ah I found a pretty fast way to do it based off Costas' code. RichViewEdit and RichView are almost identical.
Code: Select all
procedure FontReplace;
var
i:Integer;
RVEStyle: TRVStyle;
begin
//We are going to try to replace RichViewEdit font and we are aiming for speed.
RVEStyle := RichViewEdit.Style;
for i := 0 to RVEStyle.TextStyles.Count-1 do
begin
if String(RVEStyle.TextStyles[i].FontName) = String('Replacement FontVariable goes here - use defaults, Segoe UI, Gentium, Cardo unless set in the module') then
RVEStyle.TextStyles[i].FontName := ' FontPref variable from theWord goes here ';
end;
RichViewEdit.Format;
end;