Octocontrabass wrote:It does support non-Latin alphabets, you just need to include your own font and register it with the HII database.
Only in theory. UEFI Driver Writer's Guide says about
HII fonts
The system carries the Latin-1 (Western European) character set. Other characters must be provided if they are to be displayed.
The same document also classifies "HII Font" a rarely used protocol, and does not care about providing a detailed description or an example on how actually do that, eg. how to "provide the characters to be displayed". Plus including the glyphs for the entire CJK area in each and every driver which needs Chinese translation as
UEFI blogspot suggests is ridiculous.
Let's say I'm designing a plug-in card and I want to support Chinese. But I don't know whether or not the system firmware in the platform where my card is installed supports all the Chinese characters (glyphs) that I need. What can I do? Well, with UEFI 2.10, your driver can just carry the characters you need that are in addition to those provided by the ISO Latin-1 characters that the platform is required to carry in its firmware.
That's the way to do it! Yeah, let's duplicate 65536 - 256 glyphs in each and every driver! The firmware isn't bloated enough already! (sarcasm)
That's about theory. Now in practice, taking a deep dive in TianoCore's source,
GetGlyphBuffer only supports SimpleFont with EFI_NARROW_GLYPH and
hardcoded EFI_GLYPH_WIDTH. Forget that you set the font width from the font. Again, in theory GetGlyphBuffer consults GlobalFont->FontPackage, but there's no way to register sane fonts with it, as
GraphicsConsole.c itself has
hardcoded EFI_NARROW_GLYPH, and "This->Mode->CursorColumn * EFI_GLYPH_WIDTH" is all over the place. In RegisterFontPackage at
line 2064 it only sets up package size for narrow fonts, does not check its input (it is a notification callback) which makes you wonder what a nice buffer overflow could happen if you actually try to register a wide font....
So the statement that UEFI supports proportional fonts is just
yet another big lie. It doesn't. Even if you figure out how to register HII Font Packages, you cannot display glyphs with different sizes using OutputString, that's for sure.
Now why do both Font.c and GraphicsConsole.c define exactly the same palette over and over again but separately is beyond my comprehention (specially when they should not need it as colours are taken care of in StringToImage() in Image.c). When I first tried to understand TianoCore's source, I was just confused. Then I did so much FacePalms (tm), that my head became red
Now I just laugh when I think about how hilariously overengineered and completely useless garbage UEFi is! And the more time I spent with it, the more convinced I became
If someone says that UEFI is a progress over BIOS, then a) they are paid to say that b) they are simply fools or idiots.
Do you want to hear another epic fail? UEFI Firmware must keep track of allocated memory pool sizes, for BS->FreePool only receives a pointer. But so must YOUR APPLICATION TOO, if you ever want to reallocate a pool! Even though AllocatePool receives a memory pointer, it uses that for output only, so no reallocation possible, you must do that yourself in your application with memcpy! Which means you must keep track of the allocated memory pointers and sizes. You simply cannot not wonder, what a total idiot designed this interface?
Anyway, POSIX-UEFI hides all this sh*t, so that you can simply use stb_image.h to load PNG images for example:
Cheers,
bzt