]>
Commit | Line | Data |
---|---|---|
d1f95000 | 1 | /** @file\r |
2 | The file provides services to retrieve font information.\r | |
9095d37b LG |
3 | \r |
4 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r | |
9344f092 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
d1f95000 | 6 | \r |
497a5fb1 SZ |
7 | @par Revision Reference:\r |
8 | This Protocol was introduced in UEFI Specification 2.1.\r | |
9 | \r | |
d1f95000 | 10 | **/\r |
11 | \r | |
12 | #ifndef __HII_FONT_H__\r | |
13 | #define __HII_FONT_H__\r | |
14 | \r | |
5a1fc221 | 15 | #include <Protocol/GraphicsOutput.h>\r |
d1f95000 | 16 | #include <Protocol/HiiImage.h>\r |
17 | \r | |
18 | #define EFI_HII_FONT_PROTOCOL_GUID \\r | |
19 | { 0xe9ca4775, 0x8657, 0x47fc, { 0x97, 0xe7, 0x7e, 0xd6, 0x5a, 0x8, 0x43, 0x24 } }\r | |
20 | \r | |
21 | typedef struct _EFI_HII_FONT_PROTOCOL EFI_HII_FONT_PROTOCOL;\r | |
22 | \r | |
5a1fc221 | 23 | typedef VOID *EFI_FONT_HANDLE;\r |
d1f95000 | 24 | \r |
721b16af | 25 | ///\r |
af2dc6a7 | 26 | /// EFI_HII_OUT_FLAGS.\r |
9095d37b | 27 | ///\r |
d1f95000 | 28 | typedef UINT32 EFI_HII_OUT_FLAGS;\r |
721b16af | 29 | \r |
d1f95000 | 30 | #define EFI_HII_OUT_FLAG_CLIP 0x00000001\r |
31 | #define EFI_HII_OUT_FLAG_WRAP 0x00000002\r | |
54cf8780 | 32 | #define EFI_HII_OUT_FLAG_CLIP_CLEAN_Y 0x00000004\r |
33 | #define EFI_HII_OUT_FLAG_CLIP_CLEAN_X 0x00000008\r | |
d1f95000 | 34 | #define EFI_HII_OUT_FLAG_TRANSPARENT 0x00000010\r |
35 | #define EFI_HII_IGNORE_IF_NO_GLYPH 0x00000020\r | |
36 | #define EFI_HII_IGNORE_LINE_BREAK 0x00000040\r | |
37 | #define EFI_HII_DIRECT_TO_SCREEN 0x00000080\r | |
38 | \r | |
39 | /**\r | |
d1f95000 | 40 | Definition of EFI_HII_ROW_INFO.\r |
d1f95000 | 41 | **/\r |
42 | typedef struct _EFI_HII_ROW_INFO {\r | |
721b16af | 43 | ///\r |
44 | /// The index of the first character in the string which is displayed on the line.\r | |
45 | ///\r | |
d1f95000 | 46 | UINTN StartIndex;\r |
721b16af | 47 | ///\r |
48 | /// The index of the last character in the string which is displayed on the line.\r | |
9095d37b | 49 | /// If this is the same as StartIndex, then no characters are displayed.\r |
721b16af | 50 | ///\r |
d1f95000 | 51 | UINTN EndIndex;\r |
721b16af | 52 | UINTN LineHeight; ///< The height of the line, in pixels.\r |
53 | UINTN LineWidth; ///< The width of the text on the line, in pixels.\r | |
9095d37b | 54 | \r |
721b16af | 55 | ///\r |
5795218e | 56 | /// The font baseline offset in pixels from the bottom of the row, or 0 if none.\r |
721b16af | 57 | ///\r |
d1f95000 | 58 | UINTN BaselineOffset;\r |
59 | } EFI_HII_ROW_INFO;\r | |
60 | \r | |
721b16af | 61 | ///\r |
992f22b9 LG |
62 | /// Font info flag. All flags (FONT, SIZE, STYLE, and COLOR) are defined.\r |
63 | /// They are defined as EFI_FONT_INFO_***\r | |
64 | ///\r | |
d1f95000 | 65 | typedef UINT32 EFI_FONT_INFO_MASK;\r |
721b16af | 66 | \r |
d1f95000 | 67 | #define EFI_FONT_INFO_SYS_FONT 0x00000001\r |
68 | #define EFI_FONT_INFO_SYS_SIZE 0x00000002\r | |
69 | #define EFI_FONT_INFO_SYS_STYLE 0x00000004\r | |
70 | #define EFI_FONT_INFO_SYS_FORE_COLOR 0x00000010\r | |
71 | #define EFI_FONT_INFO_SYS_BACK_COLOR 0x00000020\r | |
72 | #define EFI_FONT_INFO_RESIZE 0x00001000\r | |
73 | #define EFI_FONT_INFO_RESTYLE 0x00002000\r | |
74 | #define EFI_FONT_INFO_ANY_FONT 0x00010000\r | |
75 | #define EFI_FONT_INFO_ANY_SIZE 0x00020000\r | |
76 | #define EFI_FONT_INFO_ANY_STYLE 0x00040000\r | |
77 | \r | |
78 | //\r | |
79 | // EFI_FONT_INFO\r | |
9095d37b | 80 | //\r |
d1f95000 | 81 | typedef struct {\r |
54cf8780 | 82 | EFI_HII_FONT_STYLE FontStyle;\r |
721b16af | 83 | UINT16 FontSize; ///< character cell height in pixels\r |
54cf8780 | 84 | CHAR16 FontName[1];\r |
d1f95000 | 85 | } EFI_FONT_INFO;\r |
86 | \r | |
87 | /**\r | |
992f22b9 LG |
88 | Describes font output-related information.\r |
89 | \r | |
f754f721 | 90 | This structure is used for describing the way in which a string\r |
d1f95000 | 91 | should be rendered in a particular font. FontInfo specifies the\r |
f754f721 | 92 | basic font information and ForegroundColor and BackgroundColor\r |
93 | specify the color in which they should be displayed. The flags\r | |
d1f95000 | 94 | in FontInfoMask describe where the system default should be\r |
95 | supplied instead of the specified information. The flags also\r | |
96 | describe what options can be used to make a match between the\r | |
992f22b9 | 97 | font requested and the font available.\r |
d1f95000 | 98 | **/\r |
99 | typedef struct _EFI_FONT_DISPLAY_INFO {\r | |
d1f95000 | 100 | EFI_GRAPHICS_OUTPUT_BLT_PIXEL ForegroundColor;\r |
101 | EFI_GRAPHICS_OUTPUT_BLT_PIXEL BackgroundColor;\r | |
102 | EFI_FONT_INFO_MASK FontInfoMask;\r | |
9095d37b | 103 | EFI_FONT_INFO FontInfo;\r |
d1f95000 | 104 | } EFI_FONT_DISPLAY_INFO;\r |
105 | \r | |
106 | /**\r | |
107 | \r | |
108 | This function renders a string to a bitmap or the screen using\r | |
109 | the specified font, color and options. It either draws the\r | |
af2dc6a7 | 110 | string and glyphs on an existing bitmap, allocates a new bitmap,\r |
d1f95000 | 111 | or uses the screen. The strings can be clipped or wrapped.\r |
112 | Optionally, the function also returns the information about each\r | |
113 | row and the character position on that row. If\r | |
114 | EFI_HII_OUT_FLAG_CLIP is set, then text will be formatted only\r | |
115 | based on explicit line breaks and all pixels which would lie\r | |
116 | outside the bounding box specified by Width and Height are\r | |
117 | ignored. The information in the RowInfoArray only describes\r | |
118 | characters which are at least partially displayed. For the final\r | |
af2dc6a7 | 119 | row, the LineHeight and BaseLine may describe pixels that are\r |
d1f95000 | 120 | outside the limit specified by Height (unless\r |
121 | EFI_HII_OUT_FLAG_CLIP_CLEAN_Y is specified) even though those\r | |
122 | pixels were not drawn. The LineWidth may describe pixels which\r | |
123 | are outside the limit specified by Width (unless\r | |
124 | EFI_HII_OUT_FLAG_CLIP_CLEAN_X is specified) even though those\r | |
125 | pixels were not drawn. If EFI_HII_OUT_FLAG_CLIP_CLEAN_X is set,\r | |
126 | then it modifies the behavior of EFI_HII_OUT_FLAG_CLIP so that\r | |
4ca9b6c4 | 127 | if a character's right-most on pixel cannot fit, then it will\r |
d1f95000 | 128 | not be drawn at all. This flag requires that\r |
129 | EFI_HII_OUT_FLAG_CLIP be set. If EFI_HII_OUT_FLAG_CLIP_CLEAN_Y\r | |
130 | is set, then it modifies the behavior of EFI_HII_OUT_FLAG_CLIP\r | |
4ca9b6c4 | 131 | so that if a row's bottom-most pixel cannot fit, then it will\r |
d1f95000 | 132 | not be drawn at all. This flag requires that\r |
133 | EFI_HII_OUT_FLAG_CLIP be set. If EFI_HII_OUT_FLAG_WRAP is set,\r | |
134 | then text will be wrapped at the right-most line-break\r | |
135 | opportunity prior to a character whose right-most extent would\r | |
136 | exceed Width. If no line-break opportunity can be found, then\r | |
137 | the text will behave as if EFI_HII_OUT_FLAG_CLIP_CLEAN_X is set.\r | |
138 | This flag cannot be used with EFI_HII_OUT_FLAG_CLIP_CLEAN_X. If\r | |
139 | EFI_HII_OUT_FLAG_TRANSPARENT is set, then BackgroundColor is\r | |
4ca9b6c4 | 140 | ignored and all 'off' pixels in the character's drawn\r |
d1f95000 | 141 | will use the pixel value from Blt. This flag cannot be used if\r |
142 | Blt is NULL upon entry. If EFI_HII_IGNORE_IF_NO_GLYPH is set,\r | |
143 | then characters which have no glyphs are not drawn. Otherwise,\r | |
fbf926ad | 144 | they are replaced with Unicode character code 0xFFFD (REPLACEMENT\r |
d1f95000 | 145 | CHARACTER). If EFI_HII_IGNORE_LINE_BREAK is set, then explicit\r |
146 | line break characters will be ignored. If\r | |
147 | EFI_HII_DIRECT_TO_SCREEN is set, then the string will be written\r | |
148 | directly to the output device specified by Screen. Otherwise the\r | |
149 | string will be rendered to the bitmap specified by Bitmap.\r | |
150 | \r | |
4ca9b6c4 | 151 | @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.\r |
d1f95000 | 152 | \r |
4ca9b6c4 | 153 | @param Flags Describes how the string is to be drawn.\r |
d1f95000 | 154 | \r |
9095d37b | 155 | @param String Points to the null-terminated string to be\r |
d1f95000 | 156 | \r |
4ca9b6c4 LG |
157 | @param StringInfo Points to the string output information,\r |
158 | including the color and font. If NULL, then\r | |
159 | the string will be output in the default\r | |
160 | system font and color.\r | |
d1f95000 | 161 | \r |
4ca9b6c4 LG |
162 | @param Blt If this points to a non-NULL on entry, this points\r |
163 | to the image, which is Width pixels wide and\r | |
164 | Height pixels high. The string will be drawn onto\r | |
165 | this image and EFI_HII_OUT_FLAG_CLIP is implied.\r | |
166 | If this points to a NULL on entry, then a buffer\r | |
167 | will be allocated to hold the generated image and\r | |
168 | the pointer updated on exit. It is the caller's\r | |
169 | responsibility to free this buffer.\r | |
d1f95000 | 170 | \r |
4ca9b6c4 LG |
171 | @param BltX, BltY Specifies the offset from the left and top\r |
172 | edge of the image of the first character\r | |
173 | cell in the image.\r | |
174 | \r | |
175 | @param RowInfoArray If this is non-NULL on entry, then on\r | |
176 | exit, this will point to an allocated buffer\r | |
177 | containing row information and\r | |
178 | RowInfoArraySize will be updated to contain\r | |
179 | the number of elements. This array describes\r | |
af2dc6a7 | 180 | the characters that were at least partially\r |
4ca9b6c4 LG |
181 | drawn and the heights of the rows. It is the\r |
182 | caller's responsibility to free this buffer.\r | |
d1f95000 | 183 | \r |
184 | @param RowInfoArraySize If this is non-NULL on entry, then on\r | |
185 | exit it contains the number of\r | |
186 | elements in RowInfoArray.\r | |
187 | \r | |
4ca9b6c4 | 188 | @param ColumnInfoArray If this is non-NULL, then on return it\r |
d1f95000 | 189 | will be filled with the horizontal\r |
190 | offset for each character in the\r | |
191 | string on the row where it is\r | |
192 | displayed. Non-printing characters\r | |
193 | will have the offset ~0. The caller is\r | |
630b4187 | 194 | responsible for allocating a buffer large\r |
d1f95000 | 195 | enough so that there is one entry for\r |
196 | each character in the string, not\r | |
197 | including the null-terminator. It is\r | |
198 | possible when character display is\r | |
199 | normalized that some character cells\r | |
200 | overlap.\r | |
201 | \r | |
4ca9b6c4 | 202 | @retval EFI_SUCCESS The string was successfully updated.\r |
9095d37b | 203 | \r |
4ca9b6c4 | 204 | @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for RowInfoArray or Blt.\r |
9095d37b | 205 | \r |
4ca9b6c4 | 206 | @retval EFI_INVALID_PARAMETER The String or Blt was NULL.\r |
d1f95000 | 207 | \r |
4ca9b6c4 | 208 | @retval EFI_INVALID_PARAMETER Flags were invalid combination.\r |
d1f95000 | 209 | **/\r |
210 | typedef\r | |
211 | EFI_STATUS\r | |
8b13229b | 212 | (EFIAPI *EFI_HII_STRING_TO_IMAGE)(\r |
d1f95000 | 213 | IN CONST EFI_HII_FONT_PROTOCOL *This,\r |
7d582d6b | 214 | IN EFI_HII_OUT_FLAGS Flags,\r |
d1f95000 | 215 | IN CONST EFI_STRING String,\r |
216 | IN CONST EFI_FONT_DISPLAY_INFO *StringInfo,\r | |
217 | IN OUT EFI_IMAGE_OUTPUT **Blt,\r | |
7d582d6b | 218 | IN UINTN BltX,\r |
219 | IN UINTN BltY,\r | |
d1f95000 | 220 | OUT EFI_HII_ROW_INFO **RowInfoArray OPTIONAL,\r |
221 | OUT UINTN *RowInfoArraySize OPTIONAL,\r | |
222 | OUT UINTN *ColumnInfoArray OPTIONAL\r | |
223 | );\r | |
224 | \r | |
225 | \r | |
226 | \r | |
227 | /**\r | |
228 | \r | |
229 | This function renders a string as a bitmap or to the screen\r | |
230 | and can clip or wrap the string. The bitmap is either supplied\r | |
630b4187 | 231 | by the caller or allocated by the function. The\r |
d1f95000 | 232 | strings are drawn with the font, size and style specified and\r |
233 | can be drawn transparently or opaquely. The function can also\r | |
234 | return information about each row and each character's\r | |
235 | position on the row. If EFI_HII_OUT_FLAG_CLIP is set, then\r | |
af2dc6a7 | 236 | text will be formatted based only on explicit line breaks, and\r |
237 | all pixels that would lie outside the bounding box specified\r | |
d1f95000 | 238 | by Width and Height are ignored. The information in the\r |
239 | RowInfoArray only describes characters which are at least\r | |
240 | partially displayed. For the final row, the LineHeight and\r | |
241 | BaseLine may describe pixels which are outside the limit\r | |
242 | specified by Height (unless EFI_HII_OUT_FLAG_CLIP_CLEAN_Y is\r | |
243 | specified) even though those pixels were not drawn. If\r | |
244 | EFI_HII_OUT_FLAG_CLIP_CLEAN_X is set, then it modifies the\r | |
4ca9b6c4 | 245 | behavior of EFI_HII_OUT_FLAG_CLIP so that if a character's\r |
d1f95000 | 246 | right-most on pixel cannot fit, then it will not be drawn at\r |
247 | all. This flag requires that EFI_HII_OUT_FLAG_CLIP be set. If\r | |
248 | EFI_HII_OUT_FLAG_CLIP_CLEAN_Y is set, then it modifies the\r | |
4ca9b6c4 | 249 | behavior of EFI_HII_OUT_FLAG_CLIP so that if a row's bottom\r |
d1f95000 | 250 | most pixel cannot fit, then it will not be drawn at all. This\r |
c8c44377 | 251 | flag requires that EFI_HII_OUT_FLAG_CLIP be set. If\r |
d1f95000 | 252 | EFI_HII_OUT_FLAG_WRAP is set, then text will be wrapped at the\r |
253 | right-most line-break opportunity prior to a character whose\r | |
254 | right-most extent would exceed Width. If no line-break\r | |
255 | opportunity can be found, then the text will behave as if\r | |
256 | EFI_HII_OUT_FLAG_CLIP_CLEAN_X is set. This flag cannot be used\r | |
257 | with EFI_HII_OUT_FLAG_CLIP_CLEAN_X. If\r | |
258 | EFI_HII_OUT_FLAG_TRANSPARENT is set, then BackgroundColor is\r | |
ac644614 | 259 | ignored and all off" pixels in the character's glyph will\r |
d1f95000 | 260 | use the pixel value from Blt. This flag cannot be used if Blt\r |
261 | is NULL upon entry. If EFI_HII_IGNORE_IF_NO_GLYPH is set, then\r | |
262 | characters which have no glyphs are not drawn. Otherwise, they\r | |
fbf926ad | 263 | are replaced with Unicode character code 0xFFFD (REPLACEMENT\r |
d1f95000 | 264 | CHARACTER). If EFI_HII_IGNORE_LINE_BREAK is set, then explicit\r |
265 | line break characters will be ignored. If\r | |
266 | EFI_HII_DIRECT_TO_SCREEN is set, then the string will be\r | |
267 | written directly to the output device specified by Screen.\r | |
268 | Otherwise the string will be rendered to the bitmap specified\r | |
269 | by Bitmap.\r | |
270 | \r | |
271 | \r | |
4ca9b6c4 | 272 | @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.\r |
d1f95000 | 273 | \r |
4ca9b6c4 | 274 | @param Flags Describes how the string is to be drawn.\r |
d1f95000 | 275 | \r |
9095d37b | 276 | @param PackageList\r |
4ca9b6c4 LG |
277 | The package list in the HII database to\r |
278 | search for the specified string.\r | |
d1f95000 | 279 | \r |
280 | @param StringId The string's id, which is unique within\r | |
281 | PackageList.\r | |
282 | \r | |
283 | @param Language Points to the language for the retrieved\r | |
284 | string. If NULL, then the current system\r | |
285 | language is used.\r | |
286 | \r | |
287 | @param StringInfo Points to the string output information,\r | |
288 | including the color and font. If NULL, then\r | |
289 | the string will be output in the default\r | |
290 | system font and color.\r | |
291 | \r | |
4ca9b6c4 LG |
292 | @param Blt If this points to a non-NULL on entry, this points\r |
293 | to the image, which is Width pixels wide and\r | |
294 | Height pixels high. The string will be drawn onto\r | |
295 | this image and EFI_HII_OUT_FLAG_CLIP is implied.\r | |
296 | If this points to a NULL on entry, then a buffer\r | |
297 | will be allocated to hold the generated image and\r | |
298 | the pointer updated on exit. It is the caller's\r | |
299 | responsibility to free this buffer.\r | |
d1f95000 | 300 | \r |
301 | @param BltX, BltY Specifies the offset from the left and top\r | |
302 | edge of the output image of the first\r | |
303 | character cell in the image.\r | |
304 | \r | |
4ca9b6c4 LG |
305 | @param RowInfoArray If this is non-NULL on entry, then on\r |
306 | exit, this will point to an allocated\r | |
307 | buffer containing row information and\r | |
308 | RowInfoArraySize will be updated to\r | |
309 | contain the number of elements. This array\r | |
310 | describes the characters which were at\r | |
311 | least partially drawn and the heights of\r | |
312 | the rows. It is the caller's\r | |
313 | responsibility to free this buffer.\r | |
d1f95000 | 314 | \r |
315 | @param RowInfoArraySize If this is non-NULL on entry, then on\r | |
316 | exit it contains the number of\r | |
317 | elements in RowInfoArray.\r | |
318 | \r | |
319 | @param ColumnInfoArray If non-NULL, on return it is filled\r | |
320 | with the horizontal offset for each\r | |
321 | character in the string on the row\r | |
322 | where it is displayed. Non-printing\r | |
323 | characters will have the offset ~0.\r | |
324 | The caller is responsible to allocate\r | |
325 | a buffer large enough so that there is\r | |
326 | one entry for each character in the\r | |
327 | string, not including the\r | |
328 | null-terminator. It is possible when\r | |
329 | character display is normalized that\r | |
330 | some character cells overlap.\r | |
331 | \r | |
332 | \r | |
4ca9b6c4 | 333 | @retval EFI_SUCCESS The string was successfully updated.\r |
d1f95000 | 334 | \r |
335 | @retval EFI_OUT_OF_RESOURCES Unable to allocate an output\r | |
336 | buffer for RowInfoArray or Blt.\r | |
337 | \r | |
af2dc6a7 | 338 | @retval EFI_INVALID_PARAMETER The String, or Blt, or Height, or\r |
d1f95000 | 339 | Width was NULL.\r |
54cf8780 | 340 | @retval EFI_INVALID_PARAMETER The Blt or PackageList was NULL.\r |
4ca9b6c4 | 341 | @retval EFI_INVALID_PARAMETER Flags were invalid combination.\r |
9095d37b LG |
342 | @retval EFI_NOT_FOUND The specified PackageList is not in the Database,\r |
343 | or the stringid is not in the specified PackageList.\r | |
d1f95000 | 344 | \r |
345 | **/\r | |
346 | typedef\r | |
347 | EFI_STATUS\r | |
8b13229b | 348 | (EFIAPI *EFI_HII_STRING_ID_TO_IMAGE)(\r |
d1f95000 | 349 | IN CONST EFI_HII_FONT_PROTOCOL *This,\r |
7d582d6b | 350 | IN EFI_HII_OUT_FLAGS Flags,\r |
351 | IN EFI_HII_HANDLE PackageList,\r | |
352 | IN EFI_STRING_ID StringId,\r | |
d1f95000 | 353 | IN CONST CHAR8 *Language,\r |
354 | IN CONST EFI_FONT_DISPLAY_INFO *StringInfo OPTIONAL,\r | |
355 | IN OUT EFI_IMAGE_OUTPUT **Blt,\r | |
7d582d6b | 356 | IN UINTN BltX,\r |
357 | IN UINTN BltY,\r | |
d1f95000 | 358 | OUT EFI_HII_ROW_INFO **RowInfoArray OPTIONAL,\r |
359 | OUT UINTN *RowInfoArraySize OPTIONAL,\r | |
360 | OUT UINTN *ColumnInfoArray OPTIONAL\r | |
361 | );\r | |
362 | \r | |
363 | \r | |
364 | /**\r | |
365 | \r | |
366 | Convert the glyph for a single character into a bitmap.\r | |
367 | \r | |
4ca9b6c4 | 368 | @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.\r |
d1f95000 | 369 | \r |
af2dc6a7 | 370 | @param Char The character to retrieve.\r |
d1f95000 | 371 | \r |
372 | @param StringInfo Points to the string font and color\r | |
373 | information or NULL if the string should use\r | |
374 | the default system font and color.\r | |
375 | \r | |
af2dc6a7 | 376 | @param Blt This must point to a NULL on entry. A buffer will\r |
4ca9b6c4 LG |
377 | be allocated to hold the output and the pointer\r |
378 | updated on exit. It is the caller's responsibility\r | |
379 | to free this buffer.\r | |
d1f95000 | 380 | \r |
af2dc6a7 | 381 | @param Baseline The number of pixels from the bottom of the bitmap\r |
4ca9b6c4 | 382 | to the baseline.\r |
d1f95000 | 383 | \r |
384 | \r | |
af2dc6a7 | 385 | @retval EFI_SUCCESS The glyph bitmap created.\r |
d1f95000 | 386 | \r |
4ca9b6c4 | 387 | @retval EFI_OUT_OF_RESOURCES Unable to allocate the output buffer Blt.\r |
d1f95000 | 388 | \r |
389 | @retval EFI_WARN_UNKNOWN_GLYPH The glyph was unknown and was\r | |
390 | replaced with the glyph for\r | |
fbf926ad | 391 | Unicode character code 0xFFFD.\r |
d1f95000 | 392 | \r |
af2dc6a7 | 393 | @retval EFI_INVALID_PARAMETER Blt is NULL, or Width is NULL, or\r |
4ca9b6c4 | 394 | Height is NULL\r |
d1f95000 | 395 | \r |
396 | \r | |
397 | **/\r | |
398 | typedef\r | |
399 | EFI_STATUS\r | |
8b13229b | 400 | (EFIAPI *EFI_HII_GET_GLYPH)(\r |
d1f95000 | 401 | IN CONST EFI_HII_FONT_PROTOCOL *This,\r |
402 | IN CONST CHAR16 Char,\r | |
403 | IN CONST EFI_FONT_DISPLAY_INFO *StringInfo,\r | |
404 | OUT EFI_IMAGE_OUTPUT **Blt,\r | |
405 | OUT UINTN *Baseline OPTIONAL\r | |
406 | );\r | |
407 | \r | |
408 | /**\r | |
409 | \r | |
410 | This function iterates through fonts which match the specified\r | |
411 | font, using the specified criteria. If String is non-NULL, then\r | |
412 | all of the characters in the string must exist in order for a\r | |
413 | candidate font to be returned.\r | |
414 | \r | |
4ca9b6c4 | 415 | @param This A pointer to the EFI_HII_FONT_PROTOCOL instance.\r |
d1f95000 | 416 | \r |
4ca9b6c4 LG |
417 | @param FontHandle On entry, points to the font handle returned\r |
418 | by a previous call to GetFontInfo() or NULL\r | |
419 | to start with the first font. On return,\r | |
420 | points to the returned font handle or points\r | |
421 | to NULL if there are no more matching fonts.\r | |
d1f95000 | 422 | \r |
4ca9b6c4 | 423 | @param StringInfoIn Upon entry, points to the font to return\r |
9095d37b | 424 | information about. If NULL, then the information\r |
af2dc6a7 | 425 | about the system default font will be returned.\r |
d1f95000 | 426 | \r |
5795218e ED |
427 | @param StringInfoOut Upon return, contains the matching font's information.\r |
428 | If NULL, then no information is returned. This buffer\r | |
429 | is allocated with a call to the Boot Service AllocatePool().\r | |
9095d37b | 430 | It is the caller's responsibility to call the Boot\r |
5795218e ED |
431 | Service FreePool() when the caller no longer requires\r |
432 | the contents of StringInfoOut.\r | |
d1f95000 | 433 | \r |
4ca9b6c4 LG |
434 | @param String Points to the string which will be tested to\r |
435 | determine if all characters are available. If\r | |
436 | NULL, then any font is acceptable.\r | |
9095d37b | 437 | \r |
4ca9b6c4 | 438 | @retval EFI_SUCCESS Matching font returned successfully.\r |
9095d37b | 439 | \r |
4ca9b6c4 | 440 | @retval EFI_NOT_FOUND No matching font was found.\r |
54cf8780 | 441 | \r |
442 | @retval EFI_OUT_OF_RESOURCES There were insufficient resources to complete the request.\r | |
9095d37b | 443 | \r |
d1f95000 | 444 | **/\r |
445 | typedef\r | |
446 | EFI_STATUS\r | |
8b13229b | 447 | (EFIAPI *EFI_HII_GET_FONT_INFO)(\r |
d1f95000 | 448 | IN CONST EFI_HII_FONT_PROTOCOL *This,\r |
449 | IN OUT EFI_FONT_HANDLE *FontHandle,\r | |
54cf8780 | 450 | IN CONST EFI_FONT_DISPLAY_INFO *StringInfoIn, OPTIONAL\r |
5a1fc221 | 451 | OUT EFI_FONT_DISPLAY_INFO **StringInfoOut,\r |
452 | IN CONST EFI_STRING String OPTIONAL\r | |
d1f95000 | 453 | );\r |
454 | \r | |
44717a39 | 455 | ///\r |
456 | /// The protocol provides the service to retrieve the font informations.\r | |
457 | ///\r | |
d1f95000 | 458 | struct _EFI_HII_FONT_PROTOCOL {\r |
459 | EFI_HII_STRING_TO_IMAGE StringToImage;\r | |
460 | EFI_HII_STRING_ID_TO_IMAGE StringIdToImage;\r | |
461 | EFI_HII_GET_GLYPH GetGlyph;\r | |
462 | EFI_HII_GET_FONT_INFO GetFontInfo;\r | |
463 | };\r | |
464 | \r | |
465 | extern EFI_GUID gEfiHiiFontProtocolGuid;\r | |
466 | \r | |
467 | \r | |
468 | #endif\r | |
469 | \r |