Using hii to display any size of font string


Liu Xin
 

Using hii, add a new font, it can display string by StringToImage.
When i use EFI_FONT_DISPLAY_INFO to set the font size, the characters are not displayed in the correct size.
Is there any sample?

EFI_FONT_DISPLAY_INFO *fontDisplayInfo;

fontDisplayInfo = (EFI_FONT_DISPLAY_INFO *)AllocateZeroPool(sizeof(EFI_FONT_DISPLAY_INFO) + StrLen((const CHAR16*)L"A") * 2 + 2);
fontDisplayInfo->ForegroundColor = *fontForegroundColor;
fontDisplayInfo->BackgroundColor = *fontBackgroundColor;

fontDisplayInfo->FontInfoMask = EFI_FONT_INFO_SYS_FORE_COLOR | EFI_FONT_INFO_SYS_BACK_COLOR | EFI_FONT_INFO_RESIZE;
fontDisplayInfo->FontInfo.FontStyle = EFI_HII_FONT_STYLE_NORMAL;
fontDisplayInfo->FontInfo.FontSize = 50;
CopyMem(fontDisplayInfo->FontInfo.FontName, (const CHAR16*)L"A", StrLen((const CHAR16*)L"A") * 2 + 2);


Status = gHiiFont->StringToImage(
gHiiFont,
EFI_HII_IGNORE_IF_NO_GLYPH |
EFI_HII_DIRECT_TO_SCREEN | EFI_HII_OUT_FLAG_TRANSPARENT,
String,
fontDisplayInfo,
&pSystemFrameBuffer,
(UINTN)x,
(UINTN)y,
0,
0,
0}

Join discuss@edk2.groups.io to automatically receive all group messages.