diff mbox series

[2/2] coreboot: Switch to a monospaced font

Message ID 20240108001455.35638-2-sjg@chromium.org
State New
Delegated to: Bin Meng
Headers show
Series [1/2] video: Allow querying the font size | expand

Commit Message

Simon Glass Jan. 8, 2024, 12:14 a.m. UTC
The default font is proportional, with different character widths.
Select a monospace font for coreboot so that the 'dm tree' output lines
up correctly.

Update the coreboot tests to match.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 configs/coreboot64_defconfig |  3 +++
 configs/coreboot_defconfig   |  3 +++
 test/cmd/font.c              | 12 +++++++++---
 3 files changed, 15 insertions(+), 3 deletions(-)

Comments

Mark Kettenis Jan. 8, 2024, 9:29 a.m. UTC | #1
> From: Simon Glass <sjg@chromium.org>
> Date: Sun,  7 Jan 2024 17:14:55 -0700
> 
> The default font is proportional, with different character widths.
> Select a monospace font for coreboot so that the 'dm tree' output lines
> up correctly.
> 
> Update the coreboot tests to match.

To be honest, I think defaulting to a proportional font is wrong as a
default for something like U-Boot.

> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> 
>  configs/coreboot64_defconfig |  3 +++
>  configs/coreboot_defconfig   |  3 +++
>  test/cmd/font.c              | 12 +++++++++---
>  3 files changed, 15 insertions(+), 3 deletions(-)
> 
> diff --git a/configs/coreboot64_defconfig b/configs/coreboot64_defconfig
> index 49c982ef756..c4571090859 100644
> --- a/configs/coreboot64_defconfig
> +++ b/configs/coreboot64_defconfig
> @@ -64,6 +64,9 @@ CONFIG_SOUND=y
>  CONFIG_SOUND_I8254=y
>  CONFIG_VIDEO_COPY=y
>  CONFIG_CONSOLE_TRUETYPE=y
> +CONFIG_CONSOLE_TRUETYPE_SIZE=20
> +# CONFIG_CONSOLE_TRUETYPE_NIMBUS is not set
> +CONFIG_CONSOLE_TRUETYPE_ANKACODER=y
>  CONFIG_CONSOLE_SCROLL_LINES=5
>  CONFIG_SPL_ACPI=y
>  CONFIG_CMD_DHRYSTONE=y
> diff --git a/configs/coreboot_defconfig b/configs/coreboot_defconfig
> index d4e44e00dca..7aa841bb54b 100644
> --- a/configs/coreboot_defconfig
> +++ b/configs/coreboot_defconfig
> @@ -61,6 +61,9 @@ CONFIG_SOUND=y
>  CONFIG_SOUND_I8254=y
>  CONFIG_VIDEO_COPY=y
>  CONFIG_CONSOLE_TRUETYPE=y
> +CONFIG_CONSOLE_TRUETYPE_SIZE=20
> +# CONFIG_CONSOLE_TRUETYPE_NIMBUS is not set
> +CONFIG_CONSOLE_TRUETYPE_ANKACODER=y
>  CONFIG_CONSOLE_SCROLL_LINES=5
>  CONFIG_CMD_DHRYSTONE=y
>  # CONFIG_GZIP is not set
> diff --git a/test/cmd/font.c b/test/cmd/font.c
> index 9c1eebf799e..ee1c610106d 100644
> --- a/test/cmd/font.c
> +++ b/test/cmd/font.c
> @@ -29,14 +29,20 @@ static int font_test_base(struct unit_test_state *uts)
>  
>  	ut_assertok(console_record_reset_enable());
>  	ut_assertok(run_command("font list", 0));
> -	ut_assert_nextline("nimbus_sans_l_regular");
> +	if (IS_ENABLED(CONFIG_CONSOLE_TRUETYPE_NIMBUS))
> +		ut_assert_nextline("nimbus_sans_l_regular");
> +	if (IS_ENABLED(CONFIG_CONSOLE_TRUETYPE_ANKACODER))
> +		ut_assert_nextline("ankacoder_c75_r");
>  	if (IS_ENABLED(CONFIG_CONSOLE_TRUETYPE_CANTORAONE))
>  		ut_assert_nextline("cantoraone_regular");
>  	ut_assertok(ut_check_console_end(uts));
>  
>  	ut_assertok(vidconsole_get_font_size(dev, &name, &size));
> -	ut_asserteq_str("nimbus_sans_l_regular", name);
> -	ut_asserteq(18, size);
> +	if (IS_ENABLED(CONFIG_CONSOLE_TRUETYPE_ANKACODER))
> +		ut_asserteq_str("ankacoder_c75_r", name);
> +	else
> +		ut_asserteq_str("nimbus_sans_l_regular", name);
> +	ut_asserteq(CONFIG_CONSOLE_TRUETYPE_SIZE, size);
>  
>  	if (!IS_ENABLED(CONFIG_CONSOLE_TRUETYPE_CANTORAONE))
>  		return 0;
> -- 
> 2.34.1
> 
>
Dragan Simic Jan. 8, 2024, 9:33 a.m. UTC | #2
On 2024-01-08 10:29, Mark Kettenis wrote:
>> From: Simon Glass <sjg@chromium.org>
>> Date: Sun,  7 Jan 2024 17:14:55 -0700
>> 
>> The default font is proportional, with different character widths.
>> Select a monospace font for coreboot so that the 'dm tree' output 
>> lines
>> up correctly.
>> 
>> Update the coreboot tests to match.
> 
> To be honest, I think defaulting to a proportional font is wrong as a
> default for something like U-Boot.

