freetype-commit
[Top][All Lists]
Advanced

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

[freetype2-demos] master 17b1223: Undo inadvertent revert.


From: Alexei Podtelezhnikov
Subject: [freetype2-demos] master 17b1223: Undo inadvertent revert.
Date: Sat, 24 Jun 2017 21:51:56 -0400 (EDT)

branch: master
commit 17b1223bb28367a53417ba047b59bc532875e0c5
Author: Alexei Podtelezhnikov <address@hidden>
Commit: Alexei Podtelezhnikov <address@hidden>

    Undo inadvertent revert.
---
 src/ftcommon.c | 24 +++++++-----------------
 1 file changed, 7 insertions(+), 17 deletions(-)

diff --git a/src/ftcommon.c b/src/ftcommon.c
index bdb3904..4aed753 100644
--- a/src/ftcommon.c
+++ b/src/ftcommon.c
@@ -899,28 +899,18 @@
 
       if ( FT_HAS_GLYPH_NAMES( face ) )
       {
-        char*         p;
-        const char*   format = ", name: ";
-        unsigned int  format_len, glyph_idx;
+        unsigned int  glyph_idx;
 
 
-        p = buf + x;
-        x = 256 - x;
+        x += sprintf( buf + x, ", name: " );
 
-        format_len = strlen( format );
+        glyph_idx = (unsigned int)idx;
+        if ( handle->encoding != FT_ENCODING_ORDER )
+          glyph_idx = FTDemo_Get_Index( handle, (FT_UInt32)idx );
 
-        if ( x >= (signed int)format_len + 2 )
-        {
-          glyph_idx = (unsigned int)idx;
-          if ( handle->encoding != FT_ENCODING_ORDER )
-            glyph_idx = FTDemo_Get_Index( handle, (FT_UInt32)idx );
-
-          strcpy( p, format );
-          if ( FT_Get_Glyph_Name( face, glyph_idx,
-                                  p + format_len, x - format_len ) )
-            *p = '\0';
-        }
+        FT_Get_Glyph_Name( face, glyph_idx, buf + x, 256 - x );
       }
+
       grWriteCellString( display->bitmap, 0, (line++) * HEADER_HEIGHT,
                          buf, display->fore_color );
     }



reply via email to

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