Ich habe keine SynEdit-Komponente.
Aber ich denke, es muss so aussehen:
Delphi-Quellcode:
function FontStyleToInt(const AFontStyles: TFontStyles): Integer;
begin
Result := 0;
if fsBold in AFontStyles then
Result := Result or $01;
if fsItalic in AFontStyles then
Result := Result or $02;
if fsUnderline in AFontStyles then
Result := Result or $04;
if fsStrikeout in AFontStyles then
Result := Result or $08;
end;
Und so:
Delphi-Quellcode:
function IntToFontStyle(const AInt: Integer): TFontStyles;
begin
Result := [];
if (AInt and $01) <> 0 then
Include(Result, fsBold);
if (AInt and $02) <> 0 then
Include(Result, fsItalic);
if (AInt and $04) <> 0 then
Include(Result, fsUnderline);
if (AInt and $08) <> 0 then
Include(Result, fsStrikeOut);
end;