I agree, it makes very little sense to default to a proportional font.

>> Signed-off-by: Simon Glass <sjg@chromium.org>
>> ---
>> 
>>  configs/coreboot64_defconfig |  3 +++
>>  configs/coreboot_defconfig   |  3 +++
>>  test/cmd/font.c              | 12 +++++++++---
>>  3 files changed, 15 insertions(+), 3 deletions(-)
>> 
>> diff --git a/configs/coreboot64_defconfig 
>> b/configs/coreboot64_defconfig
>> index 49c982ef756..c4571090859 100644
>> --- a/configs/coreboot64_defconfig
>> +++ b/configs/coreboot64_defconfig
>> @@ -64,6 +64,9 @@ CONFIG_SOUND=y
>>  CONFIG_SOUND_I8254=y
>>  CONFIG_VIDEO_COPY=y
>>  CONFIG_CONSOLE_TRUETYPE=y
>> +CONFIG_CONSOLE_TRUETYPE_SIZE=20
>> +# CONFIG_CONSOLE_TRUETYPE_NIMBUS is not set
>> +CONFIG_CONSOLE_TRUETYPE_ANKACODER=y
>>  CONFIG_CONSOLE_SCROLL_LINES=5
>>  CONFIG_SPL_ACPI=y
>>  CONFIG_CMD_DHRYSTONE=y
>> diff --git a/configs/coreboot_defconfig b/configs/coreboot_defconfig
>> index d4e44e00dca..7aa841bb54b 100644
>> --- a/configs/coreboot_defconfig
>> +++ b/configs/coreboot_defconfig
>> @@ -61,6 +61,9 @@ CONFIG_SOUND=y
>>  CONFIG_SOUND_I8254=y
>>  CONFIG_VIDEO_COPY=y
>>  CONFIG_CONSOLE_TRUETYPE=y
>> +CONFIG_CONSOLE_TRUETYPE_SIZE=20
>> +# CONFIG_CONSOLE_TRUETYPE_NIMBUS is not set
>> +CONFIG_CONSOLE_TRUETYPE_ANKACODER=y
>>  CONFIG_CONSOLE_SCROLL_LINES=5
>>  CONFIG_CMD_DHRYSTONE=y
>>  # CONFIG_GZIP is not set
>> diff --git a/test/cmd/font.c b/test/cmd/font.c
>> index 9c1eebf799e..ee1c610106d 100644
>> --- a/test/cmd/font.c
>> +++ b/test/cmd/font.c
>> @@ -29,14 +29,20 @@ static int font_test_base(struct unit_test_state 
>> *uts)
>> 
>>  	ut_assertok(console_record_reset_enable());
>>  	ut_assertok(run_command("font list", 0));
>> -	ut_assert_nextline("nimbus_sans_l_regular");
>> +	if (IS_ENABLED(CONFIG_CONSOLE_TRUETYPE_NIMBUS))
>> +		ut_assert_nextline("nimbus_sans_l_regular");
>> +	if (IS_ENABLED(CONFIG_CONSOLE_TRUETYPE_ANKACODER))
>> +		ut_assert_nextline("ankacoder_c75_r");
>>  	if (IS_ENABLED(CONFIG_CONSOLE_TRUETYPE_CANTORAONE))
>>  		ut_assert_nextline("cantoraone_regular");
>>  	ut_assertok(ut_check_console_end(uts));
>> 
>>  	ut_assertok(vidconsole_get_font_size(dev, &name, &size));
>> -	ut_asserteq_str("nimbus_sans_l_regular", name);
>> -	ut_asserteq(18, size);
>> +	if (IS_ENABLED(CONFIG_CONSOLE_TRUETYPE_ANKACODER))
>> +		ut_asserteq_str("ankacoder_c75_r", name);
>> +	else
>> +		ut_asserteq_str("nimbus_sans_l_regular", name);
>> +	ut_asserteq(CONFIG_CONSOLE_TRUETYPE_SIZE, size);
>> 
>>  	if (!IS_ENABLED(CONFIG_CONSOLE_TRUETYPE_CANTORAONE))
>>  		return 0;
>> --
>> 2.34.1
>> 
>>
Bin Meng Jan. 8, 2024, 1:09 p.m. UTC | #3
+ Tom and Anatolij,

On Mon, Jan 8, 2024 at 5:33 PM Dragan Simic <dsimic@manjaro.org> wrote:
>
> On 2024-01-08 10:29, Mark Kettenis wrote:
> >> From: Simon Glass <sjg@chromium.org>
> >> Date: Sun,  7 Jan 2024 17:14:55 -0700
> >>
> >> The default font is proportional, with different character widths.
> >> Select a monospace font for coreboot so that the 'dm tree' output
> >> lines
> >> up correctly.
> >>
> >> Update the coreboot tests to match.
> >
> > To be honest, I think defaulting to a proportional font is wrong as a
> > default for something like U-Boot.
>
> I agree, it makes very little sense to default to a proportional font.
>

