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