freetype-commit
[Top][All Lists]
Advanced

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

[freetype2-demos] master 6204daa 2/3: Prepare suppression of named insta


From: Werner LEMBERG
Subject: [freetype2-demos] master 6204daa 2/3: Prepare suppression of named instances.
Date: Thu, 14 Jul 2016 13:03:05 +0000 (UTC)

branch: master
commit 6204daabd27adbfde564be6b59ce39af2e98fe4d
Author: Werner Lemberg <address@hidden>
Commit: Werner Lemberg <address@hidden>

    Prepare suppression of named instances.
    
    No functional change.
    
    * src/ftcommon.c (FTDemo_Install_Font): Add boolean parameter to
    avoid loading of instances.
    * src/ftcommon.h: Updated.
    * src/ftgrid.c (main), src/ftstring.c (main), src/ftview.c (main):
    Updated.
---
 ChangeLog      |   12 ++++++++++++
 src/ftcommon.c |    5 +++--
 src/ftcommon.h |    3 ++-
 src/ftgrid.c   |    2 +-
 src/ftstring.c |    2 +-
 src/ftview.c   |    2 +-
 6 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9dec897..180b490 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2016-07-14  Werner Lemberg  <address@hidden>
 
+       Prepare suppression of named instances.
+
+       No functional change.
+
+       * src/ftcommon.c (FTDemo_Install_Font): Add boolean parameter to
+       avoid loading of instances.
+       * src/ftcommon.h: Updated.
+       * src/ftgrid.c (main), src/ftstring.c (main), src/ftview.c (main):
+       Updated.
+
+2016-07-14  Werner Lemberg  <address@hidden>
+
        [ftgrid] Properly handle named instances.
 
        * src/ftgrid.c (event_font_change): Properly initialize the design
diff --git a/src/ftcommon.c b/src/ftcommon.c
index 1197f89..1c00c45 100644
--- a/src/ftcommon.c
+++ b/src/ftcommon.c
@@ -352,7 +352,8 @@
   FT_Error
   FTDemo_Install_Font( FTDemo_Handle*  handle,
                        const char*     filepath,
-                       FT_Bool         outline_only )
+                       FT_Bool         outline_only,
+                       FT_Bool         no_instances )
   {
     static char   filename[1024 + 5];
     long          i, num_faces;
@@ -390,7 +391,7 @@
       error = FT_New_Face( handle->library, filename, -( i + 1 ), &face );
       if ( error )
         continue;
-      instance_count = face->style_flags >> 16;
+      instance_count = no_instances ? 0 : face->style_flags >> 16;
       FT_Done_Face( face );
 
       /* load face with and without named instances */
diff --git a/src/ftcommon.h b/src/ftcommon.h
index 1f8667e..e471dcc 100644
--- a/src/ftcommon.h
+++ b/src/ftcommon.h
@@ -222,7 +222,8 @@
   FT_Error
   FTDemo_Install_Font( FTDemo_Handle*  handle,
                        const char*     filepath,
-                       FT_Bool         outline_only );
+                       FT_Bool         outline_only,
+                       FT_Bool         no_instances );
 
 
   void
diff --git a/src/ftgrid.c b/src/ftgrid.c
index 0fe48b8..0b33a85 100644
--- a/src/ftgrid.c
+++ b/src/ftgrid.c
@@ -1952,7 +1952,7 @@
 
     for ( ; argc > 0; argc--, argv++ )
     {
-      error = FTDemo_Install_Font( handle, argv[0], 1 );
+      error = FTDemo_Install_Font( handle, argv[0], 1, 0 );
       if ( error == FT_Err_Invalid_Argument )
         fprintf( stderr, "skipping font `%s' without outlines\n",
                          argv[0] );
diff --git a/src/ftstring.c b/src/ftstring.c
index 1a30d79..b95cd47 100644
--- a/src/ftstring.c
+++ b/src/ftstring.c
@@ -665,7 +665,7 @@
 
     for ( ; argc > 0; argc--, argv++ )
     {
-      error = FTDemo_Install_Font( handle, argv[0], 0 );
+      error = FTDemo_Install_Font( handle, argv[0], 0, 0 );
 
       if ( error )
       {
diff --git a/src/ftview.c b/src/ftview.c
index 4affcf8..2a0c9dd 100644
--- a/src/ftview.c
+++ b/src/ftview.c
@@ -1972,7 +1972,7 @@
       FTDemo_Set_Preload( handle, 1 );
 
     for ( ; argc > 0; argc--, argv++ )
-      FTDemo_Install_Font( handle, argv[0], 0 );
+      FTDemo_Install_Font( handle, argv[0], 0, 0 );
 
     if ( handle->num_fonts == 0 )
       Fatal( "could not find/open any font file" );



reply via email to

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