From 7724052c76184b2f806039de6e27f833f41f4d29 Mon Sep 17 00:00:00 2001
From: "Rob Swindell (on Windows 11)" <rob@synchro.net>
Date: Wed, 27 Sep 2023 18:43:54 -0700
Subject: [PATCH] Don't read/write or import/export Font "Height" property,
 redundant with "Size"

Also:
For log message styles (e.g. colorization) based on log level, don't apply
a different font (Name) or size. This just looks terrible when this is done
and I don't think any sysops want that. Keep each log window using the same
font face (name) and size, just allow the color and style (e.g. bold, italics)
to change based on log severity.

This does increase the confusion with the Properties->Customize->Log Fonts
as the "Change Font" dialog still allows the sysop to select/change a font
face and size, they're just not saved/used. I coudln't find a way to remove
or disable these from the displayed TFontDialog form.
---
 src/sbbs3/ctrl/MainFormUnit.cpp | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/sbbs3/ctrl/MainFormUnit.cpp b/src/sbbs3/ctrl/MainFormUnit.cpp
index 86918cc5ac..391babe431 100644
--- a/src/sbbs3/ctrl/MainFormUnit.cpp
+++ b/src/sbbs3/ctrl/MainFormUnit.cpp
@@ -299,8 +299,10 @@ static void log_msg(TRichEdit* Log, log_msg_t* msg)
 		Line += " [x" + AnsiString(msg->repeated + 1) + "]";
     Log->SelLength=0;
 	Log->SelStart=-1;
-    Log->SelAttributes->Assign(
-        MainForm->LogAttributes(msg->level, Log->Color, Log->Font));
+	TTextAttributes* attr = Log->SelAttributes;
+    TFont* font = MainForm->LogAttributes(msg->level, Log->Color, Log->Font);
+	attr->Color = font->Color;
+	attr->Style = font->Style;
 	Log->Lines->Add(Line);
 }
 
@@ -1555,8 +1557,6 @@ void __fastcall TMainForm::ReadFont(AnsiString subkey, TFont* Font)
         Font->Name=Registry->ReadString("Name");
     if(Registry->ValueExists("Color"))
         Font->Color=StringToColor(Registry->ReadString("Color"));
-    if(Registry->ValueExists("Height"))
-        Font->Height=Registry->ReadInteger("Height");
     if(Registry->ValueExists("Size"))
         Font->Size=Registry->ReadInteger("Size");
 
@@ -1579,7 +1579,6 @@ void __fastcall TMainForm::WriteFont(AnsiString subkey, TFont* Font)
     }
     Registry->WriteString("Name",Font->Name);
     Registry->WriteString("Color",ColorToString(Font->Color));
-    Registry->WriteInteger("Height",Font->Height);
     Registry->WriteInteger("Size",Font->Size);
     Registry->WriteInteger("Style",FontStyleToInt(Font));
 
@@ -2300,7 +2299,6 @@ void __fastcall TMainForm::ImportFont(TMemIniFile* IniFile, const char* section,
 {
     Font->Name=IniFile->ReadString(section,prefix + "Name",Font->Name);
     Font->Color=StringToColor(IniFile->ReadString(section,prefix + "Color",ColorToString(Font->Color)));
-    Font->Height=IniFile->ReadInteger(section,prefix + "Height",Font->Height);
     Font->Size=IniFile->ReadInteger(section,prefix + "Size", Font->Size);
     IntToFontStyle(IniFile->ReadInteger(section,prefix + "Style",FontStyleToInt(Font)),Font);
 }
@@ -2309,7 +2307,6 @@ void __fastcall TMainForm::ExportFont(TMemIniFile* IniFile, const char* section,
 {
     IniFile->WriteString(section,prefix+"Name",Font->Name);
     IniFile->WriteString(section,prefix+"Color",ColorToString(Font->Color));
-    IniFile->WriteInteger(section,prefix+"Height",Font->Height);
     IniFile->WriteInteger(section,prefix+"Size",Font->Size);
     IniFile->WriteInteger(section,prefix+"Style",FontStyleToInt(Font));
 }
-- 
GitLab