Hi,
For testing the `tfm' module in `ftview', I tried to do some
changes in the `ftcommon.c' file, but could not solve the
problem, can you tell me what am I missing in this.

Here is the diff of my changes in `ftcommon.c':

diff --git a/src/ftcommon.c b/src/ftcommon.c
index 1ef3495..3526231 100644
--- a/src/ftcommon.c
+++ b/src/ftcommon.c
@@ -236,7 +236,7 @@
       const char*  format = FT_Get_Font_Format( *aface );


-      if ( !strcmp( format, "Type 1" ) )
+      if ( !strcmp( format, "Type 1" ) || !strcmp( format, "gf" ) )
       {
         char   orig[5];
         char*  suffix        = (char*)strrchr( font->filepathname, '.' );
@@ -251,10 +251,18 @@
           /* we have already allocated four more bytes */
           suffix = (char*)font->filepathname + strlen( font->filepathname
);

-        memcpy( suffix, ".afm", 5 );
-        if ( FT_Attach_File( *aface, font->filepathname ) )
+        if( !strcmp( format, "Type 1" ) )
         {
-          memcpy( suffix, ".pfm", 5 );
+          memcpy( suffix, ".afm", 5 );
+          if ( FT_Attach_File( *aface, font->filepathname ) )
+          {
+            memcpy( suffix, ".pfm", 5 );
+            FT_Attach_File( *aface, font->filepathname );
+          }
+        }
+        else if( !strcmp( format, "gf" ) )
+        {
+          memcpy( suffix, ".tfm", 5 );
           FT_Attach_File( *aface, font->filepathname );
         }

Thank you

Parth
_______________________________________________
Freetype-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/freetype-devel

Reply via email to