So we should revert

commit b093753471c1a30d680868a9f4d9f6db090bf0b7 ("video: Add a default
TrueType font")

Regards,
Bin
Tom Rini Jan. 8, 2024, 3:38 p.m. UTC | #4
On Mon, Jan 08, 2024 at 09:09:39PM +0800, Bin Meng wrote:
> + Tom and Anatolij,
> 
> On Mon, Jan 8, 2024 at 5:33 PM Dragan Simic <dsimic@manjaro.org> wrote:
> >
> > On 2024-01-08 10:29, Mark Kettenis wrote:
> > >> From: Simon Glass <sjg@chromium.org>
> > >> Date: Sun,  7 Jan 2024 17:14:55 -0700
> > >>
> > >> The default font is proportional, with different character widths.
> > >> Select a monospace font for coreboot so that the 'dm tree' output
> > >> lines
> > >> up correctly.
> > >>
> > >> Update the coreboot tests to match.
> > >
> > > To be honest, I think defaulting to a proportional font is wrong as a
> > > default for something like U-Boot.
> >
> > I agree, it makes very little sense to default to a proportional font.
> >
> 
> So we should revert
> 
> commit b093753471c1a30d680868a9f4d9f6db090bf0b7 ("video: Add a default
> TrueType font")

Well, I would "fixes" that commit and drop default y there and instead
make the monospace font the default and explain why the switch, rather
than revert.
diff mbox series

Patch

diff --git a/configs/coreboot64_defconfig b/configs/coreboot64_defconfig
index 49c982ef756..c4571090859 100644
--- a/configs/coreboot64_defconfig
+++ b/configs/coreboot64_defconfig
@@ -64,6 +64,9 @@  CONFIG_SOUND=y
 CONFIG_SOUND_I8254=y
 CONFIG_VIDEO_COPY=y
 CONFIG_CONSOLE_TRUETYPE=y
+CONFIG_CONSOLE_TRUETYPE_SIZE=20
+# CONFIG_CONSOLE_TRUETYPE_NIMBUS is not set
+CONFIG_CONSOLE_TRUETYPE_ANKACODER=y
 CONFIG_CONSOLE_SCROLL_LINES=5
 CONFIG_SPL_ACPI=y
 CONFIG_CMD_DHRYSTONE=y
diff --git a/configs/coreboot_defconfig b/configs/coreboot_defconfig
index d4e44e00dca..7aa841bb54b 100644
--- a/configs/coreboot_defconfig
+++ b/configs/coreboot_defconfig
@@ -61,6 +61,9 @@  CONFIG_SOUND=y
 CONFIG_SOUND_I8254=y
 CONFIG_VIDEO_COPY=y
 CONFIG_CONSOLE_TRUETYPE=y
+CONFIG_CONSOLE_TRUETYPE_SIZE=20
+# CONFIG_CONSOLE_TRUETYPE_NIMBUS is not set
+CONFIG_CONSOLE_TRUETYPE_ANKACODER=y
 CONFIG_CONSOLE_SCROLL_LINES=5
 CONFIG_CMD_DHRYSTONE=y
 # CONFIG_GZIP is not set
diff --git a/test/cmd/font.c b/test/cmd/font.c
index 9c1eebf799e..ee1c610106d 100644
--- a/test/cmd/font.c
+++ b/test/cmd/font.c
@@ -29,14 +29,20 @@  static int font_test_base(struct unit_test_state *uts)
 
 	ut_assertok(console_record_reset_enable());
 	ut_assertok(run_command("font list", 0));
-	ut_assert_nextline("nimbus_sans_l_regular");
+	if (IS_ENABLED(CONFIG_CONSOLE_TRUETYPE_NIMBUS))
+		ut_assert_nextline("nimbus_sans_l_regular");
+	if (IS_ENABLED(CONFIG_CONSOLE_TRUETYPE_ANKACODER))
+		ut_assert_nextline("ankacoder_c75_r");
 	if (IS_ENABLED(CONFIG_CONSOLE_TRUETYPE_CANTORAONE))
 		ut_assert_nextline("cantoraone_regular");
 	ut_assertok(ut_check_console_end(uts));
 
 	ut_assertok(vidconsole_get_font_size(dev, &name, &size));
-	ut_asserteq_str("nimbus_sans_l_regular", name);
-	ut_asserteq(18, size);
+	if (IS_ENABLED(CONFIG_CONSOLE_TRUETYPE_ANKACODER))
+		ut_asserteq_str("ankacoder_c75_r", name);
+	else
+		ut_asserteq_str("nimbus_sans_l_regular", name);
+	ut_asserteq(CONFIG_CONSOLE_TRUETYPE_SIZE, size);
 
 	if (!IS_ENABLED(CONFIG_CONSOLE_TRUETYPE_CANTORAONE))
 		return 0;