/[freetype]/freetype2/src/base/ftsynth.c
ViewVC logotype

Diff of /freetype2/src/base/ftsynth.c

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

revision 1.24 by wl, Wed May 25 05:51:01 2005 UTC revision 1.25 by wl, Thu May 26 21:02:25 2005 UTC
# Line 23  Line 23 
23  #include FT_BITMAP_H  #include FT_BITMAP_H
24    
25    
 #define FT_BOLD_THRESHOLD  0x0100  
   
   
26    /*************************************************************************/    /*************************************************************************/
27    /*************************************************************************/    /*************************************************************************/
28    /****                                                                 ****/    /****                                                                 ****/
# Line 90  Line 87 
87      if ( slot->format == FT_GLYPH_FORMAT_OUTLINE )      if ( slot->format == FT_GLYPH_FORMAT_OUTLINE )
88      {      {
89        error = FT_Outline_Embolden( &slot->outline, xstr );        error = FT_Outline_Embolden( &slot->outline, xstr );
90        xstr = ( xstr * 4 ) & ~63;        xstr = xstr * 4 ; /* according to the documentation */
91        ystr = xstr;        ystr = xstr;
92      }      }
93      else if ( slot->format == FT_GLYPH_FORMAT_BITMAP )      else if ( slot->format == FT_GLYPH_FORMAT_BITMAP )
# Line 100  Line 97 
97          xstr = 1 << 6;          xstr = 1 << 6;
98        ystr = FT_PIX_FLOOR( ystr );        ystr = FT_PIX_FLOOR( ystr );
99    
100        error = FT_Bitmap_Embolden( library, &slot->bitmap, xstr, ystr );        /* slot must be bitmap-owner */
101          if ( !( slot->internal->flags & FT_GLYPH_OWN_BITMAP ) )
102          {
103            FT_Bitmap  bitmap;
104    
105    
106            FT_Bitmap_New( &bitmap );
107            error = FT_Bitmap_Copy( library, &slot->bitmap, &bitmap );
108    
109            if ( !error )
110            {
111              slot->bitmap = bitmap;
112              slot->internal->flags |= FT_GLYPH_OWN_BITMAP;
113            }
114          }
115    
       /* XXX should we set these? */  
116        if ( !error )        if ( !error )
117          slot->bitmap_top += ystr >> 6;          error = FT_Bitmap_Embolden( library, &slot->bitmap, xstr, ystr );
118      }      }
119      else      else
120        error = FT_Err_Invalid_Argument;        error = FT_Err_Invalid_Argument;
121    
122      /* XXX should we set these? */      /* modify the metrics accordingly */
123      if ( !error )      if ( !error )
124      {      {
 #if 0  
       slot->advance.x            += xstr;  
125        slot->metrics.width        += xstr;        slot->metrics.width        += xstr;
126        slot->metrics.height       += ystr;        slot->metrics.height       += ystr;
127        slot->metrics.horiBearingY += ystr;        slot->metrics.horiBearingY += ystr;
 #endif  
128        slot->metrics.horiAdvance  += xstr;        slot->metrics.horiAdvance  += xstr;
129          slot->metrics.vertBearingX -= xstr / 2;
130          slot->metrics.vertBearingY += ystr;
131          slot->metrics.vertAdvance  += ystr;
132    
133          if ( slot->format == FT_GLYPH_FORMAT_BITMAP )
134            slot->bitmap_top += ystr >> 6;
135      }      }
136    }    }
137    

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25

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