/[freetype]/freetype2/src/sfnt/ttsbit.c
ViewVC logotype

Diff of /freetype2/src/sfnt/ttsbit.c

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

revision 1.61 by freetype, Sat Feb 26 00:12:04 2005 UTC revision 1.62 by freetype, Mon Feb 28 22:09:07 2005 UTC
# Line 15  Line 15 
15  /*                                                                         */  /*                                                                         */
16  /***************************************************************************/  /***************************************************************************/
17    
18    #include <ft2build.h>
19    #include FT_INTERNAL_DEBUG_H
20    #include FT_INTERNAL_STREAM_H
21    #include FT_TRUETYPE_TAGS_H
22    
23    #ifdef FT_OPTIMIZE_MEMORY
24    #include "ttsbit0.c"
25    #else /* !OPTIMIZE_MEMORY */
26    
27  #include <ft2build.h>  #include <ft2build.h>
28  #include FT_INTERNAL_DEBUG_H  #include FT_INTERNAL_DEBUG_H
# Line 407  Line 415 
415      FT_ULong   num_strikes;      FT_ULong   num_strikes;
416      FT_ULong   table_base;      FT_ULong   table_base;
417    
418      const FT_Frame_Field  sbit_line_metrics_fields[] =      static const FT_Frame_Field  sbit_line_metrics_fields[] =
419      {      {
420  #undef  FT_STRUCTURE  #undef  FT_STRUCTURE
421  #define FT_STRUCTURE  TT_SBit_LineMetricsRec  #define FT_STRUCTURE  TT_SBit_LineMetricsRec
# Line 430  Line 438 
438        FT_FRAME_END        FT_FRAME_END
439      };      };
440    
441      const FT_Frame_Field  strike_start_fields[] =      static const FT_Frame_Field  strike_start_fields[] =
442      {      {
443  #undef  FT_STRUCTURE  #undef  FT_STRUCTURE
444  #define FT_STRUCTURE  TT_SBit_StrikeRec  #define FT_STRUCTURE  TT_SBit_StrikeRec
# Line 443  Line 451 
451        FT_FRAME_END        FT_FRAME_END
452      };      };
453    
454      const FT_Frame_Field  strike_end_fields[] =      static const FT_Frame_Field  strike_end_fields[] =
455      {      {
456        /* no FT_FRAME_START */        /* no FT_FRAME_START */
457          FT_FRAME_USHORT( start_glyph ),          FT_FRAME_USHORT( start_glyph ),
# Line 576  Line 584 
584        }        }
585      }      }
586    
587       /* now set up the root fields to indicate the strikes
588        */
589        if ( face->num_sbit_strikes )
590        {
591          FT_ULong  n;
592          FT_Face   root = FT_FACE(face);
593    
594    
595          if ( FT_NEW_ARRAY( root->available_sizes, face->num_sbit_strikes ) )
596            goto Exit;
597    
598          for ( n = 0 ; n < face->num_sbit_strikes ; n++ )
599          {
600            FT_Bitmap_Size*  bsize  = root->available_sizes + n;
601            TT_SBit_Strike   strike = face->sbit_strikes + n;
602            FT_UShort        fupem  = face->header.Units_Per_EM;
603            FT_Short         height = (FT_Short)( face->horizontal.Ascender -
604                                                  face->horizontal.Descender +
605                                                  face->horizontal.Line_Gap );
606            FT_Short         avg    = face->os2.xAvgCharWidth;
607    
608    
609            /* assume 72dpi */
610            bsize->height =
611              (FT_Short)( ( height * strike->y_ppem + fupem/2 ) / fupem );
612            bsize->width  =
613              (FT_Short)( ( avg * strike->y_ppem + fupem/2 ) / fupem );
614            bsize->size   = strike->y_ppem << 6;
615            bsize->x_ppem = strike->x_ppem << 6;
616            bsize->y_ppem = strike->y_ppem << 6;
617          }
618    
619          root->face_flags     |= FT_FACE_FLAG_FIXED_SIZES;
620          root->num_fixed_sizes = (FT_Int)face->num_sbit_strikes;
621        }
622    
623    Exit:    Exit:
624      return error;      return error;
625    }    }
# Line 1472  Line 1516 
1516    
1517    
1518  /* END */  /* END */
1519    #endif /* !OPTIMIZE_MEMORY */

Legend:
Removed from v.1.61  
changed lines
  Added in v.1.62

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