freetype-commit
[Top][All Lists]
Advanced

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

[freetype2-demos] master ba4e8e6 2/2: [ttdebug] Add option `-f' to acces


From: Werner LEMBERG
Subject: [freetype2-demos] master ba4e8e6 2/2: [ttdebug] Add option `-f' to access non-first member of TTC.
Date: Tue, 24 Jul 2018 04:23:28 -0400 (EDT)

branch: master
commit ba4e8e6eba370b193de869f4a34e19269ad0e78b
Author: Hin-Tak Leung <address@hidden>
Commit: Werner Lemberg <address@hidden>

    [ttdebug] Add option `-f' to access non-first member of TTC.
    
    * src/ttdebug.1, src/ttdebug.c: Add a `-f face_index' switch to
    access non-first member of a TTC, plus updating the man page.
    
    Signed-off-by: Hin-Tak Leung <address@hidden>
---
 ChangeLog     |  7 +++++++
 src/ttdebug.1 |  6 ++++++
 src/ttdebug.c | 10 ++++++++--
 3 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 00f2cef..57d0364 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2018-07-23  Hin-Tak Leung <address@hidden>
+
+       [ttdebug] Add option `-f' to access non-first member of TTC.
+
+       * src/ttdebug.1, src/ttdebug.c: Add a `-f face_index' switch to
+       access non-first member of a TTC, plus updating the man page.
+
 2018-07-05  Alexei Podtelezhnikov  <address@hidden>
 
        * graph/grfont.c (grGotobitmap): Initialize color here...
diff --git a/src/ttdebug.1 b/src/ttdebug.1
index fb8c946..8bfb03a 100644
--- a/src/ttdebug.1
+++ b/src/ttdebug.1
@@ -45,6 +45,12 @@ call
 without an argument to get the actual list.
 .
 .TP
+.BI "\-f " face_index
+To access member font
+.IR face_index
+(default zero) in TTCs.
+.
+.TP
 .B \-v
 Show version.
 .
diff --git a/src/ttdebug.c b/src/ttdebug.c
index 0745e03..def2d72 100644
--- a/src/ttdebug.c
+++ b/src/ttdebug.c
@@ -1973,6 +1973,7 @@
       "\n"
       "  -I ver    Use TT interpreter version VER.\n"
       "            Available versions are %s; default is version %d.\n"
+      "  -f idx    Access font IDX if input file is a TTC (default: 0).\n"
       "  -v        Show version.\n"
       "\n"
       "While running, press the `?' key for help.\n"
@@ -2002,6 +2003,7 @@
                                   TT_INTERPRETER_VERSION_38,
                                   TT_INTERPRETER_VERSION_40 };
     int           version;
+    int           face_index = 0;
 
     int  tmp;
 
@@ -2052,7 +2054,7 @@
 
     while ( 1 )
     {
-      option = getopt( argc, argv, "I:v" );
+      option = getopt( argc, argv, "I:f:v" );
 
       if ( option == -1 )
         break;
@@ -2086,6 +2088,10 @@
         }
         break;
 
+      case 'f':
+        face_index = atoi( optarg );
+        break;
+
       case 'v':
         printf( "%s\n", version_string );
         exit( 0 );
@@ -2133,7 +2139,7 @@
 
     while ( !error )
     {
-      error = FT_New_Face( library, file_name, 0, (FT_Face*)&face );
+      error = FT_New_Face( library, file_name, face_index, (FT_Face*)&face );
       if ( error )
         Abort( "could not open input font file" );
 



reply via email to

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