/[hegemonie]/hegemonie/Interface/UiText.m
ViewVC logotype

Diff of /hegemonie/Interface/UiText.m

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

revision 1.4 by dam, Thu May 29 22:09:48 2003 UTC revision 1.5 by dam, Tue Jun 3 23:19:58 2003 UTC
# Line 132  static FT_Face _face; Line 132  static FT_Face _face;
132      }        }  
133  }  }
134    
135    + (id) textWithText: (NSString *)text
136                 height: (unsigned)height
137    {
138      return AUTORELEASE([[self alloc] initWithText: text
139                                             height: height]);
140    }
141    
142  /**  /**
143   * Initialise the glyphes array with text, storring the glyph for each   * Initialise the glyphes array with text, storring the glyph for each
144   * character.   * character.
# Line 258  _map_texture (const FT_Bitmap *bitmap) Line 265  _map_texture (const FT_Bitmap *bitmap)
265    NSCParameterAssert (bitmap->width == bitmap->pitch); /* FIXME */    NSCParameterAssert (bitmap->width == bitmap->pitch); /* FIXME */
266    
267    glPixelStorei (GL_UNPACK_ALIGNMENT, 1);    glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
268    glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);    glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
269    
270    glTexImage2D (GL_TEXTURE_2D, 0, GL_ALPHA,    glTexImage2D (GL_TEXTURE_2D, 0, GL_ALPHA,
271                  _texture_size (bitmap->width),                  _texture_size (bitmap->width),
# Line 358  _draw_bitmap (const FT_Bitmap *bitmap, F Line 365  _draw_bitmap (const FT_Bitmap *bitmap, F
365        bbox.yMax = MAX(bbox.yMax, glyph_bbox.yMax);        bbox.yMax = MAX(bbox.yMax, glyph_bbox.yMax);
366      }      }
367        
368    NSParameterAssert (bbox.xMin == 0);    // NSParameterAssert (bbox.xMin == 0);
369    NSParameterAssert (bbox.yMin == 0);    // NSParameterAssert (bbox.yMin == 0);
370    
371    return NSMakeSize ((bbox.xMax - bbox.xMin),    return NSMakeSize ((bbox.xMax - bbox.xMin) >> 6,
372                       (bbox.yMax - bbox.yMin));                       (bbox.yMax - bbox.yMin) >> 6);
373  }  }
374    
375  @end  @end

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

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