[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freetype2] parthw-cleaned 9359a77: [gf] Fix gf_free_font function error
From: |
Parth Wazurkar |
Subject: |
[freetype2] parthw-cleaned 9359a77: [gf] Fix gf_free_font function errors. |
Date: |
Tue, 10 Jul 2018 04:44:12 -0400 (EDT) |
branch: parthw-cleaned
commit 9359a77be58978d558f94a7e66614a816688c477
Author: Parth Wazurkar <address@hidden>
Commit: Parth Wazurkar <address@hidden>
[gf] Fix gf_free_font function errors.
* src/gf/gflib.c (gf_free_font): Fix errors in gf_free_font
function.
* src/gf/gfdrir.c (GF_Glyph_Load): Improve slot metric
values.
---
src/gf/gfdrivr.c | 13 ++++++++-----
src/gf/gflib.c | 23 +++++++++++++----------
2 files changed, 21 insertions(+), 15 deletions(-)
diff --git a/src/gf/gfdrivr.c b/src/gf/gfdrivr.c
index cc2aa95..6ce8665 100644
--- a/src/gf/gfdrivr.c
+++ b/src/gf/gfdrivr.c
@@ -133,8 +133,8 @@
FT_CALLBACK_DEF( void )
GF_Face_Done( FT_Face gfface ) /* GF_Face */
{
- GF_Face face = (GF_Face)gfface;
- FT_Memory memory= FT_FACE_MEMORY( gfface );
+ GF_Face face = (GF_Face)gfface;
+ FT_Memory memory;
if ( !face )
@@ -142,7 +142,10 @@
memory = FT_FACE_MEMORY( face );
- gf_free_font( gfface, memory );
+ /*gf_free_font( face );*/
+
+ /*FT_FREE( gfface->available_sizes );*/
+
}
@@ -409,8 +412,8 @@
slot->bitmap_left = bm.off_x / go->hppp;
slot->bitmap_top = ascent ;
- slot->metrics.horiAdvance = (FT_Pos) bm.mv_x * 64;
- slot->metrics.horiBearingX = (FT_Pos) bm.off_x * 64;
+ slot->metrics.horiAdvance = (FT_Pos) (bm.mv_x / go->hppp) * 64;
+ slot->metrics.horiBearingX = (FT_Pos) (bm.off_x / go->hppp) * 64;
slot->metrics.horiBearingY = (FT_Pos) ascent * 64;
slot->metrics.width = (FT_Pos) ( bitmap->width * 64 );
slot->metrics.height = (FT_Pos) ( bitmap->rows * 64 );
diff --git a/src/gf/gflib.c b/src/gf/gflib.c
index ff6fe90..c425401 100644
--- a/src/gf/gflib.c
+++ b/src/gf/gflib.c
@@ -133,7 +133,6 @@ unsigned char bit_table[] = {
min_n = READ_INT4( stream );
max_n = READ_INT4( stream );
break;
-
case GF_BOC1:
if ( FT_STREAM_SKIP( 1 ) )
return -1;
@@ -144,7 +143,6 @@ unsigned char bit_table[] = {
min_m = max_m - del_m;
min_n = max_n - del_n;
break;
-
default:
return -1;
}
@@ -489,7 +487,6 @@ unsigned char bit_table[] = {
return error;
Exit:
- printf("*ERROR\n");
if (go != NULL)
{
FT_FREE(go->bm_table);
@@ -500,16 +497,22 @@ unsigned char bit_table[] = {
FT_LOCAL_DEF( void )
- gf_free_font( FT_Face gfface, FT_Memory memory )
+ gf_free_font( GF_Face face )
{
- GF_Face gf = (GF_Face)gfface;
- GF_Glyph go;
- go = gf->gf_glyph;
- if (go != NULL)
+ FT_Memory memory = FT_FACE( face )->memory;
+ GF_Glyph go = face->gf_glyph;
+ FT_UInt nchars = FT_FACE( face )->num_glyphs,i;
+
+ if ( !go )
+ return;
+
+ if( go->bm_table )
{
- FT_FREE(go->bm_table);
- FT_FREE(go);
+ for (i = 0; i < nchars; i++)
+ FT_FREE(go->bm_table[i].bitmap);
}
+ FT_FREE(go->bm_table);
+ FT_FREE(go);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freetype2] parthw-cleaned 9359a77: [gf] Fix gf_free_font function errors.,
Parth Wazurkar <=