diff options
author | Dandan Bi <dandan.bi@intel.com> | 2016-06-08 14:13:36 +0800 |
---|---|---|
committer | Star Zeng <star.zeng@intel.com> | 2016-06-15 10:52:42 +0800 |
commit | 8f88f023fc59961973bb1ef121c7bee7b0a61975 (patch) | |
tree | 87254711f0957239d60d13c7ab07d72f9e3a58f7 /MdeModulePkg | |
parent | 7e74fd570dd9f262c51994b4d256ced7ef41735d (diff) | |
download | edk2-platforms-8f88f023fc59961973bb1ef121c7bee7b0a61975.tar.xz |
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')
-rw-r--r-- | MdeModulePkg/Universal/HiiDatabaseDxe/Font.c | 16 |
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++) {
|