freetype-commit
[Top][All Lists]
Advanced

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

[freetype2-demos] GSoC-2020-anuj ce1aba6 3/5: [ftsdf] Added function to


From: Anuj Verma
Subject: [freetype2-demos] GSoC-2020-anuj ce1aba6 3/5: [ftsdf] Added function to display information during the demo.
Date: Sat, 22 Aug 2020 01:37:48 -0400 (EDT)

branch: GSoC-2020-anuj
commit ce1aba6969724a60072e0d1af050c0bdc3310845
Author: Anuj Verma <anujv@iitbhilai.ac.in>
Commit: Anuj Verma <anujv@iitbhilai.ac.in>

    [ftsdf] Added function to display information during the demo.
    
    * src/ftsdf.c (write_header): The function write specific information to 
the display
      while the demo is running.
---
 src/ftsdf.c | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/src/ftsdf.c b/src/ftsdf.c
index 3f1d50b..e2e9574 100644
--- a/src/ftsdf.c
+++ b/src/ftsdf.c
@@ -187,5 +187,37 @@
     grListenSurface( display->surface, gr_event_key, &dummy );
   }
 
+  static void
+  write_header()
+  {
+    /* This function simply prints some information to the top */
+    /* left of the screen. The information contains various    */
+    /* properties and values etc.                              */
+
+    static char   header_string[512];
+
+    sprintf( header_string, "Glyph Index: %d, Pt Size: %d, Spread: %d, Scale: 
%d",
+             status.glyph_index, status.ptsize, status.spread, status.scale );
+    grWriteCellString( display->bitmap, 0, 0, header_string, 
display->fore_color );
+
+    sprintf( header_string, "Position Offset: %d,%d", status.x_offset, 
status.y_offset );
+    grWriteCellString( display->bitmap, 0, 1 * HEADER_HEIGHT, header_string, 
display->fore_color );
+
+    sprintf( header_string, "SDF Generated in: %.0f ms, From: %s", 
status.generation_time,
+             status.use_bitmap ? "Bitmap" : "Outline" );
+    grWriteCellString( display->bitmap, 0, 2 * HEADER_HEIGHT, header_string, 
display->fore_color );
+
+    sprintf( header_string, "Filtering: %s, View: %s", 
status.nearest_filtering ? "Nearest" : "Bilinear",
+                                                       status.reconstruct ? 
"Reconstructing": "Raw" );
+    grWriteCellString( display->bitmap, 0, 3 * HEADER_HEIGHT, header_string, 
display->fore_color );
+
+    if ( status.reconstruct )
+    {
+      /* Only print these in reconstruction mode. */
+      sprintf( header_string, "Width: %.2f, Edge: %.2f", status.width, 
status.edge );
+      grWriteCellString( display->bitmap, 0, 4 * HEADER_HEIGHT, header_string, 
display->fore_color );
+    }
+  }
+
 
 /* END */



reply via email to

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