freetype-commit
[Top][All Lists]
Advanced

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

[freetype2-demos] master da9f2a3: * src/ftstring.c (Render_Waterfall): A


From: Werner Lemberg
Subject: [freetype2-demos] master da9f2a3: * src/ftstring.c (Render_Waterfall): Avoid bitmap reloading.
Date: Thu, 26 Jan 2023 23:01:35 -0500 (EST)

branch: master
commit da9f2a319731520aff8d2ccf64a638cab622afac
Author: Alexei Podtelezhnikov <apodtele@gmail.com>
Commit: Alexei Podtelezhnikov <apodtele@gmail.com>

    * src/ftstring.c (Render_Waterfall): Avoid bitmap reloading.
    
    This hides horrible performance of compressed PCF fonts.
---
 src/ftstring.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/ftstring.c b/src/ftstring.c
index a81929c..21d5c08 100644
--- a/src/ftstring.c
+++ b/src/ftstring.c
@@ -862,10 +862,13 @@
 
     while ( 1 )
     {
-      pt_size += step;
+      pt_size  += step;
+      pt_height = handle->scaler.height;
 
       FTDemo_Set_Current_Charsize( handle, pt_size, status.res );
-      FTDemo_String_Load( handle, &status.sc );
+      /* avoid reloading repetitive sizes with bitmap fonts */
+      if ( handle->scaler.height != pt_height )
+        FTDemo_String_Load( handle, &sc );
 
       error = FTDemo_Get_Size( handle, &size );
       if ( error )
@@ -886,6 +889,7 @@
                           x, y + ( size->metrics.descender >> 6 ) );
     }
 
+    /* restore the original size */
     FTDemo_Set_Current_Charsize( handle, status.ptsize, status.res );
     FTDemo_String_Load( handle, &status.sc );
 



reply via email to

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