Re: [edk2] [patch] MdeModulePkg/Database: Fix incorrect calculation of baseline in FontPackage

2016-06-14 Thread Gao, Liming
Reviewed-by: Liming Gao 

> -Original Message-
> From: Bi, Dandan
> Sent: Wednesday, June 08, 2016 3:39 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming ; Dong, Eric 
> Subject: [patch] MdeModulePkg/Database: Fix incorrect calculation of
> baseline in FontPackage
> 
> When adding font package, there exits 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 
> Cc: Eric Dong 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi 
> ---
>  MdeModulePkg/Universal/HiiDatabaseDxe/Font.c | 16 
>  1 file changed, 16 insertions(+)
> 
> diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c
> b/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c
> index 5ecd6bd..7e5d3bd 100644
> --- a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c
> +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c
> @@ -837,10 +837,18 @@ FindGlyphBlock (
>  case EFI_HII_GIBT_GLYPH_DEFAULT:
>Status = GetCell (CharCurrent, >GlyphInfoList,
> );
>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) {
>  return WriteOutputParam (
>   BlockPtr + sizeof (EFI_HII_GLYPH_BLOCK),
> @@ -859,10 +867,18 @@ FindGlyphBlock (
>CopyMem (, BlockPtr + sizeof (EFI_HII_GLYPH_BLOCK), sizeof
> (UINT16));
>Status = GetCell (CharCurrent, >GlyphInfoList,
> );
>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++) {
>  if (CharCurrent + Index == CharValue) {
>return WriteOutputParam (
> --
> 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [patch] MdeModulePkg/Database: Fix incorrect calculation of baseline in FontPackage

2016-06-12 Thread Dong, Eric
Reviewed-by: Eric Dong 

> -Original Message-
> From: Bi, Dandan
> Sent: Wednesday, June 08, 2016 3:39 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming; Dong, Eric
> Subject: [patch] MdeModulePkg/Database: Fix incorrect calculation of baseline 
> in FontPackage
> 
> When adding font package, there exits 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 
> Cc: Eric Dong 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi 
> ---
>  MdeModulePkg/Universal/HiiDatabaseDxe/Font.c | 16 
>  1 file changed, 16 insertions(+)
> 
> diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c 
> b/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c
> index 5ecd6bd..7e5d3bd 100644
> --- a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c
> +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c
> @@ -837,10 +837,18 @@ FindGlyphBlock (
>  case EFI_HII_GIBT_GLYPH_DEFAULT:
>Status = GetCell (CharCurrent, >GlyphInfoList, 
> );
>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) {
>  return WriteOutputParam (
>   BlockPtr + sizeof (EFI_HII_GLYPH_BLOCK),
> @@ -859,10 +867,18 @@ FindGlyphBlock (
>CopyMem (, BlockPtr + sizeof (EFI_HII_GLYPH_BLOCK), sizeof 
> (UINT16));
>Status = GetCell (CharCurrent, >GlyphInfoList, 
> );
>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++) {
>  if (CharCurrent + Index == CharValue) {
>return WriteOutputParam (
> --
> 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [patch] MdeModulePkg/Database: Fix incorrect calculation of baseline in FontPackage

2016-06-08 Thread Dandan Bi
When adding font package, there exits 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 
Cc: Eric Dong 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi 
---
 MdeModulePkg/Universal/HiiDatabaseDxe/Font.c | 16 
 1 file changed, 16 insertions(+)

diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c 
b/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c
index 5ecd6bd..7e5d3bd 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c
@@ -837,10 +837,18 @@ FindGlyphBlock (
 case EFI_HII_GIBT_GLYPH_DEFAULT:
   Status = GetCell (CharCurrent, >GlyphInfoList, 
);
   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) {
 return WriteOutputParam (
  BlockPtr + sizeof (EFI_HII_GLYPH_BLOCK),
@@ -859,10 +867,18 @@ FindGlyphBlock (
   CopyMem (, BlockPtr + sizeof (EFI_HII_GLYPH_BLOCK), sizeof 
(UINT16));
   Status = GetCell (CharCurrent, >GlyphInfoList, 
);
   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++) {
 if (CharCurrent + Index == CharValue) {
   return WriteOutputParam (
-- 
1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel