/[freetype]/freetype2/src/truetype/ttgload.c
ViewVC logotype

Diff of /freetype2/src/truetype/ttgload.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.139 by wl, Thu Jun 16 19:07:08 2005 UTC revision 1.140 by olvaffe, Mon Jun 20 09:04:50 2005 UTC
# Line 1707  Line 1707 
1707        FT_Outline_Translate( &glyph->outline, -loader->pp1.x, 0 );        FT_Outline_Translate( &glyph->outline, -loader->pp1.x, 0 );
1708    
1709        FT_Outline_Get_CBox( &glyph->outline, &bbox );        FT_Outline_Get_CBox( &glyph->outline, &bbox );
   
       if ( IS_HINTED( loader->load_flags ) )  
       {  
         /* grid-fit the bounding box */  
         bbox.xMin = FT_PIX_FLOOR( bbox.xMin );  
         bbox.yMin = FT_PIX_FLOOR( bbox.yMin );  
         bbox.xMax = FT_PIX_CEIL( bbox.xMax );  
         bbox.yMax = FT_PIX_CEIL( bbox.yMax );  
       }  
1710      }      }
1711      else      else
1712        bbox = loader->bbox;        bbox = loader->bbox;
# Line 1744  Line 1735 
1735      glyph->metrics.horiBearingY = bbox.yMax;      glyph->metrics.horiBearingY = bbox.yMax;
1736      glyph->metrics.horiAdvance  = loader->pp2.x - loader->pp1.x;      glyph->metrics.horiAdvance  = loader->pp2.x - loader->pp1.x;
1737    
     /* don't forget to hint the advance when we need to */  
     if ( IS_HINTED( loader->load_flags ) )  
       glyph->metrics.horiAdvance = FT_PIX_ROUND( glyph->metrics.horiAdvance );  
   
1738      /* Now take care of vertical metrics.  In the case where there is    */      /* Now take care of vertical metrics.  In the case where there is    */
1739      /* no vertical information within the font (relatively common), make */      /* no vertical information within the font (relatively common), make */
1740      /* up some metrics by `hand'...                                      */      /* up some metrics by `hand'...                                      */
# Line 1857  Line 1844 
1844        /*                                                               */        /*                                                               */
1845        left = ( bbox.xMin - bbox.xMax ) / 2;        left = ( bbox.xMin - bbox.xMax ) / 2;
1846    
       /* grid-fit them if necessary */  
       if ( IS_HINTED( loader->load_flags ) )  
       {  
         left    = FT_PIX_FLOOR( left );  
         /* top should be floor'ed */  
         top     = FT_PIX_FLOOR( top );  
         advance = FT_PIX_ROUND( advance );  
       }  
   
1847        glyph->metrics.vertBearingX = left;        glyph->metrics.vertBearingX = left;
1848        glyph->metrics.vertBearingY = top;        glyph->metrics.vertBearingY = top;
1849        glyph->metrics.vertAdvance  = advance;        glyph->metrics.vertAdvance  = advance;
# Line 1888  Line 1866 
1866      glyph->metrics.width  = bbox.xMax - bbox.xMin;      glyph->metrics.width  = bbox.xMax - bbox.xMin;
1867      glyph->metrics.height = bbox.yMax - bbox.yMin;      glyph->metrics.height = bbox.yMax - bbox.yMin;
1868    
1869        if ( IS_HINTED( loader->load_flags ) )
1870          ft_glyphslot_grid_fit_metrics( glyph );
1871    
1872      return 0;      return 0;
1873    }    }
1874    

Legend:
Removed from v.1.139  
changed lines
  Added in v.1.140

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26