summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Universal/HiiDatabaseDxe
diff options
context:
space:
mode:
authorDandan Bi <dandan.bi@intel.com>2016-06-08 14:13:36 +0800
committerStar Zeng <star.zeng@intel.com>2016-06-15 10:52:42 +0800
commit8f88f023fc59961973bb1ef121c7bee7b0a61975 (patch)
tree87254711f0957239d60d13c7ab07d72f9e3a58f7 /MdeModulePkg/Universal/HiiDatabaseDxe
parent7e74fd570dd9f262c51994b4d256ced7ef41735d (diff)
downloadedk2-8f88f023fc59961973bb1ef121c7bee7b0a61975.tar.gz
edk2-8f88f023fc59961973bb1ef121c7bee7b0a61975.tar.bz2
edk2-8f88f023fc59961973bb1ef121c7bee7b0a61975.zip
MdeModulePkg/Database: Fix incorrect calculation of baseline in FontPackage
When adding font package, there exists the case that only have the EFI_HII_GIBT_GLYPH_DEFAULT or EFI_HII_GIBT_GLYPHS_DEFAULT glyph block and use the default cell info in font package fixed header. In this case, we can't get the correct baseline now. This patch is to fix this issue by recalculating the baseline when the glyph block type is EFI_HII_GIBT_GLYPH_DEFAULT or EFI_HII_GIBT_GLYPHS_DEFAULT. Cc: Liming Gao <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'MdeModulePkg/Universal/HiiDatabaseDxe')
-rw-r--r--MdeModulePkg/Universal/HiiDatabaseDxe/Font.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c b/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c
index 5ecd6bd4a1..7e5d3bdc71 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c
@@ -839,6 +839,14 @@ FindGlyphBlock (
if (EFI_ERROR (Status)) {
return Status;
}
+ if (CharValue == (CHAR16) (-1)) {
+ if (BaseLine < DefaultCell.Height + DefaultCell.OffsetY) {
+ BaseLine = (UINT16) (DefaultCell.Height + DefaultCell.OffsetY);
+ }
+ if (MinOffsetY > DefaultCell.OffsetY) {
+ MinOffsetY = DefaultCell.OffsetY;
+ }
+ }
BufferLen = BITMAP_LEN_1_BIT (DefaultCell.Width, DefaultCell.Height);
if (CharCurrent == CharValue) {
@@ -861,6 +869,14 @@ FindGlyphBlock (
if (EFI_ERROR (Status)) {
return Status;
}
+ if (CharValue == (CHAR16) (-1)) {
+ if (BaseLine < DefaultCell.Height + DefaultCell.OffsetY) {
+ BaseLine = (UINT16) (DefaultCell.Height + DefaultCell.OffsetY);
+ }
+ if (MinOffsetY > DefaultCell.OffsetY) {
+ MinOffsetY = DefaultCell.OffsetY;
+ }
+ }
BufferLen = BITMAP_LEN_1_BIT (DefaultCell.Width, DefaultCell.Height);
BlockPtr += sizeof (EFI_HII_GIBT_GLYPHS_DEFAULT_BLOCK) - sizeof (UINT8);
for (Index = 0; Index < Length16; Index++) {