Commits:
-
f634e5c4
by Alexei Podtelezhnikov
at 2022-09-11T22:06:49-04:00
* src/ftcommon.c (FTDemo_Display_New): Handle window titles.
* src/ftcommon.h: Update its prototype.
* src/ftgamma.c, src/ftgrid.c, src/ftsdf.c, src/ftstring.c, src/ftview.c
(main): Updated accordingly.
7 changed files:
Changes:
src/ftcommon.c
... |
... |
@@ -98,7 +98,8 @@ |
98
|
98
|
|
99
|
99
|
FTDemo_Display*
|
100
|
100
|
FTDemo_Display_New( const char* device,
|
101
|
|
- const char* dims )
|
|
101
|
+ const char* dims,
|
|
102
|
+ const char* title )
|
102
|
103
|
{
|
103
|
104
|
FTDemo_Display* display;
|
104
|
105
|
grPixelMode mode;
|
... |
... |
@@ -165,6 +166,9 @@ |
165
|
166
|
|
166
|
167
|
grSetTargetGamma( display->surface, display->gamma );
|
167
|
168
|
|
|
169
|
+ if ( title )
|
|
170
|
+ grSetTitle( display->surface, title );
|
|
171
|
+
|
168
|
172
|
return display;
|
169
|
173
|
}
|
170
|
174
|
|
src/ftcommon.h
... |
... |
@@ -86,7 +86,8 @@ |
86
|
86
|
|
87
|
87
|
FTDemo_Display*
|
88
|
88
|
FTDemo_Display_New( const char* device,
|
89
|
|
- const char* dims );
|
|
89
|
+ const char* dims,
|
|
90
|
+ const char* title );
|
90
|
91
|
|
91
|
92
|
|
92
|
93
|
void
|
src/ftgamma.c
... |
... |
@@ -372,14 +372,13 @@ |
372
|
372
|
char buf[4];
|
373
|
373
|
int i;
|
374
|
374
|
|
375
|
|
- display = FTDemo_Display_New( NULL, DIM "x24" );
|
|
375
|
+ display = FTDemo_Display_New( NULL, DIM "x24",
|
|
376
|
+ "FreeType Gamma Matcher - press ? for help" );
|
376
|
377
|
if ( !display )
|
377
|
378
|
{
|
378
|
379
|
PanicZ( "could not allocate display surface" );
|
379
|
380
|
}
|
380
|
381
|
|
381
|
|
- grSetTitle( display->surface, "FreeType Gamma Matcher - press ? for help" );
|
382
|
|
-
|
383
|
382
|
grNewBitmap( bit1.mode, bit1.grays, bit1.width, bit1.rows, &bit1 );
|
384
|
383
|
GammaGrid( &bit1 );
|
385
|
384
|
|
src/ftgrid.c
... |
... |
@@ -1841,12 +1841,11 @@ |
1841
|
1841
|
if ( handle->num_fonts == 0 )
|
1842
|
1842
|
Fatal( "could not find/open any font file" );
|
1843
|
1843
|
|
1844
|
|
- display = FTDemo_Display_New( status.device, status.dims );
|
|
1844
|
+ display = FTDemo_Display_New( status.device, status.dims,
|
|
1845
|
+ "FreeType Glyph Grid Viewer - press ? for help" );
|
1845
|
1846
|
if ( !display )
|
1846
|
1847
|
Fatal( "could not allocate display surface" );
|
1847
|
1848
|
|
1848
|
|
- grSetTitle( display->surface,
|
1849
|
|
- "FreeType Glyph Grid Viewer - press ? for help" );
|
1850
|
1849
|
FTDemo_Icon( handle, display );
|
1851
|
1850
|
|
1852
|
1851
|
grid_status_display( &status, display );
|
src/ftsdf.c
... |
... |
@@ -702,7 +702,8 @@ |
702
|
702
|
goto Exit;
|
703
|
703
|
}
|
704
|
704
|
|
705
|
|
- display = FTDemo_Display_New( NULL, "800x600x24" );
|
|
705
|
+ display = FTDemo_Display_New( NULL, "800x600x24",
|
|
706
|
+ "Signed Distance Field Viewer" );
|
706
|
707
|
if ( !display )
|
707
|
708
|
{
|
708
|
709
|
printf( "Failed to create FTDemo_Display\n" );
|
... |
... |
@@ -712,7 +713,6 @@ |
712
|
713
|
FT_CALL( FT_Property_Set( handle->library, "sdf", "flip_y", &flip_y ) );
|
713
|
714
|
FT_CALL( FT_Property_Set( handle->library, "bsdf", "flip_y", &flip_y ) );
|
714
|
715
|
|
715
|
|
- grSetTitle( display->surface, "Signed Distance Field Viewer" );
|
716
|
716
|
event_color_change();
|
717
|
717
|
|
718
|
718
|
FT_CALL( FT_New_Face( handle->library, argv[2], 0, &status.face ) );
|
src/ftstring.c
... |
... |
@@ -971,13 +971,11 @@ |
971
|
971
|
if ( handle->num_fonts == 0 )
|
972
|
972
|
PanicZ( "could not open any font file" );
|
973
|
973
|
|
974
|
|
- display = FTDemo_Display_New( status.device, status.dims );
|
975
|
|
-
|
|
974
|
+ display = FTDemo_Display_New( status.device, status.dims,
|
|
975
|
+ "FreeType String Viewer - press ? for help" );
|
976
|
976
|
if ( !display )
|
977
|
977
|
PanicZ( "could not allocate display surface" );
|
978
|
978
|
|
979
|
|
- grSetTitle( display->surface,
|
980
|
|
- "FreeType String Viewer - press ? for help" );
|
981
|
979
|
FTDemo_Icon( handle, display );
|
982
|
980
|
|
983
|
981
|
status.header = NULL;
|
src/ftview.c
... |
... |
@@ -1842,12 +1842,11 @@ |
1842
|
1842
|
if ( handle->num_fonts == 0 )
|
1843
|
1843
|
Fatal( "could not find/open any font file" );
|
1844
|
1844
|
|
1845
|
|
- display = FTDemo_Display_New( status.device, status.dims );
|
|
1845
|
+ display = FTDemo_Display_New( status.device, status.dims,
|
|
1846
|
+ "FreeType Glyph Viewer - press ? for help" );
|
1846
|
1847
|
if ( !display )
|
1847
|
1848
|
Fatal( "could not allocate display surface" );
|
1848
|
1849
|
|
1849
|
|
- grSetTitle( display->surface,
|
1850
|
|
- "FreeType Glyph Viewer - press ? for help" );
|
1851
|
1850
|
FTDemo_Icon( handle, display );
|
1852
|
1851
|
|
1853
|
1852
|
status.num_fails = 0;
|
|