freetype-commit
[Top][All Lists]
Advanced

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

[freetype2-demos] master 017812b: * src/ftdump.c (Print_Name): Report `h


From: Alexei Podtelezhnikov
Subject: [freetype2-demos] master 017812b: * src/ftdump.c (Print_Name): Report `head' revision and timestamps.
Date: Fri, 26 Oct 2018 23:30:44 -0400 (EDT)

branch: master
commit 017812bfdd42ce105325441ff6b752e4de518d79
Author: Alexei Podtelezhnikov <address@hidden>
Commit: Alexei Podtelezhnikov <address@hidden>

    * src/ftdump.c (Print_Name): Report `head' revision and timestamps.
---
 ChangeLog    |  4 ++++
 src/ftdump.c | 17 +++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index dcc8a56..48122e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2018-10-26  Alexei Podtelezhnikov  <address@hidden>
+
+       * src/ftdump.c (Print_Name): Report `head' revision and timestamps.
+
 2018-10-06  Alexei Podtelezhnikov  <address@hidden>
 
        * src/ftdump.c (Print_Charmaps): Rework without \b.
diff --git a/src/ftdump.c b/src/ftdump.c
index 3672fe9..ef157fe 100644
--- a/src/ftdump.c
+++ b/src/ftdump.c
@@ -37,6 +37,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <time.h>
 
 
   static FT_Error  error;
@@ -111,6 +112,7 @@
   Print_Name( FT_Face  face )
   {
     const char*  ps_name;
+    TT_Header*   head;
 
 
     printf( "font name entries\n" );
@@ -125,6 +127,21 @@
       ps_name = "UNAVAILABLE";
 
     printf( "   postscript: %s\n", ps_name );
+
+    head = (TT_Header*)FT_Get_Sfnt_Table( face, FT_SFNT_HEAD );
+    if ( head )
+    {
+      time_t  created  = ( head->Created [0] << 32 ) + head->Created [1]
+                         - 2082844800;
+      time_t  modified = ( head->Modified[0] << 32 ) + head->Modified[1]
+                         - 2082844800;
+
+
+      printf("   revision:   %.2f\n", head->Font_Revision / 65536.0 );
+      printf("   created:    %s", ctime( &created  ) );
+      printf("   modified:   %s", ctime( &modified ) );
+    }
+
   }
 
 



reply via email to

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