Hola superhopi.
Con estas dos funciones podrás guardar y recuperar el estilo de una fuente como un entero.
Código:
const
FNT_STYLE_BOLD = $0001;
FNT_STYLE_ITALIC = $0002;
FNT_STYLE_UNDERLINE = $0004;
FNT_STYLE_STRIKEOUT = $0008;
function FontStyleToInt(AFontStyle: TFontStyles): Integer;
begin
Result := 0;
if fsBold in AFontStyle then Result := Result or FNT_STYLE_BOLD;
if fsItalic in AFontStyle then Result := Result or FNT_STYLE_ITALIC;
if fsUnderline in AFontStyle then Result := Result or FNT_STYLE_UNDERLINE;
if fsStrikeOut in AFontStyle then Result := Result or FNT_STYLE_STRIKEOUT;
end;
function IntToFontStyle(AValue: Integer): TFontStyles;
begin
Result := [];
if (AValue and FNT_STYLE_BOLD) <> 0 then Include(Result, fsBold);
if (AValue and FNT_STYLE_ITALIC) <> 0 then Include(Result, fsItalic);
if (AValue and FNT_STYLE_UNDERLINE) <> 0 then Include(Result, fsUnderline);
if (AValue and FNT_STYLE_STRIKEOUT) <> 0 then Include(Result, fsStrikeOut);
end;
Sal
U2.