[Gs-code-review] Fix for #510776 "Underlines appear above text" (improved 2)

Igor V. Melichev igor at artifex.com
Wed Feb 13 13:59:02 PST 2002


This is post-commit submission.
The last patch to gs_type1.ps caused a regression.
I've removed the revision 1.8 and committed the improved patch.

Igor.

[Log message beg]
Fix: A stronger condition for checking FontBBox validness
while computing default values for UndrelinePosition and UnderlineThickness.
Source Forge bug #510776 "Underlines appear above text".
[Log message end]

Changes:


File gs_type1.ps :

*** F:\CVSroot\head\gs\lib\gs_type1.ps	Thu Feb 14 00:51:27 2002
--- files\gs\lib\gs_type1.ps	Thu Feb 14 00:53:12 2002
***************
*** 16,20 ****
  % copies.

! % $Id: gs_type1.ps,v 1.7 2001/12/08 11:31:20 igorm Exp $
  % Type 1 font support code.

--- 16,20 ----
  % copies.

! % $Id: gs_type1.ps,v 1.7 2002/02/12 03:50:23 igorm Exp $
  % Type 1 font support code.

***************
*** 29,36 ****
  /.buildfont1
   {
!    false 1 index /FontBBox .knownget {
!      { 0 ne { not exit } if } forall
!    } if
!    { dup /FontInfo known not
        { .growfontdict dup /FontInfo 2 dict put }
       if
--- 29,35 ----
  /.buildfont1
   {
!    dup .fontbbox {
!      pop pop pop pop
!      dup /FontInfo known not
        { .growfontdict dup /FontInfo 2 dict put }
       if
***************
*** 41,53 ****
        { dup length 2 add dict .copydict
          dup /UnderlinePosition known not
!          { dup /UnderlinePosition 3 index /FontBBox .knownget
!             { 1 get 2 div }			% 1/2 the font descent
! 	    { -100 } ifelse put
           }
          if
          dup /UnderlineThickness known not
!          { dup /UnderlineThickness 3 index /FontBBox .knownget
!             { dup 3 get exch 1 get sub 20 div }	% 1/20 the font height
!     	    { 50 } ifelse put
           }
          if
--- 40,50 ----
        { dup length 2 add dict .copydict
          dup /UnderlinePosition known not
!          { dup /UnderlinePosition 3 index /FontBBox get
!            1 get 2 div put 			% 1/2 the font descent
           }
          if
          dup /UnderlineThickness known not
!          { dup /UnderlineThickness 3 index /FontBBox get
!            dup 3 get exch 1 get sub 20 div put 	% 1/20 the font height
           }
          if




More information about the gs-code-review mailing list