]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/Database: Fix incorrect calculation of baseline in FontPackage
authorDandan Bi <dandan.bi@intel.com>
Wed, 8 Jun 2016 06:13:36 +0000 (14:13 +0800)
committerStar Zeng <star.zeng@intel.com>
Wed, 15 Jun 2016 02:52:42 +0000 (10:52 +0800)
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>
MdeModulePkg/Universal/HiiDatabaseDxe/Font.c

index 5ecd6bd4a1e4f0d32e9c857a8451c7d7660b5824..7e5d3bdc714af2de8c766fa7c5ba9de2a0581432 100644 (file)
@@ -839,6 +839,14 @@ FindGlyphBlock (
       if (EFI_ERROR (Status)) {\r
         return Status;\r
       }\r
+      if (CharValue == (CHAR16) (-1)) {\r
+        if (BaseLine < DefaultCell.Height + DefaultCell.OffsetY) {\r
+          BaseLine = (UINT16) (DefaultCell.Height + DefaultCell.OffsetY);\r
+        }\r
+        if (MinOffsetY > DefaultCell.OffsetY) {\r
+          MinOffsetY = DefaultCell.OffsetY;\r
+        }\r
+      }\r
       BufferLen = BITMAP_LEN_1_BIT (DefaultCell.Width, DefaultCell.Height);\r
 \r
       if (CharCurrent == CharValue) {\r
@@ -861,6 +869,14 @@ FindGlyphBlock (
       if (EFI_ERROR (Status)) {\r
         return Status;\r
       }\r
+      if (CharValue == (CHAR16) (-1)) {\r
+        if (BaseLine < DefaultCell.Height + DefaultCell.OffsetY) {\r
+          BaseLine = (UINT16) (DefaultCell.Height + DefaultCell.OffsetY);\r
+        }\r
+        if (MinOffsetY > DefaultCell.OffsetY) {\r
+          MinOffsetY = DefaultCell.OffsetY;\r
+        }\r
+      }\r
       BufferLen = BITMAP_LEN_1_BIT (DefaultCell.Width, DefaultCell.Height);\r
       BlockPtr += sizeof (EFI_HII_GIBT_GLYPHS_DEFAULT_BLOCK) - sizeof (UINT8);\r
       for (Index = 0; Index < Length16; Index++) {\r