//---------------------将字体样式转化为字符串--------------------------
function TFrmRptSetup.SetFontStyle(FS: TFontStyles): string;
var
StrFS:string;
begin
//
StrFS:='[';
if fsBold in FS then
StrFS:=StrFS +'fsBold';
if fsItalic in FS then
if StrFS = '[' then
StrFS:= StrFS +'fsItalic'
else
StrFS:= StrFS +',fsItalic';
if fsUnderline in FS then
if StrFS = '[' then
StrFS := StrFS + 'fsUnderline'
else
StrFS := StrFS + ',fsUnderline';
if fsStrikeOut in FS then
if StrFS = '['then
StrFS:= StrFS + 'fsStrikeOut'
else
StrFS := StrFS + ',fsStrikeOut';
StrFS := StrFS + ']';
Result := StrFS;
end;
//----------------------将字符串转化为字体样式--------------------------
function TFrmRptSetup.GetFontStyle(StrFS: string): TFontStyles;
var
FS:TFontStyles;
begin
FS:=[];
if pos('fsBold', StrFS)> 0 then FS:= FS +[fsBold];
if Pos('fsItalic', StrFS)> 0 then FS:= FS + [fsItalic];
if Pos('fsUnderline', StrFS)>0 then FS:= FS + [fsUnderline];
if Pos('fsStrikeOut', StrFS)>0 then FS:= FS +[fsStrikeOut];
Result:= FS;
end;