Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Borghetti <bdiego@gmail.com>2009-05-08 23:47:40 +0400
committerDiego Borghetti <bdiego@gmail.com>2009-05-08 23:47:40 +0400
commit749a9083318f7d59999c1f3ce891db658e089772 (patch)
tree75d46fa3b25eaf162b81b1aeec0002ae1b59ef22 /source/blender/blenfont/intern/blf_glyph.c
parentbf2daa56c1a08f80176f5e817c3bc3c0e5749ba3 (diff)
Cleanup blendfont.
Now that we only work with Freetype2, I don't see any point to keep wrapping the functions. Also remove the reference code, it's something that we don't go to used.
Diffstat (limited to 'source/blender/blenfont/intern/blf_glyph.c')
-rw-r--r--source/blender/blenfont/intern/blf_glyph.c40
1 files changed, 17 insertions, 23 deletions
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c
index 551db2cdaa9..142d2145ab2 100644
--- a/source/blender/blenfont/intern/blf_glyph.c
+++ b/source/blender/blenfont/intern/blf_glyph.c
@@ -72,10 +72,8 @@ GlyphCacheBLF *blf_glyph_cache_find(FontBLF *font, int size, int dpi)
GlyphCacheBLF *blf_glyph_cache_new(FontBLF *font)
{
GlyphCacheBLF *gc;
- FT_Face face;
int i;
- face= (FT_Face)font->engine;
gc= (GlyphCacheBLF *)MEM_mallocN(sizeof(GlyphCacheBLF), "blf_glyph_cache_new");
gc->next= NULL;
gc->prev= NULL;
@@ -94,23 +92,23 @@ GlyphCacheBLF *blf_glyph_cache_new(FontBLF *font)
gc->y_offs= 0;
gc->pad= 3;
- gc->num_glyphs= face->num_glyphs;
- gc->rem_glyphs= face->num_glyphs;
- gc->ascender= ((float)face->size->metrics.ascender) / 64.0f;
- gc->descender= ((float)face->size->metrics.descender) / 64.0f;
+ gc->num_glyphs= font->face->num_glyphs;
+ gc->rem_glyphs= font->face->num_glyphs;
+ gc->ascender= ((float)font->face->size->metrics.ascender) / 64.0f;
+ gc->descender= ((float)font->face->size->metrics.descender) / 64.0f;
- if (FT_IS_SCALABLE(face)) {
- gc->max_glyph_width= (float)((face->bbox.xMax - face->bbox.xMin) *
- (((float)face->size->metrics.x_ppem) /
- ((float)face->units_per_EM)));
+ if (FT_IS_SCALABLE(font->face)) {
+ gc->max_glyph_width= (float)((font->face->bbox.xMax - font->face->bbox.xMin) *
+ (((float)font->face->size->metrics.x_ppem) /
+ ((float)font->face->units_per_EM)));
- gc->max_glyph_height= (float)((face->bbox.yMax - face->bbox.yMin) *
- (((float)face->size->metrics.y_ppem) /
- ((float)face->units_per_EM)));
+ gc->max_glyph_height= (float)((font->face->bbox.yMax - font->face->bbox.yMin) *
+ (((float)font->face->size->metrics.y_ppem) /
+ ((float)font->face->units_per_EM)));
}
else {
- gc->max_glyph_width= ((float)face->size->metrics.max_advance) / 64.0f;
- gc->max_glyph_height= ((float)face->size->metrics.height) / 64.0f;
+ gc->max_glyph_width= ((float)font->face->size->metrics.max_advance) / 64.0f;
+ gc->max_glyph_height= ((float)font->face->size->metrics.height) / 64.0f;
}
gc->p2_width= 0;
@@ -197,7 +195,6 @@ GlyphBLF *blf_glyph_texture_add(FontBLF *font, FT_UInt index, unsigned int c)
GlyphCacheBLF *gc;
GlyphBLF *g;
GlyphTextureBLF *gt;
- FT_Face face;
FT_Error err;
FT_Bitmap bitmap;
FT_BBox bbox;
@@ -216,13 +213,12 @@ GlyphBLF *blf_glyph_texture_add(FontBLF *font, FT_UInt index, unsigned int c)
else
do_new= 1;
- face= (FT_Face)font->engine;
- err= FT_Load_Glyph(face, index, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP);
+ err= FT_Load_Glyph(font->face, index, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP);
if (err)
return(NULL);
/* get the glyph. */
- slot= face->glyph;
+ slot= font->face->glyph;
err= FT_Render_Glyph(slot, FT_RENDER_MODE_NORMAL);
if (err || slot->format != FT_GLYPH_FORMAT_BITMAP)
@@ -311,7 +307,6 @@ GlyphBLF *blf_glyph_bitmap_add(FontBLF *font, FT_UInt index, unsigned int c)
GlyphCacheBLF *gc;
GlyphBLF *g;
GlyphBitmapBLF *gt;
- FT_Face face;
FT_Error err;
FT_Bitmap bitmap;
FT_BBox bbox;
@@ -333,13 +328,12 @@ GlyphBLF *blf_glyph_bitmap_add(FontBLF *font, FT_UInt index, unsigned int c)
else
do_new= 1;
- face= (FT_Face)font->engine;
- err= FT_Load_Glyph(face, index, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP);
+ err= FT_Load_Glyph(font->face, index, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP);
if (err)
return(NULL);
/* get the glyph. */
- slot= face->glyph;
+ slot= font->face->glyph;
err= FT_Render_Glyph(slot, FT_RENDER_MODE_MONO);
if (err || slot->format != FT_GLYPH_FORMAT_BITMAP)