freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] parthw-cleaned 8302c96 41/42: [gf] Improve data types of som


From: Parth Wazurkar
Subject: [freetype2] parthw-cleaned 8302c96 41/42: [gf] Improve data types of some variables.
Date: Mon, 30 Jul 2018 14:20:06 -0400 (EDT)

branch: parthw-cleaned
commit 8302c96c83be7b750d6080741448d0e26ab6efaa
Author: Parth Wazurkar <address@hidden>
Commit: Parth Wazurkar <address@hidden>

    [gf] Improve data types of some variables.
---
 include/freetype/internal/tfm.h | 9 ++++-----
 src/gf/gfdrivr.h                | 2 +-
 src/gf/gflib.c                  | 6 +++---
 3 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/include/freetype/internal/tfm.h b/include/freetype/internal/tfm.h
index 7289e67..895786e 100644
--- a/include/freetype/internal/tfm.h
+++ b/include/freetype/internal/tfm.h
@@ -46,9 +46,9 @@ FT_BEGIN_HEADER
   typedef struct  TFM_FontInfoRec_
   {
     /* Font Info */
-    FT_ULong       cs;
+    FT_Long        cs; /* Check Sum */
     /* Metrics */
-    FT_ULong       ds;
+    FT_ULong       ds; /* Design Size */
     FT_UInt        design_size;
     FT_UInt        slant;
     FT_UInt        begin_char, end_char;
@@ -59,6 +59,8 @@ FT_BEGIN_HEADER
 
   } TFM_FontInfoRec, *TFM_FontInfo;
 
+  #define RDS2PT(rds)    (tfm->design_size * ((FT_Long)(rds)/(FT_Long)(1<<20)))
+
   /*************************************************************************/
   /*************************************************************************/
   /*****                                                               *****/
@@ -118,9 +120,6 @@ FT_BEGIN_HEADER
     FT_Error
     (*parse_metrics)( TFM_Parser  parser );
 
-    FT_Error
-    (*parse_kern)( TFM_Parser  parser );
-
     void
     (*done)( TFM_Parser  parser );
 
diff --git a/src/gf/gfdrivr.h b/src/gf/gfdrivr.h
index f486f97..0dc631a 100644
--- a/src/gf/gfdrivr.h
+++ b/src/gf/gfdrivr.h
@@ -43,7 +43,7 @@ FT_BEGIN_HEADER
   {
     FT_UInt         code_min, code_max;
     GF_Bitmap       bm_table;
-    FT_UInt         ds, hppp, vppp;
+    FT_Int          ds, hppp, vppp;
     FT_UInt         font_bbx_w, font_bbx_h;
     FT_UInt         font_bbx_xoff, font_bbx_yoff;
 
diff --git a/src/gf/gflib.c b/src/gf/gflib.c
index 323190d..25bb3b6 100644
--- a/src/gf/gflib.c
+++ b/src/gf/gflib.c
@@ -317,7 +317,7 @@ FT_Byte  bit_table[] = {
     GF_Glyph        go;
     GF_Bitmap       bm;
     FT_Byte         instr, d, pre, id, k, code;
-    FT_ULong        ds, check_sum, hppp, vppp;
+    FT_Long         ds, check_sum, hppp, vppp;
     FT_Long         min_m, max_m, min_n, max_n, w;
     FT_UInt         dx, dy;
     FT_Long         ptr_post, ptr_p, ptr, optr;
@@ -334,7 +334,6 @@ FT_Byte  bit_table[] = {
     pre = READ_UINT1( stream );
     if (pre != GF_PRE)
     {
-      FT_ERROR(( "gf_load_font: missing GF_PRE(247) field\n" ));
       error = FT_THROW( Unknown_File_Format );
       goto Exit;
     }
@@ -342,7 +341,6 @@ FT_Byte  bit_table[] = {
     id = READ_UINT1( stream );
     if (id != GF_ID)
     {
-      FT_ERROR(( "gf_load_font: missing GF_ID(131) field\n" ));
       error = FT_THROW( Unknown_File_Format );
       goto Exit;
     }
@@ -428,6 +426,8 @@ FT_Byte  bit_table[] = {
     min_n     = READ_INT4( stream );
     max_n     = READ_INT4( stream );
 
+    FT_TRACE5(( "gf_load_font: checksum is %ld\n",check_sum ));
+
     if( ptr_p < 0 )     /* Defined to use ptr_p */
     {
       FT_ERROR(( "gf_load_font: invalid pointer in postamble\n" ));



reply via email to

[Prev in Thread] Current Thread [Next in Thread]