-
Hello! Currently I develop an OptionROM for a custom PCI-E device. Now I want to use my local language in the OptionROM form. The problem is that my local language is not very often implemented in the UEFI Firmware by default. For example here are pseudo-graphics for the "1" code glyph in AMI and InsydeH2O firmware:
This gives me a problem, what font saturation should I use in my Best regards, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I was able to solve the problem using the Here is the example app that I've used to test how 'T' glyph is displayed on different UEFI firmwares: EFI_STATUS
EFIAPI
UefiMain (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_HII_FONT_PROTOCOL *gHiiFont = NULL;
EFI_STATUS Status = gBS->LocateProtocol(&gEfiHiiFontProtocolGuid,
NULL,
(VOID **)&gHiiFont);
if (EFI_ERROR(Status)) {
Print(L"Error! Can't get gEfiHiiFontProtocolGuid\n");
return Status;
}
EFI_IMAGE_OUTPUT* Blt = NULL;
UINTN Baseline;
Status = gHiiFont->GetGlyph(gHiiFont, L'T', NULL, &Blt, &Baseline);
if (EFI_ERROR(Status)) {
Print(L"Error! GetGlyph returned %r\n", Status);
return Status;
}
for (UINT8 i = 0; i < (Blt->Height); i++) {
for (UINT8 j = 0; j < (Blt->Width); j++) {
Print(L"%02x", Blt->Image.Bitmap[i*(Blt->Width) + j].Blue);
Print(L"%02x", Blt->Image.Bitmap[i*(Blt->Width) + j].Green);
Print(L"%02x", Blt->Image.Bitmap[i*(Blt->Width) + j].Red);
Print(L" ");
}
Print(L"\n");
}
return EFI_SUCCESS;
} This output either something like
or
Therefore BOOLEAN IsBoldFont()
{
EFI_HII_FONT_PROTOCOL *gHiiFont = NULL;
EFI_STATUS Status = gBS->LocateProtocol(&gEfiHiiFontProtocolGuid,
NULL,
(VOID **)&gHiiFont);
if (EFI_ERROR(Status)) {
return FALSE;
}
EFI_IMAGE_OUTPUT* Blt = NULL;
UINTN Baseline;
Status = gHiiFont->GetGlyph(gHiiFont, L'T', NULL, &Blt, &Baseline);
if (EFI_ERROR(Status)) {
return FALSE;
}
UINTN Pixels = 0;
for (UINT8 i = 0; i < (Blt->Width); i++) {
if ((Blt->Image.Bitmap[10*(Blt->Width) + i].Blue != 0x00) ||
(Blt->Image.Bitmap[10*(Blt->Width) + i].Green != 0x00) ||
(Blt->Image.Bitmap[10*(Blt->Width) + i].Red != 0x00)) {
Pixels++;
}
}
if (Pixels > 1) {
return TRUE;
}
return FALSE;
} Based on its output I populate either bold or standard font. Conclusion: |
Beta Was this translation helpful? Give feedback.
I was able to solve the problem using the
GetGlyph
function from thegEfiHiiFontProtocolGuid
protocol. This function can return aBlt
of the glyph.Here is the example app that I've used to test how 'T' glyph is displayed on different UEFI firmwares: