Implementation for EFI_HII_FONT_PROTOCOL.\r
\r
\r
-Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution. The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
@param RowWidth The width of the text on the line, in pixels.\r
@param RowHeight The height of the line, in pixels.\r
@param Transparent If TRUE, the Background color is ignored and all\r
- "off" pixels in the character's drawn wil use the\r
+ "off" pixels in the character's drawn will use the\r
pixel value from BltBuffer.\r
@param Origin On input, points to the origin of the to be\r
displayed character, on output, points to the\r
\r
Height = EFI_GLYPH_HEIGHT;\r
Width = EFI_GLYPH_WIDTH;\r
- \r
+\r
//\r
// Move position to the left-top corner of char.\r
//\r
Buffer = *Origin - EFI_GLYPH_HEIGHT * ImageWidth;\r
\r
//\r
- // Char may be partially displayed when CLIP_X or CLIP_Y is not set. \r
+ // Char may be partially displayed when CLIP_X or CLIP_Y is not set.\r
//\r
if (RowHeight < Height) {\r
Height = (UINT8) RowHeight;\r
@param RowWidth The width of the text on the line, in pixels.\r
@param RowHeight The height of the line, in pixels.\r
@param Transparent If TRUE, the Background color is ignored and all\r
- "off" pixels in the character's drawn wil use the\r
+ "off" pixels in the character's drawn will use the\r
pixel value from BltBuffer.\r
@param Cell Points to EFI_HII_GLYPH_INFO structure.\r
@param Attributes The attribute of incoming glyph in GlyphBuffer.\r
// The glyph's upper left hand corner pixel is the most significant bit of the\r
// first bitmap byte.\r
//\r
- for (Ypos = 0; Ypos < Cell->Height && ((UINTN) (Ypos + YposOffset) < RowHeight); Ypos++) {\r
+ for (Ypos = 0; Ypos < Cell->Height && (((UINT32) Ypos + YposOffset) < RowHeight); Ypos++) {\r
OffsetY = BITMAP_LEN_1_BIT (Cell->Width, Ypos);\r
\r
//\r
//\r
for (Xpos = 0; Xpos < Cell->Width / 8; Xpos++) {\r
Data = *(GlyphBuffer + OffsetY + Xpos);\r
- for (Index = 0; Index < 8 && ((UINTN) (Xpos * 8 + Index + Cell->OffsetX) < RowWidth); Index++) {\r
+ for (Index = 0; Index < 8 && (((UINT32) Xpos * 8 + Index + Cell->OffsetX) < RowWidth); Index++) {\r
if ((Data & (1 << (8 - Index - 1))) != 0) {\r
BltBuffer[Ypos * ImageWidth + Xpos * 8 + Index] = Foreground;\r
} else {\r
// There are some padding bits in this byte. Ignore them.\r
//\r
Data = *(GlyphBuffer + OffsetY + Xpos);\r
- for (Index = 0; Index < Cell->Width % 8 && ((UINTN) (Xpos * 8 + Index + Cell->OffsetX) < RowWidth); Index++) {\r
+ for (Index = 0; Index < Cell->Width % 8 && (((UINT32) Xpos * 8 + Index + Cell->OffsetX) < RowWidth); Index++) {\r
if ((Data & (1 << (8 - Index - 1))) != 0) {\r
BltBuffer[Ypos * ImageWidth + Xpos * 8 + Index] = Foreground;\r
} else {\r
@param RowWidth The width of the text on the line, in pixels.\r
@param RowHeight The height of the line, in pixels.\r
@param Transparent If TRUE, the Background color is ignored and all\r
- "off" pixels in the character's drawn wil use the\r
+ "off" pixels in the character's drawn will use the\r
pixel value from BltBuffer.\r
@param Cell Points to EFI_HII_GLYPH_INFO structure.\r
@param Attributes The attribute of incoming glyph in GlyphBuffer.\r
@param InputCell Buffer which stores cell information of the\r
encoded bitmap.\r
@param GlyphBuffer Output the corresponding bitmap data of the found\r
- block. It is the caller's responsiblity to free\r
+ block. It is the caller's responsibility to free\r
this buffer.\r
@param Cell Output cell information of the encoded bitmap.\r
@param GlyphBufferLen If not NULL, output the length of GlyphBuffer.\r
IN UINT8 *BufferIn,\r
IN UINTN BufferLen,\r
IN EFI_HII_GLYPH_INFO *InputCell,\r
- OUT UINT8 **GlyphBuffer, OPTIONAL\r
- OUT EFI_HII_GLYPH_INFO *Cell, OPTIONAL\r
+ OUT UINT8 **GlyphBuffer OPTIONAL,\r
+ OUT EFI_HII_GLYPH_INFO *Cell OPTIONAL,\r
OUT UINTN *GlyphBufferLen OPTIONAL\r
)\r
{\r
@param CharValue Unicode character value, which identifies a glyph\r
block.\r
@param GlyphBuffer Output the corresponding bitmap data of the found\r
- block. It is the caller's responsiblity to free\r
+ block. It is the caller's responsibility to free\r
this buffer.\r
@param Cell Output cell information of the encoded bitmap.\r
@param GlyphBufferLen If not NULL, output the length of GlyphBuffer.\r
FindGlyphBlock (\r
IN HII_FONT_PACKAGE_INSTANCE *FontPackage,\r
IN CHAR16 CharValue,\r
- OUT UINT8 **GlyphBuffer, OPTIONAL\r
- OUT EFI_HII_GLYPH_INFO *Cell, OPTIONAL\r
+ OUT UINT8 **GlyphBuffer OPTIONAL,\r
+ OUT EFI_HII_GLYPH_INFO *Cell OPTIONAL,\r
OUT UINTN *GlyphBufferLen OPTIONAL\r
)\r
{\r
ASSERT (FontPackage->Signature == HII_FONT_PACKAGE_SIGNATURE);\r
BaseLine = 0;\r
MinOffsetY = 0;\r
- \r
+\r
if (CharValue == (CHAR16) (-1)) {\r
//\r
// Collect the cell information specified in font package fixed header.\r
(UINT8 *) FontPackage->FontPkgHdr + 3 * sizeof (UINT32),\r
sizeof (EFI_HII_GLYPH_INFO)\r
);\r
- BaseLine = (UINT16) (LocalCell.Height + LocalCell.OffsetY);\r
- if (MinOffsetY > LocalCell.OffsetY) {\r
- MinOffsetY = LocalCell.OffsetY;\r
- }\r
}\r
\r
BlockPtr = FontPackage->GlyphBlock;\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
+ if (CharValue == (CHAR16) (-1)) {\r
+ if (BaseLine < DefaultCell.Height + DefaultCell.OffsetY) {\r
+ BaseLine = (UINT16) (DefaultCell.Height + DefaultCell.OffsetY);\r
+ }\r
+ if (MinOffsetY > DefaultCell.OffsetY) {\r
+ MinOffsetY = DefaultCell.OffsetY;\r
+ }\r
+ }\r
BufferLen = BITMAP_LEN_1_BIT (DefaultCell.Width, DefaultCell.Height);\r
\r
if (CharCurrent == CharValue) {\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
+ if (CharValue == (CHAR16) (-1)) {\r
+ if (BaseLine < DefaultCell.Height + DefaultCell.OffsetY) {\r
+ BaseLine = (UINT16) (DefaultCell.Height + DefaultCell.OffsetY);\r
+ }\r
+ if (MinOffsetY > DefaultCell.OffsetY) {\r
+ MinOffsetY = DefaultCell.OffsetY;\r
+ }\r
+ }\r
BufferLen = BITMAP_LEN_1_BIT (DefaultCell.Width, DefaultCell.Height);\r
BlockPtr += sizeof (EFI_HII_GIBT_GLYPHS_DEFAULT_BLOCK) - sizeof (UINT8);\r
for (Index = 0; Index < Length16; Index++) {\r
}\r
\r
Info->ForegroundColor = mHiiEfiColors[Private->Attribute & 0x0f];\r
+ ASSERT ((Private->Attribute >> 4) < 8);\r
Info->BackgroundColor = mHiiEfiColors[Private->Attribute >> 4];\r
Info->FontInfoMask = EFI_FONT_INFO_SYS_FONT | EFI_FONT_INFO_SYS_SIZE | EFI_FONT_INFO_SYS_STYLE;\r
Info->FontInfo.FontStyle = 0;\r
IsSystemFontInfo (\r
IN HII_DATABASE_PRIVATE_DATA *Private,\r
IN EFI_FONT_DISPLAY_INFO *StringInfo,\r
- OUT EFI_FONT_DISPLAY_INFO **SystemInfo, OPTIONAL\r
+ OUT EFI_FONT_DISPLAY_INFO **SystemInfo OPTIONAL,\r
OUT UINTN *SystemInfoLen OPTIONAL\r
)\r
{\r
}\r
if ((StringInfo->FontInfoMask & EFI_FONT_INFO_SYS_FORE_COLOR) == 0) {\r
if (CompareMem (\r
- &StringInfo->ForegroundColor, \r
- &SystemDefault->ForegroundColor, \r
+ &StringInfo->ForegroundColor,\r
+ &SystemDefault->ForegroundColor,\r
sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)\r
) != 0) {\r
goto Exit;\r
}\r
if ((StringInfo->FontInfoMask & EFI_FONT_INFO_SYS_BACK_COLOR) == 0) {\r
if (CompareMem (\r
- &StringInfo->BackgroundColor, \r
- &SystemDefault->BackgroundColor, \r
+ &StringInfo->BackgroundColor,\r
+ &SystemDefault->BackgroundColor,\r
sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)\r
) != 0) {\r
goto Exit;\r
@param FontHandle On entry, Points to the font handle returned by a\r
previous call to GetFontInfo() or NULL to start\r
with the first font.\r
- @param GlobalFontInfo If not NULL, output the corresponding globa font\r
+ @param GlobalFontInfo If not NULL, output the corresponding global font\r
info.\r
\r
@retval TRUE Existed\r
IsFontInfoExisted (\r
IN HII_DATABASE_PRIVATE_DATA *Private,\r
IN EFI_FONT_INFO *FontInfo,\r
- IN EFI_FONT_INFO_MASK *FontInfoMask, OPTIONAL\r
- IN EFI_FONT_HANDLE FontHandle, OPTIONAL\r
+ IN EFI_FONT_INFO_MASK *FontInfoMask OPTIONAL,\r
+ IN EFI_FONT_HANDLE FontHandle OPTIONAL,\r
OUT HII_GLOBAL_FONT_INFO **GlobalFontInfo OPTIONAL\r
)\r
{\r
ASSERT (FontInfo != NULL);\r
\r
//\r
- // Matched flag represents an exactly match; VagueMatched1 repensents a RESIZE\r
+ // Matched flag represents an exactly match; VagueMatched1 represents a RESIZE\r
// or RESTYLE match; VagueMatched2 represents a RESIZE | RESTYLE match.\r
//\r
Matched = FALSE;\r
}\r
break;\r
//\r
- // If EFI_FONT_INFO_RESIZE is specified, then the sytem may attempt to\r
+ // If EFI_FONT_INFO_RESIZE is specified, then the system may attempt to\r
// stretch or shrink a font to meet the size requested.\r
//\r
case EFI_FONT_INFO_ANY_FONT | EFI_FONT_INFO_RESIZE:\r
UINTN StrLength;\r
EFI_GRAPHICS_OUTPUT_BLT_PIXEL *RowBufferPtr;\r
HII_GLOBAL_FONT_INFO *GlobalFont;\r
+ UINT32 PreInitBkgnd;\r
\r
//\r
// Check incoming parameters.\r
goto Exit;\r
}\r
}\r
- \r
+\r
//\r
- // Use the maxinum height of font as the base line.\r
- // And, use the maxinum height as line height.\r
+ // Use the maximum height of font as the base line.\r
+ // And, use the maximum height as line height.\r
//\r
LineHeight = Height;\r
LastLineHeight = Height;\r
BaseLineOffset = Height - BaseLine;\r
- \r
+\r
//\r
// Parse the string to be displayed to drop some ignored characters.\r
//\r
}\r
//\r
// If EFI_HII_IGNORE_IF_NO_GLYPH is set, then characters which have no glyphs\r
- // are not drawn. Otherwise they are replaced wth Unicode character 0xFFFD.\r
+ // are not drawn. Otherwise they are replaced with Unicode character 0xFFFD.\r
//\r
StringIn2 = AllocateZeroPool (StrSize (StringPtr));\r
if (StringIn2 == NULL) {\r
Index++;\r
continue;\r
}\r
- \r
+\r
Status = GetGlyphBuffer (Private, *StringPtr, FontInfo, &GlyphBuf[Index], &Cell[Index], &Attributes[Index]);\r
if (Status == EFI_NOT_FOUND) {\r
if ((Flags & EFI_HII_IGNORE_IF_NO_GLYPH) == EFI_HII_IGNORE_IF_NO_GLYPH) {\r
// If this character is the last character of a row, we need not\r
// draw its (AdvanceX - Width - OffsetX) for next character.\r
//\r
- LineWidth -= (UINTN) (Cell[Index].AdvanceX - Cell[Index].Width - Cell[Index].OffsetX);\r
+ LineWidth -= (Cell[Index].AdvanceX - Cell[Index].Width - Cell[Index].OffsetX);\r
\r
//\r
// Clip the right-most character if cannot fit when EFI_HII_OUT_FLAG_CLEAN_X is set.\r
//\r
// Don't draw the last char on this row. And, don't draw the second last char (AdvanceX - Width - OffsetX).\r
//\r
- LineWidth -= (UINTN) (Cell[Index].Width + Cell[Index].OffsetX);\r
- LineWidth -= (UINTN) (Cell[Index - 1].AdvanceX - Cell[Index - 1].Width - Cell[Index - 1].OffsetX);\r
+ LineWidth -= (Cell[Index].Width + Cell[Index].OffsetX);\r
+ LineWidth -= (Cell[Index - 1].AdvanceX - Cell[Index - 1].Width - Cell[Index - 1].OffsetX);\r
RowInfo[RowIndex].EndIndex = Index - 1;\r
RowInfo[RowIndex].LineWidth = LineWidth;\r
RowInfo[RowIndex].LineHeight = LineHeight;\r
// opportunity prior to a character whose right-most extent would exceed Width.\r
// Search the right-most line-break opportunity here.\r
//\r
- if ((Flags & EFI_HII_OUT_FLAG_WRAP) == EFI_HII_OUT_FLAG_WRAP && \r
- (RowInfo[RowIndex].LineWidth + BltX > Image->Width || StringPtr[NextIndex] != 0) && \r
+ if ((Flags & EFI_HII_OUT_FLAG_WRAP) == EFI_HII_OUT_FLAG_WRAP &&\r
+ (RowInfo[RowIndex].LineWidth + BltX > Image->Width || StringPtr[NextIndex] != 0) &&\r
!LineBreak) {\r
if ((Flags & EFI_HII_IGNORE_LINE_BREAK) == 0) {\r
LineWidth = RowInfo[RowIndex].LineWidth;\r
if (Index1 == RowInfo[RowIndex].StartIndex) {\r
LineWidth = 0;\r
} else {\r
- LineWidth -= (UINTN) (Cell[Index1 - 1].AdvanceX - Cell[Index1 - 1].Width - Cell[Index1 - 1].OffsetX);\r
+ LineWidth -= (Cell[Index1 - 1].AdvanceX - Cell[Index1 - 1].Width - Cell[Index1 - 1].OffsetX);\r
}\r
RowInfo[RowIndex].LineWidth = LineWidth;\r
}\r
//\r
// Don't draw the last char on this row. And, don't draw the second last char (AdvanceX - Width - OffsetX).\r
//\r
- LineWidth -= (UINTN) (Cell[Index1].Width + Cell[Index1].OffsetX);\r
- LineWidth -= (UINTN) (Cell[Index1 - 1].AdvanceX - Cell[Index1 - 1].Width - Cell[Index1 - 1].OffsetX);\r
+ LineWidth -= (Cell[Index1].Width + Cell[Index1].OffsetX);\r
+ LineWidth -= (Cell[Index1 - 1].AdvanceX - Cell[Index1 - 1].Width - Cell[Index1 - 1].OffsetX);\r
RowInfo[RowIndex].EndIndex = Index1 - 1;\r
RowInfo[RowIndex].LineWidth = LineWidth;\r
} else {\r
}\r
}\r
}\r
- \r
+\r
//\r
// LineWidth can't exceed Image width.\r
//\r
if ((Flags & EFI_HII_DIRECT_TO_SCREEN) == EFI_HII_DIRECT_TO_SCREEN) {\r
BltBuffer = NULL;\r
if (RowInfo[RowIndex].LineWidth != 0) {\r
- BltBuffer = AllocateZeroPool (RowInfo[RowIndex].LineWidth * RowInfo[RowIndex].LineHeight * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));\r
+ BltBuffer = AllocatePool (RowInfo[RowIndex].LineWidth * RowInfo[RowIndex].LineHeight * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));\r
if (BltBuffer == NULL) {\r
Status = EFI_OUT_OF_RESOURCES;\r
goto Exit;\r
}\r
//\r
+ // Initialize the background color.\r
+ //\r
+ PreInitBkgnd = Background.Blue | Background.Green << 8 | Background.Red << 16;\r
+ SetMem32 (BltBuffer,RowInfo[RowIndex].LineWidth * RowInfo[RowIndex].LineHeight * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL),PreInitBkgnd);\r
+ //\r
// Set BufferPtr to Origin by adding baseline to the starting position.\r
//\r
BufferPtr = BltBuffer + BaseLine * RowInfo[RowIndex].LineWidth;\r
for (Index1 = RowInfo[RowIndex].StartIndex; Index1 <= RowInfo[RowIndex].EndIndex; Index1++) {\r
if (RowInfo[RowIndex].LineWidth > 0 && RowInfo[RowIndex].LineWidth > LineOffset) {\r
//\r
- // Only BLT these character which have corrsponding glyph in font basebase.\r
+ // Only BLT these character which have corresponding glyph in font database.\r
//\r
GlyphToImage (\r
GlyphBuf[Index1],\r
);\r
}\r
if (ColumnInfoArray != NULL) {\r
- if ((GlyphBuf[Index1] == NULL && Cell[Index1].AdvanceX == 0) \r
+ if ((GlyphBuf[Index1] == NULL && Cell[Index1].AdvanceX == 0)\r
|| RowInfo[RowIndex].LineWidth == 0) {\r
*ColumnInfoArray = (UINTN) ~0;\r
} else {\r
FreePool (BltBuffer);\r
goto Exit;\r
}\r
- \r
+\r
FreePool (BltBuffer);\r
}\r
} else {\r
//\r
- // Save the starting position for calculate the starting postition of next row. \r
+ // Save the starting position for calculate the starting position of next row.\r
//\r
RowBufferPtr = BufferPtr;\r
//\r
for (Index1 = RowInfo[RowIndex].StartIndex; Index1 <= RowInfo[RowIndex].EndIndex; Index1++) {\r
if (RowInfo[RowIndex].LineWidth > 0 && RowInfo[RowIndex].LineWidth > LineOffset) {\r
//\r
- // Only BLT these character which have corrsponding glyph in font basebase.\r
+ // Only BLT these character which have corresponding glyph in font database.\r
//\r
GlyphToImage (\r
GlyphBuf[Index1],\r
);\r
}\r
if (ColumnInfoArray != NULL) {\r
- if ((GlyphBuf[Index1] == NULL && Cell[Index1].AdvanceX == 0) \r
+ if ((GlyphBuf[Index1] == NULL && Cell[Index1].AdvanceX == 0)\r
|| RowInfo[RowIndex].LineWidth == 0) {\r
*ColumnInfoArray = (UINTN) ~0;\r
} else {\r
when character display is normalized that some\r
character cells overlap.\r
\r
- @retval EFI_SUCCESS The string was successfully rendered.\r
- @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for\r
- RowInfoArray or Blt.\r
+ @retval EFI_SUCCESS The string was successfully rendered.\r
+ @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for\r
+ RowInfoArray or Blt.\r
@retval EFI_INVALID_PARAMETER The Blt or PackageList was NULL.\r
@retval EFI_INVALID_PARAMETER Flags were invalid combination.\r
- @retval EFI_NOT_FOUND The specified PackageList is not in the Database or the stringid is not \r
- in the specified PackageList. \r
+ @retval EFI_NOT_FOUND The specified PackageList is not in the Database or the string id is not\r
+ in the specified PackageList.\r
\r
**/\r
EFI_STATUS\r
if (EFI_ERROR (Status)) {\r
goto Exit;\r
}\r
- \r
+\r
if (Language == NULL) {\r
Language = "";\r
}\r
Status = EFI_NOT_FOUND;\r
goto Exit;\r
}\r
- \r
+\r
StringSize = MAX_STRING_LENGTH;\r
String = (EFI_STRING) AllocateZeroPool (StringSize);\r
if (String == NULL) {\r
if (EFI_ERROR (Status)) {\r
goto Exit;\r
}\r
- \r
+\r
//\r
// When StringInfo specifies that string will be output in the system default font and color,\r
- // use particular stringfontinfo described in string package instead if exists. \r
+ // use particular stringfontinfo described in string package instead if exists.\r
// StringFontInfo equals NULL means system default font attaches with the string block.\r
//\r
if (StringFontInfo != NULL && IsSystemFontInfo (Private, (EFI_FONT_DISPLAY_INFO *) StringInfo, NULL, NULL)) {\r
NameSize = StrSize (StringFontInfo->FontName);\r
FontLen = sizeof (EFI_FONT_DISPLAY_INFO) - sizeof (CHAR16) + NameSize;\r
NewStringInfo = AllocateZeroPool (FontLen);\r
- if (NewStringInfo == NULL) { \r
+ if (NewStringInfo == NULL) {\r
Status = EFI_OUT_OF_RESOURCES;\r
goto Exit;\r
}\r
NewStringInfo->FontInfoMask = EFI_FONT_INFO_SYS_FORE_COLOR | EFI_FONT_INFO_SYS_BACK_COLOR;\r
NewStringInfo->FontInfo.FontStyle = StringFontInfo->FontStyle;\r
- NewStringInfo->FontInfo.FontSize = StringFontInfo->FontSize; \r
+ NewStringInfo->FontInfo.FontSize = StringFontInfo->FontSize;\r
StrCpyS (NewStringInfo->FontInfo.FontName, NameSize / sizeof (CHAR16), StringFontInfo->FontName);\r
- \r
+\r
Status = HiiStringToImage (\r
- This, \r
- Flags, \r
- String, \r
- NewStringInfo, \r
- Blt, \r
- BltX, \r
- BltY, \r
+ This,\r
+ Flags,\r
+ String,\r
+ NewStringInfo,\r
+ Blt,\r
+ BltX,\r
+ BltY,\r
RowInfoArray,\r
RowInfoArraySize,\r
ColumnInfoArray\r
//\r
BaseLine = (UINT16) (Cell.Height + Cell.OffsetY);\r
//\r
- // Set BltBuffer to the position of Origin. \r
+ // Set BltBuffer to the position of Origin.\r
//\r
BltBuffer = Image->Image.Bitmap + (Cell.Height + Cell.OffsetY) * Image->Width - Cell.OffsetX;\r
GlyphToImage (\r
@param StringInfoOut Upon return, contains the matching font's information.\r
If NULL, then no information is returned. This buffer\r
is allocated with a call to the Boot Service AllocatePool().\r
- It is the caller's responsibility to call the Boot \r
+ It is the caller's responsibility to call the Boot\r
Service FreePool() when the caller no longer requires\r
the contents of StringInfoOut.\r
@param String Points to the string which will be tested to\r
HiiGetFontInfo (\r
IN CONST EFI_HII_FONT_PROTOCOL *This,\r
IN OUT EFI_FONT_HANDLE *FontHandle,\r
- IN CONST EFI_FONT_DISPLAY_INFO *StringInfoIn, OPTIONAL\r
+ IN CONST EFI_FONT_DISPLAY_INFO *StringInfoIn OPTIONAL,\r
OUT EFI_FONT_DISPLAY_INFO **StringInfoOut,\r
IN CONST EFI_STRING String OPTIONAL\r
)\r
goto Exit;\r
}\r
}\r
- \r
+\r
//\r
// StringInfoIn must not be NULL if it is not system default font info.\r
//\r
//\r
// Check the font information mask to make sure it is valid.\r
//\r
- if (((StringInfoIn->FontInfoMask & (EFI_FONT_INFO_SYS_FONT | EFI_FONT_INFO_ANY_FONT)) == \r
+ if (((StringInfoIn->FontInfoMask & (EFI_FONT_INFO_SYS_FONT | EFI_FONT_INFO_ANY_FONT)) ==\r
(EFI_FONT_INFO_SYS_FONT | EFI_FONT_INFO_ANY_FONT)) ||\r
- ((StringInfoIn->FontInfoMask & (EFI_FONT_INFO_SYS_SIZE | EFI_FONT_INFO_ANY_SIZE)) == \r
+ ((StringInfoIn->FontInfoMask & (EFI_FONT_INFO_SYS_SIZE | EFI_FONT_INFO_ANY_SIZE)) ==\r
(EFI_FONT_INFO_SYS_SIZE | EFI_FONT_INFO_ANY_SIZE)) ||\r
- ((StringInfoIn->FontInfoMask & (EFI_FONT_INFO_SYS_STYLE | EFI_FONT_INFO_ANY_STYLE)) == \r
+ ((StringInfoIn->FontInfoMask & (EFI_FONT_INFO_SYS_STYLE | EFI_FONT_INFO_ANY_STYLE)) ==\r
(EFI_FONT_INFO_SYS_STYLE | EFI_FONT_INFO_ANY_STYLE)) ||\r
- ((StringInfoIn->FontInfoMask & (EFI_FONT_INFO_RESIZE | EFI_FONT_INFO_ANY_SIZE)) == \r
- (EFI_FONT_INFO_RESIZE | EFI_FONT_INFO_ANY_SIZE)) || \r
- ((StringInfoIn->FontInfoMask & (EFI_FONT_INFO_RESTYLE | EFI_FONT_INFO_ANY_STYLE)) == \r
+ ((StringInfoIn->FontInfoMask & (EFI_FONT_INFO_RESIZE | EFI_FONT_INFO_ANY_SIZE)) ==\r
+ (EFI_FONT_INFO_RESIZE | EFI_FONT_INFO_ANY_SIZE)) ||\r
+ ((StringInfoIn->FontInfoMask & (EFI_FONT_INFO_RESTYLE | EFI_FONT_INFO_ANY_STYLE)) ==\r
(EFI_FONT_INFO_RESTYLE | EFI_FONT_INFO_ANY_STYLE))) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
if ((StringInfoIn->FontInfoMask & EFI_FONT_INFO_SYS_SIZE) == EFI_FONT_INFO_SYS_SIZE) {\r
InfoOut.FontInfo.FontSize = SystemDefault->FontInfo.FontSize;\r
- } \r
+ }\r
if ((StringInfoIn->FontInfoMask & EFI_FONT_INFO_SYS_STYLE) == EFI_FONT_INFO_SYS_STYLE) {\r
InfoOut.FontInfo.FontStyle = SystemDefault->FontInfo.FontStyle;\r
}\r
if ((StringInfoIn->FontInfoMask & EFI_FONT_INFO_SYS_BACK_COLOR) == EFI_FONT_INFO_SYS_BACK_COLOR) {\r
InfoOut.BackgroundColor = SystemDefault->BackgroundColor;\r
}\r
- \r
+\r
ASSERT (FontInfo != NULL);\r
FontInfo->FontSize = InfoOut.FontInfo.FontSize;\r
FontInfo->FontStyle = InfoOut.FontInfo.FontStyle;\r
if (IsFontInfoExisted (Private, FontInfo, &InfoOut.FontInfoMask, LocalFontHandle, &GlobalFont)) {\r
//\r
// Test to guarantee all characters are available in the found font.\r
- // \r
+ //\r
if (String != NULL) {\r
StringIn = String;\r
while (*StringIn != 0) {\r
//\r
if (StringInfoOut != NULL) {\r
StringInfoOutLen = sizeof (EFI_FONT_DISPLAY_INFO) - sizeof (EFI_FONT_INFO) + GlobalFont->FontInfoSize;\r
- *StringInfoOut = (EFI_FONT_DISPLAY_INFO *) AllocateZeroPool (StringInfoOutLen); \r
+ *StringInfoOut = (EFI_FONT_DISPLAY_INFO *) AllocateZeroPool (StringInfoOutLen);\r
if (*StringInfoOut == NULL) {\r
Status = EFI_OUT_OF_RESOURCES;\r
LocalFontHandle = NULL;\r
goto Exit;\r
}\r
- \r
+\r
CopyMem (*StringInfoOut, &InfoOut, sizeof (EFI_FONT_DISPLAY_INFO));\r
CopyMem (&(*StringInfoOut)->FontInfo, GlobalFont->FontInfo, GlobalFont->FontInfoSize);\r
}\r
- \r
- LocalFontHandle = GlobalFont->Entry.ForwardLink; \r
+\r
+ LocalFontHandle = GlobalFont->Entry.ForwardLink;\r
Status = EFI_SUCCESS;\r
goto Exit;\r
- } \r
+ }\r
\r
Status = EFI_NOT_FOUND;\r
\r
}\r
return Status;\r
}\r
-\r
-\r