freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype-demos][master] * src/ftstring.c (Render_Waterfal


From: Alexei Podtelezhnikov (@apodtele)
Subject: [Git][freetype/freetype-demos][master] * src/ftstring.c (Render_Waterfall): Avoid bitmap reloading.
Date: Fri, 27 Jan 2023 04:01:27 +0000

Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType Demo Programs

Commits:

  • da9f2a31
    by Alexei Podtelezhnikov at 2023-01-26T22:57:38-05:00
    * src/ftstring.c (Render_Waterfall): Avoid bitmap reloading.
    
    This hides horrible performance of compressed PCF fonts.
    

1 changed file:

Changes:

  • src/ftstring.c
    ... ... @@ -862,10 +862,13 @@
    862 862
     
    
    863 863
         while ( 1 )
    
    864 864
         {
    
    865
    -      pt_size += step;
    
    865
    +      pt_size  += step;
    
    866
    +      pt_height = handle->scaler.height;
    
    866 867
     
    
    867 868
           FTDemo_Set_Current_Charsize( handle, pt_size, status.res );
    
    868
    -      FTDemo_String_Load( handle, &status.sc );
    
    869
    +      /* avoid reloading repetitive sizes with bitmap fonts */
    
    870
    +      if ( handle->scaler.height != pt_height )
    
    871
    +        FTDemo_String_Load( handle, &sc );
    
    869 872
     
    
    870 873
           error = FTDemo_Get_Size( handle, &size );
    
    871 874
           if ( error )
    
    ... ... @@ -886,6 +889,7 @@
    886 889
                               x, y + ( size->metrics.descender >> 6 ) );
    
    887 890
         }
    
    888 891
     
    
    892
    +    /* restore the original size */
    
    889 893
         FTDemo_Set_Current_Charsize( handle, status.ptsize, status.res );
    
    890 894
         FTDemo_String_Load( handle, &status.sc );
    
    891 895
     
    


  • reply via email to

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