Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType Demo Programs
Commits:
-
f1fd7352
by Alexei Podtelezhnikov at 2023-02-07T23:26:40+00:00
1 changed file:
Changes:
... | ... | @@ -282,6 +282,7 @@ |
282 | 282 | static void
|
283 | 283 | Clear_Display( void )
|
284 | 284 | {
|
285 | + /* fast black background */
|
|
285 | 286 | memset( bit->buffer, 0, (size_t)bit->rows *
|
286 | 287 | (size_t)( bit->pitch < 0 ? -bit->pitch
|
287 | 288 | : bit->pitch ) );
|
... | ... | @@ -386,7 +387,7 @@ |
386 | 387 | Render_All( unsigned int first_glyph,
|
387 | 388 | int pt_size )
|
388 | 389 | {
|
389 | - FT_F26Dot6 start_x, start_y, step_y, x, y;
|
|
390 | + int start_x, start_y, step_y, x, y, w;
|
|
390 | 391 | unsigned int i;
|
391 | 392 | |
392 | 393 | |
... | ... | @@ -421,11 +422,8 @@ |
421 | 422 | }
|
422 | 423 | #endif
|
423 | 424 | |
424 | - Render_Glyph( x, y );
|
|
425 | - |
|
426 | - x += ( ( glyph->metrics.horiAdvance + 32 ) >> 6 ) + 1;
|
|
427 | - |
|
428 | - if ( x + size->metrics.x_ppem > bit->width )
|
|
425 | + w = ( ( glyph->metrics.horiAdvance + 32 ) >> 6 ) + 1;
|
|
426 | + if ( x + w > bit->width - 4 )
|
|
429 | 427 | {
|
430 | 428 | x = start_x;
|
431 | 429 | y += step_y;
|
... | ... | @@ -433,6 +431,9 @@ |
433 | 431 | if ( y >= bit->rows )
|
434 | 432 | return FT_Err_Ok;
|
435 | 433 | }
|
434 | + |
|
435 | + Render_Glyph( x, y );
|
|
436 | + x += w;
|
|
436 | 437 | }
|
437 | 438 | else
|
438 | 439 | Fail++;
|