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