[PATCH RFC 0/6] video: Add UTF-8 support for UEFI applications

Janne Grunau j at jannau.net
Thu Jan 18 18:56:28 CET 2024


Hej Heinrich,

On Thu, Jan 18, 2024, at 17:47, Heinrich Schuchardt wrote:
> On 1/17/24 23:24, Janne Grunau via B4 Relay wrote:
>> Andre submitted 2 years ago DM_VIDEO improvements for UEFI applications
>> using UEFI's EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL but did not follow with
>> suggested changes. This series takes care of the UTF-8 support which
>> required to draw symbol and box drawing characters used by UEFI
>> applications like grub2 and sd-boot correctly.
>>
>> Compared to Andre's version this version has the following changes:
>> - use and extend existing conversion functions from lib/charset.c
>> - convert first to UTF-32 to support the truetype console as well
>> - conversion is conditional on CONFIG_EFI_LOADER
>> - use escape sequences in tests as proposed by Heinrich
>
> Hello Janne,
>
> to correctly render GRUB I think you need the following:
>
> * Use truetype

a truetype font is not necessary, the arrow glyphs used by grub are in codepage 437 (code points 0x10 - 0x1f, see  https://en.wikipedia.org/wiki/Code_page_437#Character_set ). grub2 and sd-boot render correctly with this patchset and bitmap fonts.

> * Add a mono-spaced Truetype font which has all the needed characters.
> * A bunch of code fixed.
>
> This is the font I once suggested.
>
> [PATCH v2 1/1] video: add DejaVu Mono font
> https://lore.kernel.org/u-boot/20210301181534.7618-1-xypron.glpk@gmx.de/
>
> Which font have you been using for testing?

The 8x16 and 16x32 bitmap fonts and the included Anker/Coder Narrow truetype font. All render the grub menu correctly but the bitmap fonts are missing some of the glyphs in the international character efi_selftest by Andre and you.

> At the time these additional patches were needed.
>
> [PATCH 0/6] efi_loader: Unicode output in UEFI applications
> https://lore.kernel.org/u-boot/20210227130840.166193-1-xypron.glpk@gmx.de/#r

That is functionally identical to this patchset except for the Unicode mapping for code page 437 code points 0x01 to 0x1f (Patch 3/6 "lib/charset: Map cp437 low chars (0x01 - 0x1f) from unicode"). I wasn't aware of this and stopped looking after Andre's patches. It looks like patches 5 and 6 were never merged. Was there a reason for that?
best regards
Janne

>>
>> Link: https://lore.kernel.org/u-boot/20220110005638.21599-1-andre.przywara@arm.com/
>> Signed-off-by: Janne Grunau <j at jannau.net>
>> ---
>> Andre Przywara (2):
>>        efi_selftest: Add international characters test
>>        efi_selftest: Add box drawing character selftest
>>
>> Janne Grunau (4):
>>        lib: charset: Fix utf8_to_utf32_stream() return value doc string
>>        video: console: Parse UTF-8 character sequences
>>        lib/charset: Map cp437 low chars (0x01 - 0x1f) from unicode
>>        efi_selftest: Add symbol character selftest
>>
>>   drivers/video/console_normal.c             |  6 +++--
>>   drivers/video/console_rotate.c             | 16 +++++++++-----
>>   drivers/video/console_truetype.c           |  8 +++----
>>   drivers/video/vidconsole-uclass.c          | 18 ++++++++++-----
>>   drivers/video/vidconsole_internal.h        | 15 +++++++++++++
>>   include/charset.h                          |  4 ++--
>>   include/cp1250.h                           | 12 ++++++++--
>>   include/cp437.h                            | 12 ++++++++--
>>   include/video_console.h                    | 10 +++++----
>>   lib/charset.c                              |  9 +++++---
>>   lib/efi_loader/efi_unicode_collation.c     |  2 +-
>>   lib/efi_selftest/efi_selftest_textoutput.c | 35 ++++++++++++++++++++++++++++++
>>   12 files changed, 116 insertions(+), 31 deletions(-)
>> ---
>> base-commit: 866ca972d6c3cabeaf6dbac431e8e08bb30b3c8e
>> change-id: 20240117-vidconsole-utf8-uefi-fa23b4ac65d6
>>
>> Best regards,


More information about the U-Boot mailing list