Skip to content
Snippets Groups Projects
Commit bb266ad1 authored by rswindell's avatar rswindell
Browse files

Saves and restores customized font styles (bold, italic, underline, etc).

parent 14385062
No related branches found
No related tags found
No related merge requests found
......@@ -1151,6 +1151,13 @@ void __fastcall TMainForm::ReadFont(AnsiString subkey, TFont* Font)
if(Registry->ValueExists("Size"))
Font->Size=Registry->ReadInteger("Size");
if(Registry->ValueExists("Style")) {
int style=Registry->ReadInteger("Style");
Font->Style=Font->Style.Clear();
for(int i=fsBold;i<=fsStrikeOut;i++)
if(style&(1<<i))
Font->Style=Font->Style<<(TFontStyle)i;
}
Registry->CloseKey();
delete Registry;
}
......@@ -1170,6 +1177,12 @@ void __fastcall TMainForm::WriteFont(AnsiString subkey, TFont* Font)
Registry->WriteInteger("Height",Font->Height);
Registry->WriteInteger("Size",Font->Size);
int style=0;
for(int i=fsBold;i<=fsStrikeOut;i++)
if(Font->Style.Contains((TFontStyle)i))
style|=(1<<i);
Registry->WriteInteger("Style",style);
Registry->CloseKey();
delete Registry;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment