/[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.140 by olvaffe, Mon Jun 20 09:04:50 2005 UTC revision 1.141 by freetype, Thu Jun 30 11:46:46 2005 UTC
# Line 124  Line 124 
124        p      = face->horz_metrics;        p      = face->horz_metrics;
125        limit  = p + face->horz_metrics_size;        limit  = p + face->horz_metrics_size;
126      }      }
127        
128      k = header->number_Of_HMetrics;      k = header->number_Of_HMetrics;
129        
130      if ( k > 0 )      if ( k > 0 )
131      {      {
132        if ( idx < (FT_UInt)k )        if ( idx < (FT_UInt)k )
# Line 134  Line 134 
134          p += 4 * idx;          p += 4 * idx;
135          if ( p + 4 > limit )          if ( p + 4 > limit )
136            goto NoData;            goto NoData;
137              
138          *aadvance = FT_NEXT_USHORT( p );          *aadvance = FT_NEXT_USHORT( p );
139          *abearing = FT_NEXT_SHORT( p );          *abearing = FT_NEXT_SHORT( p );
140        }        }
# Line 143  Line 143 
143          p += 4 * ( k - 1 );          p += 4 * ( k - 1 );
144          if ( p + 4 > limit )          if ( p + 4 > limit )
145            goto NoData;            goto NoData;
146              
147          *aadvance = FT_NEXT_USHORT( p );          *aadvance = FT_NEXT_USHORT( p );
148          p += 2 + 2 * ( idx - k );          p += 2 + 2 * ( idx - k );
149          if ( p + 2 > limit )          if ( p + 2 > limit )
# Line 233  Line 233 
233      FT_Byte*  result      = NULL;      FT_Byte*  result      = NULL;
234      FT_ULong  record_size = face->hdmx_record_size;      FT_ULong  record_size = face->hdmx_record_size;
235      FT_Byte*  record      = face->hdmx_table + 8;      FT_Byte*  record      = face->hdmx_table + 8;
236        
237    
238      for ( nn = 0; nn < face->hdmx_record_count; nn++ )      for ( nn = 0; nn < face->hdmx_record_count; nn++ )
239        if ( face->hdmx_record_sizes[nn] == ppem )        if ( face->hdmx_record_sizes[nn] == ppem )
# Line 1774  Line 1774 
1774          /*       table in the font.  Otherwise, we use the     */          /*       table in the font.  Otherwise, we use the     */
1775          /*       values defined in the horizontal header.      */          /*       values defined in the horizontal header.      */
1776    
1777          height = FT_DivFix( bbox.yMax - bbox.yMin, y_scale );          height = (FT_Short)FT_DivFix( bbox.yMax - bbox.yMin, y_scale );
1778          if ( face->os2.version != 0xFFFFU )          if ( face->os2.version != 0xFFFFU )
1779          {          {
1780            /* sTypoDescender is negative */            /* sTypoDescender is negative */
1781            max_height = face->os2.sTypoAscender - face->os2.sTypoDescender;            max_height     = (FT_Short)(face->os2.sTypoAscender -
1782                                          face->os2.sTypoDescender);
1783    
1784            top_bearing    = (FT_Short)( ( max_height - height ) / 2 );            top_bearing    = (FT_Short)( ( max_height - height ) / 2 );
1785            advance_height = (FT_UShort)( max_height + face->os2.sTypoLineGap );            advance_height = (FT_UShort)( max_height + face->os2.sTypoLineGap );
1786          }          }
1787          else          else
1788          {          {
1789            max_height = face->horizontal.Ascender + face->horizontal.Descender;            max_height = (FT_Short)(face->horizontal.Ascender +
1790                                      face->horizontal.Descender);
1791    
1792            top_bearing    = (FT_Short)( ( max_height - height ) / 2 );            top_bearing    = (FT_Short)( ( max_height - height ) / 2 );
1793            advance_height = (FT_UShort)( max_height +            advance_height = (FT_UShort)( max_height +

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

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