freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype-demos][master] * src/ftmulti.c (Render_All): Tig


From: Alexei Podtelezhnikov (@apodtele)
Subject: [Git][freetype/freetype-demos][master] * src/ftmulti.c (Render_All): Tighten right margin.
Date: Tue, 07 Feb 2023 23:26:42 +0000

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

Commits:

  • f1fd7352
    by Alexei Podtelezhnikov at 2023-02-07T23:26:40+00:00
    * src/ftmulti.c (Render_All): Tighten right margin.

1 changed file:

Changes:

  • src/ftmulti.c
    ... ... @@ -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++;
    


  • reply via email to

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