TianoCore EDK2 master
|
#include "HiiDatabase.h"
Go to the source code of this file.
Variables | |
EFI_GRAPHICS_OUTPUT_BLT_PIXEL | mHiiEfiColors [16] |
Implementation for EFI_HII_FONT_PROTOCOL.
Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file Font.c.
EFI_STATUS FindGlyphBlock | ( | IN HII_FONT_PACKAGE_INSTANCE * | FontPackage, |
IN CHAR16 | CharValue, | ||
OUT UINT8 **GlyphBuffer | OPTIONAL, | ||
OUT EFI_HII_GLYPH_INFO *Cell | OPTIONAL, | ||
OUT UINTN *GlyphBufferLen | OPTIONAL | ||
) |
Parse all glyph blocks to find a glyph block specified by CharValue. If CharValue = (CHAR16) (-1), collect all default character cell information within this font package and backup its information.
FontPackage | Hii string package instance. |
CharValue | Unicode character value, which identifies a glyph block. |
GlyphBuffer | Output the corresponding bitmap data of the found block. It is the caller's responsibility to free this buffer. |
Cell | Output cell information of the encoded bitmap. |
GlyphBufferLen | If not NULL, output the length of GlyphBuffer. |
EFI_SUCCESS | The bitmap data is retrieved successfully. |
EFI_NOT_FOUND | The specified CharValue does not exist in current database. |
EFI_OUT_OF_RESOURCES | The system is out of resources to accomplish the task. |
EFI_STATUS GetCell | ( | IN CHAR16 | CharValue, |
IN LIST_ENTRY * | GlyphInfoList, | ||
OUT EFI_HII_GLYPH_INFO * | Cell | ||
) |
Get a character cell information from the list specified by GlyphInfoList.
This is a internal function.
CharValue | Unicode character value, which identifies a glyph block. |
GlyphInfoList | HII_GLYPH_INFO list head. |
Cell | Buffer which stores output character cell information. |
EFI_SUCCESS | Cell information is added to the GlyphInfoList. |
EFI_NOT_FOUND | The character info specified by CharValue does not exist. |
EFI_STATUS GetGlyphBuffer | ( | IN HII_DATABASE_PRIVATE_DATA * | Private, |
IN CHAR16 | Char, | ||
IN EFI_FONT_INFO * | StringInfo, | ||
OUT UINT8 ** | GlyphBuffer, | ||
OUT EFI_HII_GLYPH_INFO * | Cell, | ||
OUT UINT8 *Attributes | OPTIONAL | ||
) |
Convert the glyph for a single character into a bitmap.
This is a internal function.
Private | HII database driver private data. |
Char | Character to retrieve. |
StringInfo | Points to the string font and color information or NULL if the string should use the default system font and color. |
GlyphBuffer | Buffer to store the retrieved bitmap data. |
Cell | Points to EFI_HII_GLYPH_INFO structure. |
Attributes | If not NULL, output the glyph attributes if any. |
EFI_SUCCESS | Glyph bitmap outputted. |
EFI_OUT_OF_RESOURCES | Unable to allocate the output buffer GlyphBuffer. |
EFI_NOT_FOUND | The glyph was unknown can not be found. |
EFI_INVALID_PARAMETER | Any input parameter is invalid. |
EFI_STATUS GetSystemFont | ( | IN HII_DATABASE_PRIVATE_DATA * | Private, |
OUT EFI_FONT_DISPLAY_INFO ** | FontInfo, | ||
OUT UINTN *FontInfoSize | OPTIONAL | ||
) |
Retrieve system default font and color.
Private | HII database driver private data. |
FontInfo | Points to system default font output-related information. It's caller's responsibility to free this buffer. |
FontInfoSize | If not NULL, output the size of buffer FontInfo. |
EFI_SUCCESS | Cell information is added to the GlyphInfoList. |
EFI_OUT_OF_RESOURCES | The system is out of resources to accomplish the task. |
EFI_INVALID_PARAMETER | Any input parameter is invalid. |
VOID GlyphToBlt | ( | IN UINT8 * | GlyphBuffer, |
IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL | Foreground, | ||
IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL | Background, | ||
IN UINT16 | ImageWidth, | ||
IN UINT16 | BaseLine, | ||
IN UINTN | RowWidth, | ||
IN UINTN | RowHeight, | ||
IN BOOLEAN | Transparent, | ||
IN CONST EFI_HII_GLYPH_INFO * | Cell, | ||
IN UINT8 | Attributes, | ||
IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL ** | Origin | ||
) |
Convert bitmap data of the glyph to blt structure.
This is a internal function.
GlyphBuffer | Buffer points to bitmap data of glyph. |
Foreground | The color of the "on" pixels in the glyph in the bitmap. |
Background | The color of the "off" pixels in the glyph in the bitmap. |
ImageWidth | Width of the whole image in pixels. |
BaseLine | BaseLine in the line. |
RowWidth | The width of the text on the line, in pixels. |
RowHeight | The height of the line, in pixels. |
Transparent | If TRUE, the Background color is ignored and all "off" pixels in the character's drawn will use the pixel value from BltBuffer. |
Cell | Points to EFI_HII_GLYPH_INFO structure. |
Attributes | The attribute of incoming glyph in GlyphBuffer. |
Origin | On input, points to the origin of the to be displayed character, on output, points to the next glyph's origin. |
VOID GlyphToImage | ( | IN UINT8 * | GlyphBuffer, |
IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL | Foreground, | ||
IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL | Background, | ||
IN UINT16 | ImageWidth, | ||
IN UINT16 | BaseLine, | ||
IN UINTN | RowWidth, | ||
IN UINTN | RowHeight, | ||
IN BOOLEAN | Transparent, | ||
IN CONST EFI_HII_GLYPH_INFO * | Cell, | ||
IN UINT8 | Attributes, | ||
IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL ** | Origin | ||
) |
Convert bitmap data of the glyph to blt structure.
This is a internal function.
GlyphBuffer | Buffer points to bitmap data of glyph. |
Foreground | The color of the "on" pixels in the glyph in the bitmap. |
Background | The color of the "off" pixels in the glyph in the bitmap. |
ImageWidth | Width of the whole image in pixels. |
BaseLine | BaseLine in the line. |
RowWidth | The width of the text on the line, in pixels. |
RowHeight | The height of the line, in pixels. |
Transparent | If TRUE, the Background color is ignored and all "off" pixels in the character's drawn will use the pixel value from BltBuffer. |
Cell | Points to EFI_HII_GLYPH_INFO structure. |
Attributes | The attribute of incoming glyph in GlyphBuffer. |
Origin | On input, points to the origin of the to be displayed character, on output, points to the next glyph's origin. |
EFI_STATUS EFIAPI HiiGetFontInfo | ( | IN CONST EFI_HII_FONT_PROTOCOL * | This, |
IN OUT EFI_FONT_HANDLE * | FontHandle, | ||
IN CONST EFI_FONT_DISPLAY_INFO *StringInfoIn | OPTIONAL, | ||
OUT EFI_FONT_DISPLAY_INFO ** | StringInfoOut, | ||
IN CONST EFI_STRING String | OPTIONAL | ||
) |
This function iterates through fonts which match the specified font, using the specified criteria. If String is non-NULL, then all of the characters in the string must exist in order for a candidate font to be returned.
This | A pointer to the EFI_HII_FONT_PROTOCOL instance. |
FontHandle | On entry, points to the font handle returned by a previous call to GetFontInfo() or NULL to start with the first font. On return, points to the returned font handle or points to NULL if there are no more matching fonts. |
StringInfoIn | Upon entry, points to the font to return information about. If NULL, then the information about the system default font will be returned. |
StringInfoOut | Upon return, contains the matching font's information. If NULL, then no information is returned. This buffer is allocated with a call to the Boot Service AllocatePool(). It is the caller's responsibility to call the Boot Service FreePool() when the caller no longer requires the contents of StringInfoOut. |
String | Points to the string which will be tested to determine if all characters are available. If NULL, then any font is acceptable. |
EFI_SUCCESS | Matching font returned successfully. |
EFI_NOT_FOUND | No matching font was found. |
EFI_INVALID_PARAMETER | StringInfoIn->FontInfoMask is an invalid combination. |
EFI_OUT_OF_RESOURCES | There were insufficient resources to complete the request. |
EFI_STATUS EFIAPI HiiGetGlyph | ( | IN CONST EFI_HII_FONT_PROTOCOL * | This, |
IN CHAR16 | Char, | ||
IN CONST EFI_FONT_DISPLAY_INFO * | StringInfo, | ||
OUT EFI_IMAGE_OUTPUT ** | Blt, | ||
OUT UINTN *Baseline | OPTIONAL | ||
) |
Convert the glyph for a single character into a bitmap.
This | A pointer to the EFI_HII_FONT_PROTOCOL instance. |
Char | Character to retrieve. |
StringInfo | Points to the string font and color information or NULL if the string should use the default system font and color. |
Blt | Thus must point to a NULL on entry. A buffer will be allocated to hold the output and the pointer updated on exit. It is the caller's responsibility to free this buffer. |
Baseline | Number of pixels from the bottom of the bitmap to the baseline. |
EFI_SUCCESS | Glyph bitmap created. |
EFI_OUT_OF_RESOURCES | Unable to allocate the output buffer Blt. |
EFI_WARN_UNKNOWN_GLYPH | The glyph was unknown and was replaced with the glyph for Unicode character 0xFFFD. |
EFI_INVALID_PARAMETER | Blt is NULL or *Blt is not NULL. |
EFI_STATUS EFIAPI HiiStringIdToImage | ( | IN CONST EFI_HII_FONT_PROTOCOL * | This, |
IN EFI_HII_OUT_FLAGS | Flags, | ||
IN EFI_HII_HANDLE | PackageList, | ||
IN EFI_STRING_ID | StringId, | ||
IN CONST CHAR8 * | Language, | ||
IN CONST EFI_FONT_DISPLAY_INFO *StringInfo | OPTIONAL, | ||
IN OUT EFI_IMAGE_OUTPUT ** | Blt, | ||
IN UINTN | BltX, | ||
IN UINTN | BltY, | ||
OUT EFI_HII_ROW_INFO **RowInfoArray | OPTIONAL, | ||
OUT UINTN *RowInfoArraySize | OPTIONAL, | ||
OUT UINTN *ColumnInfoArray | OPTIONAL | ||
) |
Render a string to a bitmap or the screen containing the contents of the specified string.
This | A pointer to the EFI_HII_FONT_PROTOCOL instance. |
Flags | Describes how the string is to be drawn. |
PackageList | The package list in the HII database to search for the specified string. |
StringId | The string's id, which is unique within PackageList. |
Language | Points to the language for the retrieved string. If NULL, then the current system language is used. |
StringInfo | Points to the string output information, including the color and font. If NULL, then the string will be output in the default system font and color. |
Blt | If this points to a non-NULL on entry, this points to the image, which is Width pixels wide and Height pixels high. The string will be drawn onto this image and EFI_HII_OUT_FLAG_CLIP is implied. If this points to a NULL on entry, then a buffer will be allocated to hold the generated image and the pointer updated on exit. It is the caller's responsibility to free this buffer. |
BltX | Specifies the offset from the left and top edge of the image of the first character cell in the image. |
BltY | Specifies the offset from the left and top edge of the image of the first character cell in the image. |
RowInfoArray | If this is non-NULL on entry, then on exit, this will point to an allocated buffer containing row information and RowInfoArraySize will be updated to contain the number of elements. This array describes the characters which were at least partially drawn and the heights of the rows. It is the caller's responsibility to free this buffer. |
RowInfoArraySize | If this is non-NULL on entry, then on exit it contains the number of elements in RowInfoArray. |
ColumnInfoArray | If this is non-NULL, then on return it will be filled with the horizontal offset for each character in the string on the row where it is displayed. Non-printing characters will have the offset ~0. The caller is responsible to allocate a buffer large enough so that there is one entry for each character in the string, not including the null-terminator. It is possible when character display is normalized that some character cells overlap. |
EFI_SUCCESS | The string was successfully rendered. |
EFI_OUT_OF_RESOURCES | Unable to allocate an output buffer for RowInfoArray or Blt. |
EFI_INVALID_PARAMETER | The Blt or PackageList was NULL. |
EFI_INVALID_PARAMETER | Flags were invalid combination. |
EFI_NOT_FOUND | The specified PackageList is not in the Database or the string id is not in the specified PackageList. |
EFI_STATUS EFIAPI HiiStringToImage | ( | IN CONST EFI_HII_FONT_PROTOCOL * | This, |
IN EFI_HII_OUT_FLAGS | Flags, | ||
IN CONST EFI_STRING | String, | ||
IN CONST EFI_FONT_DISPLAY_INFO *StringInfo | OPTIONAL, | ||
IN OUT EFI_IMAGE_OUTPUT ** | Blt, | ||
IN UINTN | BltX, | ||
IN UINTN | BltY, | ||
OUT EFI_HII_ROW_INFO **RowInfoArray | OPTIONAL, | ||
OUT UINTN *RowInfoArraySize | OPTIONAL, | ||
OUT UINTN *ColumnInfoArray | OPTIONAL | ||
) |
Renders a string to a bitmap or to the display.
This | A pointer to the EFI_HII_FONT_PROTOCOL instance. |
Flags | Describes how the string is to be drawn. |
String | Points to the null-terminated string to be displayed. |
StringInfo | Points to the string output information, including the color and font. If NULL, then the string will be output in the default system font and color. |
Blt | If this points to a non-NULL on entry, this points to the image, which is Width pixels wide and Height pixels high. The string will be drawn onto this image and EFI_HII_OUT_FLAG_CLIP is implied. If this points to a NULL on entry, then a buffer will be allocated to hold the generated image and the pointer updated on exit. It is the caller's responsibility to free this buffer. |
BltX | Specifies the offset from the left and top edge of the image of the first character cell in the image. |
BltY | Specifies the offset from the left and top edge of the image of the first character cell in the image. |
RowInfoArray | If this is non-NULL on entry, then on exit, this will point to an allocated buffer containing row information and RowInfoArraySize will be updated to contain the number of elements. This array describes the characters which were at least partially drawn and the heights of the rows. It is the caller's responsibility to free this buffer. |
RowInfoArraySize | If this is non-NULL on entry, then on exit it contains the number of elements in RowInfoArray. |
ColumnInfoArray | If this is non-NULL, then on return it will be filled with the horizontal offset for each character in the string on the row where it is displayed. Non-printing characters will have the offset ~0. The caller is responsible to allocate a buffer large enough so that there is one entry for each character in the string, not including the null-terminator. It is possible when character display is normalized that some character cells overlap. |
EFI_SUCCESS | The string was successfully rendered. |
EFI_OUT_OF_RESOURCES | Unable to allocate an output buffer for RowInfoArray or Blt. |
EFI_INVALID_PARAMETER | The String or Blt was NULL. |
EFI_INVALID_PARAMETER | Flags were invalid combination.. |
BOOLEAN IsFontInfoExisted | ( | IN HII_DATABASE_PRIVATE_DATA * | Private, |
IN EFI_FONT_INFO * | FontInfo, | ||
IN EFI_FONT_INFO_MASK *FontInfoMask | OPTIONAL, | ||
IN EFI_FONT_HANDLE FontHandle | OPTIONAL, | ||
OUT HII_GLOBAL_FONT_INFO **GlobalFontInfo | OPTIONAL | ||
) |
This function checks whether EFI_FONT_INFO exists in current database. If FontInfoMask is specified, check what options can be used to make a match. Note that the masks relate to where the system default should be supplied are ignored by this function.
Private | Hii database private structure. |
FontInfo | Points to EFI_FONT_INFO structure. |
FontInfoMask | If not NULL, describes what options can be used to make a match between the font requested and the font available. The caller must guarantee this mask is valid. |
FontHandle | On entry, Points to the font handle returned by a previous call to GetFontInfo() or NULL to start with the first font. |
GlobalFontInfo | If not NULL, output the corresponding global font info. |
TRUE | Existed |
FALSE | Not existed |
INT8 IsLineBreak | ( | IN CHAR16 | Char | ) |
Check whether the unicode represents a line break or not.
This is a internal function. Please see Section 27.2.6 of the UEFI Specification for a description of the supported string format.
Char | Unicode character |
0 | Yes, it forces a line break. |
1 | Yes, it presents a line break opportunity |
2 | Yes, it requires a line break happen before and after it. |
-1 | No, it is not a link break. |
BOOLEAN IsSystemFontInfo | ( | IN HII_DATABASE_PRIVATE_DATA * | Private, |
IN EFI_FONT_DISPLAY_INFO * | StringInfo, | ||
OUT EFI_FONT_DISPLAY_INFO **SystemInfo | OPTIONAL, | ||
OUT UINTN *SystemInfoLen | OPTIONAL | ||
) |
Check whether EFI_FONT_DISPLAY_INFO points to system default font and color or returns the system default according to the optional inputs.
This is a internal function.
Private | HII database driver private data. |
StringInfo | Points to the string output information, including the color and font. |
SystemInfo | If not NULL, points to system default font and color. |
SystemInfoLen | If not NULL, output the length of default system info. |
TRUE | Yes, it points to system default. |
FALSE | No. |
VOID NarrowGlyphToBlt | ( | IN UINT8 * | GlyphBuffer, |
IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL | Foreground, | ||
IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL | Background, | ||
IN UINT16 | ImageWidth, | ||
IN UINTN | RowWidth, | ||
IN UINTN | RowHeight, | ||
IN BOOLEAN | Transparent, | ||
IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL ** | Origin | ||
) |
Convert bitmap data of the glyph to blt structure.
This is a internal function.
GlyphBuffer | Buffer points to bitmap data of glyph. |
Foreground | The color of the "on" pixels in the glyph in the bitmap. |
Background | The color of the "off" pixels in the glyph in the bitmap. |
ImageWidth | Width of the whole image in pixels. |
RowWidth | The width of the text on the line, in pixels. |
RowHeight | The height of the line, in pixels. |
Transparent | If TRUE, the Background color is ignored and all "off" pixels in the character's drawn will use the pixel value from BltBuffer. |
Origin | On input, points to the origin of the to be displayed character, on output, points to the next glyph's origin. |
EFI_STATUS NewCell | ( | IN CHAR16 | CharValue, |
IN LIST_ENTRY * | GlyphInfoList, | ||
IN EFI_HII_GLYPH_INFO * | Cell | ||
) |
Insert a character cell information to the list specified by GlyphInfoList.
This is a internal function.
CharValue | Unicode character value, which identifies a glyph block. |
GlyphInfoList | HII_GLYPH_INFO list head. |
Cell | Incoming character cell information. |
EFI_SUCCESS | Cell information is added to the GlyphInfoList. |
EFI_OUT_OF_RESOURCES | The system is out of resources to accomplish the task. |
EFI_STATUS SaveFontName | ( | IN EFI_STRING | FontName, |
OUT EFI_FONT_INFO ** | FontInfo | ||
) |
Copy a Font Name to a new created EFI_FONT_INFO structure.
This is a internal function.
FontName | NULL-terminated string. |
FontInfo | a new EFI_FONT_INFO which stores the FontName. It's caller's responsibility to free this buffer. |
EFI_SUCCESS | FontInfo is allocated and copied with FontName. |
EFI_OUT_OF_RESOURCES | The system is out of resources to accomplish the task. |
EFI_STATUS WriteOutputParam | ( | IN UINT8 * | BufferIn, |
IN UINTN | BufferLen, | ||
IN EFI_HII_GLYPH_INFO * | InputCell, | ||
OUT UINT8 **GlyphBuffer | OPTIONAL, | ||
OUT EFI_HII_GLYPH_INFO *Cell | OPTIONAL, | ||
OUT UINTN *GlyphBufferLen | OPTIONAL | ||
) |
Write the output parameters of FindGlyphBlock().
This is a internal function.
BufferIn | Buffer which stores the bitmap data of the found block. |
BufferLen | Length of BufferIn. |
InputCell | Buffer which stores cell information of the encoded bitmap. |
GlyphBuffer | Output the corresponding bitmap data of the found block. It is the caller's responsibility to free this buffer. |
Cell | Output cell information of the encoded bitmap. |
GlyphBufferLen | If not NULL, output the length of GlyphBuffer. |
EFI_SUCCESS | The operation is performed successfully. |
EFI_INVALID_PARAMETER | Any input parameter is invalid. |
EFI_OUT_OF_RESOURCES | The system is out of resources to accomplish the task. |
EFI_GRAPHICS_OUTPUT_BLT_PIXEL mHiiEfiColors[16] |