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