
Ofresco mis más sinceras disculpas por la respuesta anterior, me dejé engañar por algunas pruebas que hice y no profundicé lo suficiente en el tema.
De todos modos puedes construirte un record y guardar en el las características de tu Fuente, luego construir un cadena combencional con estas características y guardarla en la BD, a continuación te doy algunas ideas.
Código Delphi
[-]
TMyFont = Record
Nombre : String;
Size : Byte;
style : Array[1..3] of char;
Color : integer;
end;
Function FontToMyFont(FFont:TFont):TMyFont;
begin
Result.style := '000';
Result.Nombre :=FFont.Name;
Result.Size := FFont.Size;
if fsBold in FFont.Style then
Result.style[1]:='1';
if fsItalic in FFont.Style then
Result.style[2]:='1';
if fsUnderline in FFont.Style then
Result.style[3]:='1';
Result.Color := FFont.Color;
end;
Procedure MyFontToFont (Auxi : TFont;MyFont : TMyFont);
begin
Auxi.Name := MyFont.Nombre;
Auxi.Size := MyFont.Size;
Auxi.Color := MyFont.Color;
if MyFont.style[1]='1' then
Auxi.Style := Auxi.Style+[fsBold]
else
Auxi.Style := Auxi.Style-[fsBold];
if MyFont.style[2]='1' then
Auxi.Style := Auxi.Style+[fsItalic]
else
Auxi.Style := Auxi.Style-[fsItalic];
if MyFont.style[3]='1' then
Auxi.Style := Auxi.Style+[fsUnderline]
else
Auxi.Style := Auxi.Style-[fsUnderline];
end;
Function MyFonttoStr (MyFont:TMyFont): String;
var
Auxi : String;
begin
with MyFont do
Auxi := style+MyFont.Nombre+'@'+inttostr(Size)+'@'+inttostr(Color) ;
Result:= Auxi;
end;
Function StrToMyFont (Str:String):TMyFont;
var
Auxi : TMyFont;
i : Byte;
begin
for i := 1 to 3 do
Auxi.style[i] := str[i];
Delete(Str,1,3);
i:= pos('@',Str);
Auxi.Nombre := Copy(Str,1,i-1);
Delete(Str,1,i);
i:= pos('@',Str);
Auxi.Size := StrToInt(Copy(Str,1,i-1));
Delete(Str,1,i);
Auxi.Color := StrToInt(Str);
Result := Auxi;
end;
Bueno espero que ahora si te ayude este código.
Un saludo