Tema: Fuente
Ver Mensaje Individual
  #6  
Antiguo 20-08-2003
Lmas Lmas is offline
Miembro
 
Registrado: jul 2003
Ubicación: España
Posts: 27
Reputación: 0
Lmas Va por buen camino
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;
SalU2.
__________________
Una cosa es una cosa, y otra cosa es otra cosa...
Responder Con Cita