Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType Demo Programs
Commits:
-
da9f2a31
by Alexei Podtelezhnikov at 2023-01-26T22:57:38-05:00
1 changed file:
Changes:
... | ... | @@ -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 |