+static VOID egPrepareFont() {
+ if (BaseFontImage == NULL) {
+ BaseFontImage = egPrepareEmbeddedImage(&egemb_font, TRUE);
+ }
+ if (BaseFontImage != NULL)
+ FontCellWidth = BaseFontImage->Width / FONT_NUM_CHARS;
+} // VOID egPrepareFont();
+
+UINTN egGetFontHeight(VOID) {
+ egPrepareFont();
+ return BaseFontImage->Height;
+} // UINTN egGetFontHeight()
+
+UINTN egGetFontCellWidth(VOID) {
+ return FontCellWidth;
+}
+
+UINTN egComputeTextWidth(IN CHAR16 *Text) {
+ UINTN Width = 0;
+
+ egPrepareFont();
+ if (Text != NULL)
+ Width = FontCellWidth * StrLen(Text);
+ return Width;
+} // UINTN egComputeTextWidth()
+