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. |
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), |
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 |