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